Skip to content

fix(opentelemetry-exporter-prometheus)!: default exporter host to localhost#6599

Open
cjihrig wants to merge 1 commit into
open-telemetry:mainfrom
cjihrig:prom-host
Open

fix(opentelemetry-exporter-prometheus)!: default exporter host to localhost#6599
cjihrig wants to merge 1 commit into
open-telemetry:mainfrom
cjihrig:prom-host

Conversation

@cjihrig
Copy link
Copy Markdown
Contributor

@cjihrig cjihrig commented Apr 16, 2026

Which problem is this PR solving?

The Prometheus exporter's default host is undefined. The spec calls for the default to be 'localhost'.

Fixes #6594

Short description of the changes

This commit updates the Prometheus exporter's default host to be 'localhost' to match the spec. Tests were also updated as necessary to wait for the server to start.

Type of change

Please delete options that are not relevant.

  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

How Has This Been Tested?

  • Existing test suite.

Checklist:

  • Followed the style guidelines of this project

@cjihrig cjihrig requested a review from a team as a code owner April 16, 2026 03:43
Comment thread experimental/CHANGELOG.md Outdated
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.75%. Comparing base (8ee2a8b) to head (44071db).
⚠️ Report is 7 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6599      +/-   ##
==========================================
- Coverage   95.76%   95.75%   -0.02%     
==========================================
  Files         375      375              
  Lines       12739    12739              
  Branches     3013     3013              
==========================================
- Hits        12200    12198       -2     
- Misses        539      541       +2     
Files with missing lines Coverage Δ
...etry-exporter-prometheus/src/PrometheusExporter.ts 96.70% <ø> (ø)

... and 1 file with indirect coverage changes

🚀 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.

@maryliag
Copy link
Copy Markdown
Contributor

from @pichlermarc on otel-js-dev channel:
We are planning to publish SDK 3.0 around June/July, and have a milestone set up for it already. I'd suggest we do it there and communicate the change accordingly.

I'm not sure when we can start adding changes only for 3.0. Can you provide guidance @pichlermarc ?

Copy link
Copy Markdown
Member

@pichlermarc pichlermarc left a comment

Choose a reason for hiding this comment

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

@maryliag - I thought it'd be best to do this at the same time as 3.x (possibly also bumping this package from experimental to stable in the process).

I think this change will break a lot of users that rely on the default behavior being that it binds to all available network interfaces instead of localhost.

suggestion: let's put a warning there for now, letting people know that this will only bind to localhost in the future. Once we're working on 3.x, we change the behavior and we release it together with 3.x, and include guidance on what to do in the migration document. This way people have some time to change their settings accordingly instead of being broken without warning.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Set Prometheus exporter host to localhost by default

4 participants