Allow Prometheus exporter to add resource attributes to metric attributes#6179
Conversation
|
@jack-berg I need your help on 3 open issues before I can convert this to a normal PR:
|
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #6179 +/- ##
============================================
+ Coverage 90.97% 91.04% +0.07%
- Complexity 5670 5686 +16
============================================
Files 620 621 +1
Lines 16535 16623 +88
Branches 1682 1698 +16
============================================
+ Hits 15042 15134 +92
+ Misses 1023 998 -25
- Partials 470 491 +21 ☔ View full report in Codecov by Sentry. |
@codeboten has been working on that. He's merged a number of PRs recently updating the prometheus model, and we're working on the resource attributes part in open-telemetry/opentelemetry-configuration#67.
Sorry can you elaborate on this? I think you're referring to specific rules around |
|
@jack-berg Ok, got it - the environment is lowered case, and the |
|
No there shouldn't be. We normalize keys before reading as well. So if you set |
This is the code doing the normalization: Where is the replacement of "-" to "." ? It's only replacing "_" to ".", no? |
|
@jack-berg All fixed. Take a look |
jack-berg
left a comment
There was a problem hiding this comment.
Couple of small additional comments. Thanks!
|
@jack-berg All comments have been fixed (aside from one). |
|
FYI @open-telemetry/java-approvers I'm planning on merging this for the 1.35.0 release. |
|
@jack-berg i'm interested in this feature but I can't figure out how to use it. Are there docs? |
|
@Falmarri Currently the only way to use it is when you build the SDK manually completely. Then you can use the prometheus builder and set the predicate dictating which attributes to copy. |
Fixes #6108
This PR adds the ability to copy resource attributes to the labels of each data point, per a given regular expression.
Two new configurations have been introduced as part of this PR.