Skip to content

prometheus-emitter (contrib-extension) - Allow custom bucket ranges for Timer type metrics #17684

@capistrant

Description

@capistrant

In the prometheus-emitter module, Metrics.java creates Timer type metrics with hard coded bucket boundaries. These boundaries make sense for some metrics, but not all. For instance, batch ingestion job times for hadoop ingest are rarely < 5 min at my shop, leading them to be categorized in the inf+ bucket which is not useful for reporting.

I think it will be fairly straightforward to allow the metrics config to override bucket boundaries, or else use these current defaults.

I hope to raise a PR to fix in the near term, but don't have immediate capacity so I am throwing up an issue in the event that someone feels the urge to grab it before me.

code snippet from the aforementioned Metrics.java class

...
} else if (Metric.Type.timer.equals(type)) {
        collector = new Histogram.Builder()
            .namespace(namespace)
            .name(formattedName)
            .labelNames(dimensions)
            .buckets(.1, .25, .5, .75, 1, 2.5, 5, 7.5, 10, 30, 60, 120, 300) // These are the static bucket ranges
            .help(metric.help)
            .register();
      }
...

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions