Skip to content
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

Add meter-level tags to Prometheus exporter #5837

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

robertcoltheart
Copy link
Contributor

@robertcoltheart robertcoltheart commented Sep 15, 2024

Fixes #
#5836

Changes

Adds meter-level tags to Prometheus exporter. Any tags added to meter are automatically added to scrape output.

Merge requirement checklist

  • CONTRIBUTING guidelines followed (license requirements, nullable enabled, static analysis, etc.)
  • Unit tests added/updated
  • Appropriate CHANGELOG.md files updated for non-trivial changes
  • Changes in public API reviewed (if applicable)

@github-actions github-actions bot added pkg:OpenTelemetry.Exporter.Prometheus.AspNetCore Issues related to OpenTelemetry.Exporter.Prometheus.AspNetCore NuGet package pkg:OpenTelemetry.Exporter.Prometheus.HttpListener Issues related to OpenTelemetry.Exporter.Prometheus.HttpListener NuGet package labels Sep 15, 2024
Copy link

codecov bot commented Sep 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.30%. Comparing base (6250307) to head (8dd8011).
Report is 314 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #5837      +/-   ##
==========================================
+ Coverage   83.38%   86.30%   +2.91%     
==========================================
  Files         297      257      -40     
  Lines       12531    11170    -1361     
==========================================
- Hits        10449     9640     -809     
+ Misses       2082     1530     -552     
Flag Coverage Δ
unittests ?
unittests-Project-Experimental 86.22% <100.00%> (?)
unittests-Project-Stable 86.29% <100.00%> (?)
unittests-UnstableCoreLibraries-Experimental 85.82% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...heus.HttpListener/Internal/PrometheusSerializer.cs 87.15% <100.00%> (+2.28%) ⬆️

... and 218 files with indirect coverage changes

@robertcoltheart robertcoltheart marked this pull request as ready for review September 16, 2024 00:11
@robertcoltheart robertcoltheart requested a review from a team September 16, 2024 00:11
Copy link

@ProbablePrime ProbablePrime left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job!

Copy link
Contributor

@ysolomchenko ysolomchenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -404,6 +404,15 @@ public static int WriteTags(byte[] buffer, int cursor, Metric metric, ReadOnlyTa
buffer[cursor++] = unchecked((byte)',');
}

if (metric.MeterTags != null)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that the current tests have been updated to validate MeterTags. Is there a test that validates null MeterTags?"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg:OpenTelemetry.Exporter.Prometheus.AspNetCore Issues related to OpenTelemetry.Exporter.Prometheus.AspNetCore NuGet package pkg:OpenTelemetry.Exporter.Prometheus.HttpListener Issues related to OpenTelemetry.Exporter.Prometheus.HttpListener NuGet package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants