-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support OTEL_EXPORTER_OTLP_LOGS_INSECURE and OTEL_EXPORTER_OTLP_INSEC…
…URE environments in grpc exporter (#5739) Closes #5719 In this commit I add OTEL_EXPORTER_OTLP_LOGS_INSECURE and OTEL_EXPORTER_OTLP_INSECURE env options to `otlploggrpc.Exporter`. Now insecure option is fetched from env endpoint value (OTEL_EXPORTER_OTLP_LOGS_ENDPOINT/OTEL_EXPORTER_OTLP_ENDPOINT). According to [spec](https://opentelemetry.io/docs/specs/otel/protocol/exporter/): > Insecure: Whether to enable client transport security for the exporter’s gRPC connection. This option only applies to OTLP/gRPC when an endpoint is provided without the http or https scheme - OTLP/HTTP always uses the scheme provided for the endpoint. So with current behavior we have several problems: - If default endpoint is used, we can't use insecure connection (with setting OTEL_EXPORTER_OTLP_INSECURE). - If endpoint provided with option without scheme (e.g. `WithEndpoint`) we can't use insecure connection with env settings. - If endpoint provided with env variable without scheme (e.g. `//env.endpoint:8080/`) we can't use insecure connection. This commit fixes this. The same problem with `otlploghttp.Exporter`, and probably it should be fixed there too. I'm open to suggestions on how to fix the current behavior in a more elegant way. --------- Co-authored-by: Sam Xie <[email protected]> Co-authored-by: Damien Mathieu <[email protected]>
- Loading branch information
1 parent
fb7cc02
commit 8dca9cc
Showing
4 changed files
with
137 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters