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

Update default host and port for PrometheusExporter to align with the OTel spec. #2783

Merged
merged 12 commits into from
Jan 25, 2022

Conversation

Yun-Ting
Copy link
Contributor

@Yun-Ting Yun-Ting commented Jan 13, 2022

Fixes #.
#2780

Changes

Update default httpListenerPrefixes for PrometheusExporter to be http://localhost:9464/ to align with the spec: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/sdk-environment-variables.md#prometheus-exporter

For significant contributions please make sure you have completed the following items:

  • Appropriate CHANGELOG.md updated for non-trivial changes
  • Changes in public API reviewed

@Yun-Ting Yun-Ting marked this pull request as ready for review January 13, 2022 18:45
@Yun-Ting Yun-Ting requested a review from a team January 13, 2022 18:45
@codecov
Copy link

codecov bot commented Jan 13, 2022

Codecov Report

Merging #2783 (5926191) into main (1150f4a) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #2783   +/-   ##
=======================================
  Coverage   83.75%   83.75%           
=======================================
  Files         251      251           
  Lines        8864     8864           
=======================================
  Hits         7424     7424           
  Misses       1440     1440           
Impacted Files Coverage Δ
...y.Exporter.Prometheus/PrometheusExporterOptions.cs 84.21% <100.00%> (ø)

@reyang
Copy link
Member

reyang commented Jan 13, 2022

Couple things to discuss:

  1. Do we want the binding host/port to be optional or required? (e.g. it seems Java implementation is making it required https://github.com/open-telemetry/opentelemetry-java/tree/main/exporters/prometheus/src/main/java/io/opentelemetry/exporter/prometheus, prom-client for Python makes the port a required thing https://github.com/prometheus/client_python/blob/038b5bd9357929a1e4e0cfa16c0c407a66702c0b/prometheus_client/exposition.py#L126-L135)
  2. If the answer to 1) is optional, what should be the default value and why?
  3. Given the .NET PrometheusExporter can be used either as a standalone HttpListener or integrated into ASP.NET Core pipeline, do we want to have different default value depending on the usage case, or the same value across the board? (@CodeBlanch you might have more insights here).

alanwest
alanwest previously approved these changes Jan 13, 2022
@alanwest alanwest dismissed their stale review January 13, 2022 23:30

Ah apologies, didn't see the open questions. Something made me think the default had already been decided.

@alanwest
Copy link
Member

alanwest commented Jan 13, 2022

it seems Java implementation is making it required

Looks like Java's default is 9464

Appears there is some precedent for 9464 as here's the OpenCensus exporter for node https://github.com/census-instrumentation/opencensus-node/blob/master/packages/opencensus-exporter-prometheus/README.md.

The spec references it too https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/sdk-environment-variables.md#prometheus-exporter

@Yun-Ting
Copy link
Contributor Author

it seems Java implementation is making it required

Looks like Java's default is 9464

Appears there is some precedent for 9464 as here's the OpenCensus exporter for node https://github.com/census-instrumentation/opencensus-node/blob/master/packages/opencensus-exporter-prometheus/README.md.

The spec references it too https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/sdk-environment-variables.md#prometheus-exporter

Interesting! Not sure how did people come up with 9464. BTW, here contains the list of ports that we may need to avoid when choosing default ports.

@Yun-Ting Yun-Ting changed the title Update default httpListenerPrefixes for PrometheusExporter to be http://localhost:9184/ Update default httpListenerPrefixes for PrometheusExporter to be http://localhost:9464/ Jan 19, 2022
@Yun-Ting Yun-Ting changed the title Update default httpListenerPrefixes for PrometheusExporter to be http://localhost:9464/ Update default httpListenerPrefixes for PrometheusExporter to be http://0.0.0.0:9464/ Jan 19, 2022
@Yun-Ting Yun-Ting changed the title Update default httpListenerPrefixes for PrometheusExporter to be http://0.0.0.0:9464/ Update default host and port for PrometheusExporter to align with the OTel spec. Jan 19, 2022
Yun-Ting and others added 2 commits January 20, 2022 20:53
@cijothomas cijothomas merged commit a4ef4ee into open-telemetry:main Jan 25, 2022
@Yun-Ting Yun-Ting deleted the yunl/listener branch January 25, 2022 23:17
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.

4 participants