discourse / prometheus_exporter

A framework for collecting and aggregating prometheus metrics
MIT License
539 stars 156 forks source link

Use specified labels over default labels in merge conflicts #257

Closed ttstarck closed 2 years ago

ttstarck commented 2 years 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 2 years ago

Nice fix! thank you