prometheus / client_ruby

Prometheus instrumentation library for Ruby applications
Apache License 2.0
519 stars 148 forks source link

Allowing instance labels #154

Closed rsetia closed 5 years ago

rsetia commented 5 years ago

https://prometheus.io/docs/instrumenting/writing_clientlibs/

I couldn't find a restriction on using "instance" or "job" labels in the spec. Instance labels are useful when using PushGateway and I am wondering if we can loosen the restriction on using it.

https://github.com/prometheus/client_ruby/blob/master/lib/prometheus/client/label_set_validator.rb#L9

rsetia commented 5 years ago

Prometheus::Client::Push.new('my-batch-job', 'foobar', 'https://example.domain:1234').add(registry)

is how one can specify the job and instance which will be used by the Push Gateway which should be sufficient.