-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow configuration of prometheus exporter to apply resource attributes as labels #4732
Comments
i'm happy to take this on with some guidance 😬 |
It would be nice for the Option to take a Filter so that it can be used with NewAllowKeysFilter and NewDenyKeysFilter, or a custom (e.g. regex) function. The option name could be something like You should cache the constant labels generated by the filter, similar to how we cache targetInfo. constant labels then need to be plumbed to each addFooMetric function, and appended to the existing attributes, e.g. here:
I'm happy to help however I can! |
@dashpole @MadVikingGod here's a first look at what i'm thinking based on your guidance, PTAL: #4733 |
This PR adds the `WithResourceAsConstantLabels` option to the Prometheus exporter to allow users to configure resource attributes to be applied on every metric. Fixes open-telemetry#4732 Signed-off-by: Alex Boten <aboten@lightstep.com>
This PR adds the `WithResourceAsConstantLabels` option to the Prometheus exporter to allow users to configure resource attributes to be applied on every metric. Fixes open-telemetry#4732 Signed-off-by: Alex Boten <aboten@lightstep.com>
…#4733) * add option for resource attributes in metrics for prometheus exporter This PR adds the `WithResourceAsConstantLabels` option to the Prometheus exporter to allow users to configure resource attributes to be applied on every metric. Fixes #4732 Signed-off-by: Alex Boten <aboten@lightstep.com> * add test, changelog Signed-off-by: Alex Boten <aboten@lightstep.com> * add test for including only a subset of tags, dont use a ptr Signed-off-by: Alex Boten <aboten@lightstep.com> * Update exporters/prometheus/config.go Co-authored-by: David Ashpole <dashpole@google.com> * include feedback from review Signed-off-by: Alex Boten <aboten@lightstep.com> * cache results Signed-off-by: Alex Boten <aboten@lightstep.com> * removed map in favour of single keyVals Signed-off-by: Alex Boten <aboten@lightstep.com> * Update exporters/prometheus/config.go Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com> * move check outside the createResourceAttributes and rename func Signed-off-by: Alex Boten <aboten@lightstep.com> --------- Signed-off-by: Alex Boten <aboten@lightstep.com> Co-authored-by: David Ashpole <dashpole@google.com> Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Problem Statement
To ensure backwards compatibility with OpenCensus generated metrics, the OpenTelemetry collector needs to be able to apply resource attributes as labels on every metric emitted by the Prometheus exporter.
Additional Context
This is related to open-telemetry/opentelemetry-specification#3761
Collector issue capturing additional details open-telemetry/opentelemetry-collector#7454
The text was updated successfully, but these errors were encountered: