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

feat: add prometheus exporter host and port env vars #1857

Merged
merged 2 commits into from
Feb 16, 2021

Conversation

naseemkullah
Copy link
Member

@naseemkullah naseemkullah commented Jan 21, 2021

Signed-off-by: naseemkullah naseem@transit.app

Which problem is this PR solving?

solves #1852

Short description of the changes

Added env vars for prometheux expoter host and port. Defaults are '0.0.0.0' (all addresses) and 9464 respectively.

@codecov
Copy link

codecov bot commented Jan 22, 2021

Codecov Report

Merging #1857 (8284a7e) into main (9f965b0) will increase coverage by 0.32%.
The diff coverage is 92.85%.

@@            Coverage Diff             @@
##             main    #1857      +/-   ##
==========================================
+ Coverage   92.45%   92.78%   +0.32%     
==========================================
  Files         165      182      +17     
  Lines        5463     6400     +937     
  Branches     1152     1354     +202     
==========================================
+ Hits         5051     5938     +887     
- Misses        412      462      +50     
Impacted Files Coverage Δ
...etry-exporter-prometheus/src/PrometheusExporter.ts 92.10% <92.85%> (-0.44%) ⬇️
...ges/opentelemetry-instrumentation-http/src/http.ts 94.69% <0.00%> (-0.82%) ⬇️
...es/opentelemetry-context-zone-peer-dep/src/util.ts 100.00% <0.00%> (ø)
...s/opentelemetry-instrumentation-fetch/src/fetch.ts 99.23% <0.00%> (ø)
.../opentelemetry-exporter-collector/src/transform.ts 87.85% <0.00%> (ø)
packages/opentelemetry-web/src/types.ts 100.00% <0.00%> (ø)
...ackages/opentelemetry-web/src/WebTracerProvider.ts 100.00% <0.00%> (ø)
...emetry-instrumentation-xml-http-request/src/xhr.ts 96.82% <0.00%> (ø)
...ry-exporter-collector/src/CollectorExporterBase.ts 92.45% <0.00%> (ø)
...ages/opentelemetry-exporter-collector/src/types.ts 100.00% <0.00%> (ø)
... and 11 more

@naseemkullah naseemkullah force-pushed the prometheus-env branch 2 times, most recently from 6530e9f to 65b7349 Compare January 24, 2021 19:46
Base automatically changed from master to main January 25, 2021 19:26
@naseemkullah naseemkullah added the enhancement New feature or request label Jan 27, 2021
@vmarchaud
Copy link
Member

@naseemkullah FYI lint is failing

@naseemkullah
Copy link
Member Author

Tests keep timing out. Anyone know why?

@Flarna
Copy link
Member

Flarna commented Feb 5, 2021

Tests keep timing out. Anyone know why?

I tried to run the exporter-prometheus tests locally and quite of them fail and test process is not ended. I assume there is some leftover server avoiding this.

Is there anything special needed to run them local?

@naseemkullah
Copy link
Member Author

Tests keep timing out. Anyone know why?

I tried to run the exporter-prometheus tests locally and quite of them fail and test process is not ended. I assume there is some leftover server avoiding this.

Is there anything special needed to run them local?

Thanks! I must have forgotten to shutdown after tests, stay tuned!

@Flarna
Copy link
Member

Flarna commented Feb 5, 2021

The first failing test for me is should start the server by default and call the callback.
It seem this test tries to start the server using NaN as port to listen which throws. This results in an error log but the test itself then times out.

You could move the exporter.shutdown() into a afterEach block to avoid that a failing test has a leftover server.

@naseemkullah
Copy link
Member Author

The first failing test for me is should start the server by default and call the callback.
It seem this test tries to start the server using NaN as port to listen which throws. This results in an error log but the test itself then times out.

You could move the exporter.shutdown() into a afterEach block to avoid that a failing test has a leftover server.

Thanks for the tip!

Signed-off-by: naseemkullah <naseem@transit.app>
@vmarchaud vmarchaud merged commit 03e741b into open-telemetry:main Feb 16, 2021
@naseemkullah naseemkullah deleted the prometheus-env branch April 9, 2021 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants