prometheus_exporter icon indicating copy to clipboard operation
prometheus_exporter copied to clipboard

Support for dynamic labels/tags (set in runtime)

Open raivil opened this issue 5 years ago • 1 comments

Hi,

Are there plans to add support for dynamic labels/tags set in runtime?

The idea would be to add custom tags to support metrics segmented by Customers or any other attribute. Example:

sidekiq_job_duration_seconds{queue="default",worker="Jobs::SomeJobClass", customer_id="ABC"} 123456
sidekiq_jobs_total{queue="default",worker="Jobs::SomeJobClass", customer_id="ABC"} 65.0

For more context, on Newrelic or ELK APM's, it's possible to add custom labels or context data to transactions, that would work similarly to adding tags/labels to Prometheus metrics. Examples: ELK and Newrelic

I'm aware that it is usually a bad idea to place identifiers into Prometheus as it may cause huge memory consumption by both Prometheus and your application. https://prometheus.io/docs/practices/naming/#labels.

I'm not sure if this is the best way to accomplish that, and I'd appreciate your input.

Best,

raivil avatar Jul 28 '20 23:07 raivil

In general you would handle custom segmentation by writing a custom collector, perhaps inherit off the sidekiq collector and adjust to taste?

SamSaffron avatar Jul 29 '20 00:07 SamSaffron