Skip to content

Support environment variables for both OtlpGrpcExporter and OtlpHttpExporter#983

Merged
lalitb merged 2 commits into
open-telemetry:mainfrom
owent:environments_for_otlp_http_exporter
Sep 21, 2021
Merged

Support environment variables for both OtlpGrpcExporter and OtlpHttpExporter#983
lalitb merged 2 commits into
open-telemetry:mainfrom
owent:environments_for_otlp_http_exporter

Conversation

@owent
Copy link
Copy Markdown
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
Copy Markdown

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 <owentou@tencent.com>
@owent owent force-pushed the environments_for_otlp_http_exporter branch from f73cc76 to 269ff8f Compare September 21, 2021 01:51
Copy link
Copy Markdown
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.

Comment thread exporters/otlp/include/opentelemetry/exporters/otlp/otlp_environment.h Outdated
Signed-off-by: owentou <owentou@tencent.com>
@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

Development

Successfully merging this pull request may close these issues.

Add otlp environment variables for OtlpHttpExporter Any plan to support customize the otlp gRPC header for authentication?

3 participants