Skip to content

[Exporter.Prometheus] Separate enums - #7751

Merged
martincostello merged 2 commits into
open-telemetry:mainfrom
martincostello:rename-prom-enum
Sep 16, 2026
Merged

martincostello merged 2 commits into
open-telemetry:mainfrom
martincostello:rename-prom-enum

Conversation

@martincostello

Copy link
Copy Markdown
Member

Changes

Separate the enums for the Prometheus translation strategy so the two different exporter packages don't have a public type with the same name.

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)

Separate the enums for the Prometheus translation strategy so the two different exporter packages don't have a public type with the same name.
Comment thread src/OpenTelemetry.Exporter.Prometheus.AspNetCore/CHANGELOG.md Outdated
@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, 2026
Comment thread src/OpenTelemetry.Exporter.Prometheus.HttpListener/CHANGELOG.md Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Both breaking-change entries need the repository-required colon in their prefixes.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Separates Prometheus translation strategy APIs by exporter to prevent public type-name collisions.

Changes:

  • Adds exporter-specific public enums backed by an internal shared enum.
  • Updates options, API baselines, and tests.
  • Documents the breaking renames.
File summaries
File Description
test/...HttpListener.Tests/PrometheusTranslationStrategyTests.cs Updates default enum assertion.
test/...HttpListener.Tests/PrometheusProtocolTests.cs Tests both exporter-specific enums.
test/...AspNetCore.Tests/PrometheusIntegrationTests.cs Uses the ASP.NET Core enum.
test/...AspNetCore.Tests/PrometheusExporterMiddlewareTests.cs Updates strategy scenarios.
test/...AspNetCore.Tests/PrometheusExporterMeterProviderBuilderExtensionsTests.cs Updates option tests.
src/...HttpListener/PrometheusHttpListenerTranslationStrategy.cs Adds the HttpListener enum.
src/...HttpListener/PrometheusHttpListenerOptions.cs Exposes the new enum.
src/...HttpListener/PrometheusHttpListenerMeterProviderBuilderExtensions.cs Converts to the internal enum.
src/...HttpListener/Internal/Shared/PrometheusTranslationStrategy.cs Makes the shared enum internal.
src/...HttpListener/CHANGELOG.md Documents the rename.
src/...HttpListener/.publicApi/PublicAPI.Unshipped.txt Updates the public API baseline.
src/...AspNetCore/PrometheusAspNetCoreTranslationStrategy.cs Adds the ASP.NET Core enum.
src/...AspNetCore/PrometheusAspNetCoreOptions.cs Bridges public and internal enums.
src/...AspNetCore/CHANGELOG.md Documents the rename.
src/...AspNetCore/.publicApi/PublicAPI.Unshipped.txt Updates the public API baseline.
Review details
  • Files reviewed: 15/15 changed files
  • Comments generated: 2
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/OpenTelemetry.Exporter.Prometheus.AspNetCore/CHANGELOG.md
Comment thread src/OpenTelemetry.Exporter.Prometheus.HttpListener/CHANGELOG.md
@codecov

codecov Bot commented Sep 15, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.86%. Comparing base (6265592) to head (4c1f417).
⚠️ Report is 5 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #7751      +/-   ##
==========================================
- Coverage   91.87%   91.86%   -0.02%     
==========================================
  Files         337      337              
  Lines       18380    18380              
==========================================
- Hits        16887    16884       -3     
- Misses       1493     1496       +3     
Flag Coverage Δ
unittests-Project-Experimental 91.96% <100.00%> (-0.03%) ⬇️
unittests-Project-Stable 91.97% <100.00%> (-0.03%) ⬇️
unittests-UnstableCoreLibraries-Experimental 50.73% <100.00%> (+<0.01%) ⬆️

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

Files with missing lines Coverage Δ
...ometheus.AspNetCore/PrometheusAspNetCoreOptions.cs 100.00% <100.00%> (ø)
...theusHttpListenerMeterProviderBuilderExtensions.cs 94.59% <100.00%> (ø)
...heus.HttpListener/PrometheusHttpListenerOptions.cs 100.00% <ø> (ø)

... and 1 file with indirect coverage changes

@Kielek Kielek left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. I will support this. It occurs in Splunk/Cisco internal Codex scans. I suppose it might occurs also in other similar tools.

I understand that it is breaking change, but we are still in pre-release mode. It is last moment to adjust.

@martincostello
martincostello marked this pull request as ready for review September 15, 2026 19:13
@martincostello
martincostello requested a review from a team as a code owner September 15, 2026 19:13
@martincostello martincostello added this to the v1.19.0 milestone Sep 16, 2026
@martincostello
martincostello added this pull request to the merge queue Sep 16, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Sep 16, 2026
@martincostello
martincostello added this pull request to the merge queue Sep 16, 2026
Merged via the queue into open-telemetry:main with commit 2103f6d Sep 16, 2026
81 checks passed
@martincostello
martincostello deleted the rename-prom-enum branch September 16, 2026 07:41
This was referenced Sep 28, 2026
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.

3 participants