discourse / prometheus_exporter

A framework for collecting and aggregating prometheus metrics
MIT License
525 stars 153 forks source link

Use specified labels over default labels in merge conflicts #257

Closed ttstarck closed 1 year ago

ttstarck commented 1 year ago

Currently, PrometheusExporter::Metrics::Base.default_labels will overwrite the labels specified when observing metrics in the labels_text output. This isn't ideal in scenarios where you want to specify a label key/value pair that doesn't match the default labels.

In this pull request, I've swapped the ordering of the merge such that we merge the specified labels into the default labels, meaning the specified labels have precedence over the default ones.

SamSaffron commented 1 year ago

Nice fix! thank you