Skip to content

Conversation

@cjihrig
Copy link
Contributor

@cjihrig cjihrig commented Oct 8, 2025

Which problem is this PR solving?

This commit adds support for the without_scope_info option (converted to camelCase to match other options) from the spec.

Fixes # N/A

Related: Here are some output snapshots from the Golang library which include the scope labels.

Type of change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

  • Existing and new tests.

Checklist:

  • Followed the style guidelines of this project
  • Unit tests have been added

@cjihrig cjihrig requested a review from a team as a code owner October 8, 2025 11:44
@codecov
Copy link

codecov bot commented Oct 8, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.17%. Comparing base (4dc99dc) to head (156b153).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5993   +/-   ##
=======================================
  Coverage   95.16%   95.17%           
=======================================
  Files         316      316           
  Lines        9207     9217   +10     
  Branches     2075     2080    +5     
=======================================
+ Hits         8762     8772   +10     
  Misses        445      445           
Files with missing lines Coverage Δ
...etry-exporter-prometheus/src/PrometheusExporter.ts 96.70% <100.00%> (+0.07%) ⬆️
...ry-exporter-prometheus/src/PrometheusSerializer.ts 96.36% <100.00%> (+0.18%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

This commit adds support for the without_scope_info option
(converted to camelCase to match other options) from the spec.
@cjihrig
Copy link
Contributor Author

cjihrig commented Oct 23, 2025

@pichlermarc would you mind taking a look?

@cjihrig
Copy link
Contributor Author

cjihrig commented Oct 24, 2025

The Windows test failure appears to be a flake - #6042

@cjihrig
Copy link
Contributor Author

cjihrig commented Oct 29, 2025

Maybe @david-luna could take a look?

@trentm
Copy link
Contributor

trentm commented Oct 29, 2025

@cjihrig Are you able to provide some background for a reviewer that might not be so familiar with Prometheus, or exactly what references you mean by "from the spec.".

I clicked through to open-telemetry/opentelemetry-specification#4223 (comment) but am not sure if that is the best reference here.

@cjihrig
Copy link
Contributor Author

cjihrig commented Oct 29, 2025

Sure @trentm. I was looking at this page. Apologies if that shouldn't be referred to as the spec, but I assumed it was based on the "specs" in the URL. From that page, I was referring to:

A Prometheus Exporter MAY support a configuration option to produce metrics without scope labels. The option MAY be named without_scope_info, and MUST be false by default.

I changed the name from snake_case to camelCase to match the other options used in the JS repo.

Looking at the test data from the Golang repo, you can see examples like this one (or most of the other examples in that directory). Note the otel_scope_* labels. Then, look at this example, which disables the scope labels. That example does not contain the otel_scope_* labels.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants