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

Support environment variables for both OtlpGrpcExporter and OtlpHttpExporter #983

Merged
merged 2 commits into from
Sep 21, 2021

Conversation

owent
Copy link
Member

@owent owent commented Sep 20, 2021

Fixes #978
Fixes #909

Changes

  1. Add otlp_environment.h to maintain shared codes of OtlpGrpcExporter and OtlpHttpExporter
  2. Add timeout and metadata options for OtlpGrpcExporter
  3. Use environment variables OTEL_EXPORTER_OTLP_TIMEOUT , OTEL_EXPORTER_OTLP_TRACES_TIMEOUT , OTEL_EXPORTER_OTLP_HEADERS , OTEL_EXPORTER_OTLP_TRACES_HEADERS to initialize default options of OtlpGrpcExporter and OtlpHttpExporter
  4. Use environment variables OTEL_EXPORTER_OTLP_ENDPOINT , OTEL_EXPORTER_OTLP_TRACES_ENDPOINT to initialize default options of OtlpHttpExporter

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

  • CHANGELOG.md updated for non-trivial changes
  • Unit tests have been added
  • Changes in public API reviewed

@owent owent requested a review from a team September 20, 2021 08:43
@codecov
Copy link

codecov bot commented Sep 20, 2021

Codecov Report

Merging #983 (b11bf4f) into main (74d4be4) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #983   +/-   ##
=======================================
  Coverage   95.38%   95.38%           
=======================================
  Files         161      161           
  Lines        6817     6817           
=======================================
  Hits         6502     6502           
  Misses        315      315           

@owent owent changed the title 1. Add otlp_environment.h to maintain shared codes of `OtlpGrpcExpo… Support environment variables for both OtlpGrpcExporter and OtlpHttpExporter Sep 20, 2021
…rter` and `OtlpHttpExporter`

2. Add `timeout` and `metadata` options for `OtlpGrpcExporter`
3. Load environment variables `OTEL_EXPORTER_OTLP_TIMEOUT` , `OTEL_EXPORTER_OTLP_TRACES_TIMEOUT` , `OTEL_EXPORTER_OTLP_HEADERS` , `OTEL_EXPORTER_OTLP_TRACES_HEADERS` to initialize default options of `OtlpGrpcExporter` and `OtlpHttpExporter`
4. Load environment variables `OTEL_EXPORTER_OTLP_ENDPOINT` , `OTEL_EXPORTER_OTLP_TRACES_ENDPOINT` to initialize default options of `OtlpHttpExporter`

Signed-off-by: owentou <[email protected]>
@owent owent force-pushed the environments_for_otlp_http_exporter branch from f73cc76 to 269ff8f Compare September 21, 2021 01:51
Copy link
Member

@lalitb lalitb left a comment

Choose a reason for hiding this comment

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

Thanks for adding the support for env variables, along with timeout and headers.

@lalitb lalitb merged commit 82cf0f4 into open-telemetry:main Sep 21, 2021
@owent owent deleted the environments_for_otlp_http_exporter branch October 23, 2021 08:28
@lalitb lalitb mentioned this pull request Mar 22, 2022
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants