Include resource attributes as target_info for Prometheus exporters#5407
Include resource attributes as target_info for Prometheus exporters#5407utpilla merged 24 commits intoopen-telemetry:mainfrom robertcoltheart:feature/resource-attribute-tags
target_info for Prometheus exporters#5407Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5407 +/- ##
==========================================
+ Coverage 83.38% 85.57% +2.19%
==========================================
Files 297 289 -8
Lines 12531 12640 +109
==========================================
+ Hits 10449 10817 +368
+ Misses 2082 1823 -259
Flags with carried forward coverage won't be shown. Click here to find out more.
|
|
@robertcoltheart Could you split the PR in to two parts?
It will help in reviewing the PR and separating public API addition from an internal change. Thanks! |
target_info for Prometheus exporters
|
Thanks @vishweshbankwar, updated per recommendations. Will raise the 2nd PR once this is merged. |
src/OpenTelemetry.Exporter.Prometheus.HttpListener/Internal/PrometheusCollectionManager.cs
Outdated
Show resolved
Hide resolved
src/OpenTelemetry.Exporter.Prometheus.HttpListener/CHANGELOG.md
Outdated
Show resolved
Hide resolved
src/OpenTelemetry.Exporter.Prometheus.HttpListener/Internal/PrometheusSerializer.cs
Show resolved
Hide resolved
|
I've added caching for target_info, this should be good to go now |
how come! 🤣 we didn't have prometheus exporter that far ! |
Lol yeah I'm guessing this was because I was running it locally? Not sure where the version number is coming from. |
Fixes #3087
Changes
Adds a
target_infosection to the Prometheus output.target_infois only displayed for clients using theAccept: application/openmetrics-textheader, since Prometheus will break on readinginfotypes with servers that don't send theContent-Type: application/openmetrics-textheader.Example output that shows
target_infowith resource attributes:Merge requirement checklist
CHANGELOG.mdfiles updated for non-trivial changes