-
Notifications
You must be signed in to change notification settings - Fork 780
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
Include resource attributes as target_info
for Prometheus exporters
#5407
Include resource attributes as target_info
for Prometheus exporters
#5407
Conversation
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. |
src/OpenTelemetry.Exporter.Prometheus.HttpListener/Internal/PrometheusCollectionManager.cs
Outdated
Show resolved
Hide resolved
src/OpenTelemetry.Exporter.Prometheus.HttpListener/Internal/PrometheusCollectionManager.cs
Show resolved
Hide resolved
src/OpenTelemetry.Exporter.Prometheus.HttpListener/Internal/PrometheusSerializer.cs
Outdated
Show resolved
Hide resolved
…ometheusSerializer.cs Co-authored-by: Utkarsh Umesan Pillai <[email protected]>
Fixes #3087
Changes
Adds a
target_info
section to the Prometheus output.target_info
is only displayed for clients using theAccept: application/openmetrics-text
header, since Prometheus will break on readinginfo
types with servers that don't send theContent-Type: application/openmetrics-text
header.Example output that shows
target_info
with resource attributes:Merge requirement checklist
CHANGELOG.md
files updated for non-trivial changes