elijah / chef-prometheus

Chef cookbook for Prometheus. The open source service monitoring system and time-series database.
Apache License 2.0
52 stars 93 forks source link

Using an array as the argument to target in the prometheus_job LWRP results in array of an array #41

Open rberger opened 9 years ago

rberger commented 9 years ago

If you pass and array in as the target argument for the prometheus_job lwrp like:

prometheus_job "influx" do
    target ["influx-001.example.com:9100", "influx-002.example.com:9100"]
    metrics_path "#{node['prometheus']['flags']['web.telemetry-path']}"
end

Results with an entry in prometheus.yml like:

- job_name: "influx"
  metrics_path: "/metrics"
  target_groups:
    - targets: [["influx-001.example.com:9100", "influx-002.example.com:9100"]]

Is this expected behavior?

I would have expected it to not wrap it in a extra array. Its not valid as a config for prometheus.yml

Am I doing something wrong?

Thanks, Rob

Magrath commented 9 years ago

No, I think that's a bug here in the template:- https://github.com/rayrod2030/chef-prometheus/blob/master/templates/default/prometheus.yml.erb#L17