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 OTEL_EXPORTER_OTLP_{TRACES,METRICS}_PROTOCOL in autoexport #5807

Closed
MrAlias opened this issue Jun 26, 2024 · 1 comment · Fixed by #5816
Closed

Support OTEL_EXPORTER_OTLP_{TRACES,METRICS}_PROTOCOL in autoexport #5807

MrAlias opened this issue Jun 26, 2024 · 1 comment · Fixed by #5816
Assignees
Labels
enhancement New feature or request exporter: autoexport good first issue Good for newcomers help wanted Extra attention is needed
Milestone

Comments

@MrAlias
Copy link
Contributor

MrAlias commented Jun 26, 2024

Currently the proto configuration is only interpreted from OTEL_EXPORTER_OTLP_PROTOCOL:

proto := os.Getenv(otelExporterOTLPProtoEnvKey)

The specification states:

Specify Protocol

The OTEL_EXPORTER_OTLP_PROTOCOL, OTEL_EXPORTER_OTLP_TRACES_PROTOCOL, OTEL_EXPORTER_OTLP_METRICS_PROTOCOL and OTEL_EXPORTER_OTLP_LOGS_PROTOCOL environment variables specify the OTLP transport protocol. Supported values:

  • grpc for protobuf-encoded data using gRPC wire format over HTTP/2 connection
  • http/protobuf for protobuf-encoded data over HTTP connection
  • http/json for JSON-encoded data over HTTP connection

SDKs SHOULD support both grpc and http/protobuf transports and MUST
support at least one of them. If they support only one, it SHOULD be
http/protobuf. They also MAY support http/json.

If no configuration is provided the default transport SHOULD be http/protobuf
unless SDKs have good reasons to choose grpc as the default (e.g. for backward
compatibility reasons when grpc was already the default in a stable SDK
release).

We should support the signal specification configurations for the protocol.

Related: https://cloud-native.slack.com/archives/C01NPAXACKT/p1719416293839069

@MrAlias MrAlias added enhancement New feature or request exporter: autoexport good first issue Good for newcomers help wanted Extra attention is needed labels Jun 26, 2024
@MrAlias MrAlias added this to the v1.29.0 milestone Jun 26, 2024
@thomasgouveia
Copy link
Contributor

Hi @MrAlias, you could assign me on this one!

thomasgouveia added a commit to thomasgouveia/opentelemetry-go-contrib that referenced this issue Jun 27, 2024
…,METRICS,LOGS}_PROTOCOL env var (open-telemetry#5807)

This commit adds support for signal-specific environment variables to configure the OTLP protocol used with the exporter.
As stated in the [specification](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.34.0/specification/protocol/exporter.md#configuration-options), you
can now use the following environment variables to configure signal-specific protocols:

- `OTEL_EXPORTER_OTLP_TRACES_PROTOCOL`
- `OTEL_EXPORTER_OTLP_LOGS_PROTOCOL`
- `OTEL_EXPORTER_OTLP_METRICS_PROTOCOL`

The package will first attempt to load the protocol for a signal from the corresponding environment variable. If it is not set or is empty, it will try to determine the protocol from `OTEL_EXPORTER_OTLP_PROTOCOL`. If this is also not defined or is empty, it will fall back to `http/protobuf`.

Signed-off-by: thomasgouveia <[email protected]>
thomasgouveia added a commit to thomasgouveia/opentelemetry-go-contrib that referenced this issue Jun 27, 2024
…,METRICS,LOGS}_PROTOCOL env var (open-telemetry#5807)

This commit adds support for signal-specific environment variables to configure the OTLP protocol used with the exporter.
As stated in the [specification](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.34.0/specification/protocol/exporter.md#configuration-options), you
can now use the following environment variables to configure signal-specific protocols:

- `OTEL_EXPORTER_OTLP_TRACES_PROTOCOL`
- `OTEL_EXPORTER_OTLP_LOGS_PROTOCOL`
- `OTEL_EXPORTER_OTLP_METRICS_PROTOCOL`

The package will first attempt to load the protocol for a signal from the corresponding environment variable. If it is not set or is empty, it will try to determine the protocol from `OTEL_EXPORTER_OTLP_PROTOCOL`. If this is also not defined or is empty, it will fall back to `http/protobuf`.

Signed-off-by: thomasgouveia <[email protected]>
thomasgouveia added a commit to thomasgouveia/opentelemetry-go-contrib that referenced this issue Jun 27, 2024
…,METRICS,LOGS}_PROTOCOL env var (open-telemetry#5807)

This commit adds support for signal-specific environment variables to configure the OTLP protocol used with the exporter.
As stated in the [specification](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.34.0/specification/protocol/exporter.md#configuration-options), you
can now use the following environment variables to configure signal-specific protocols:

- `OTEL_EXPORTER_OTLP_TRACES_PROTOCOL`
- `OTEL_EXPORTER_OTLP_LOGS_PROTOCOL`
- `OTEL_EXPORTER_OTLP_METRICS_PROTOCOL`

The package will first attempt to load the protocol for a signal from the corresponding environment variable. If it is not set or is empty, it will try to determine the protocol from `OTEL_EXPORTER_OTLP_PROTOCOL`. If this is also not defined or is empty, it will fall back to `http/protobuf`.

Signed-off-by: thomasgouveia <[email protected]>
thomasgouveia added a commit to thomasgouveia/opentelemetry-go-contrib that referenced this issue Jun 27, 2024
…,METRICS,LOGS}_PROTOCOL env var (open-telemetry#5807)

This commit adds support for signal-specific environment variables to configure the OTLP protocol used with the exporter.
As stated in the [specification](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.34.0/specification/protocol/exporter.md#configuration-options), you
can now use the following environment variables to configure signal-specific protocols:

- `OTEL_EXPORTER_OTLP_TRACES_PROTOCOL`
- `OTEL_EXPORTER_OTLP_LOGS_PROTOCOL`
- `OTEL_EXPORTER_OTLP_METRICS_PROTOCOL`

The package will first attempt to load the protocol for a signal from the corresponding environment variable. If it is not set or is empty, it will try to determine the protocol from `OTEL_EXPORTER_OTLP_PROTOCOL`. If this is also not defined or is empty, it will fall back to `http/protobuf`.

Signed-off-by: thomasgouveia <[email protected]>
thomasgouveia added a commit to thomasgouveia/opentelemetry-go-contrib that referenced this issue Jun 27, 2024
…,METRICS,LOGS}_PROTOCOL env var (open-telemetry#5807)

This commit adds support for signal-specific environment variables to configure the OTLP protocol used with the exporter.
As stated in the [specification](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.34.0/specification/protocol/exporter.md#configuration-options), you
can now use the following environment variables to configure signal-specific protocols:

- `OTEL_EXPORTER_OTLP_TRACES_PROTOCOL`
- `OTEL_EXPORTER_OTLP_LOGS_PROTOCOL`
- `OTEL_EXPORTER_OTLP_METRICS_PROTOCOL`

The package will first attempt to load the protocol for a signal from the corresponding environment variable. If it is not set or is empty, it will try to determine the protocol from `OTEL_EXPORTER_OTLP_PROTOCOL`. If this is also not defined or is empty, it will fall back to `http/protobuf`.

Signed-off-by: thomasgouveia <[email protected]>
thomasgouveia added a commit to thomasgouveia/opentelemetry-go-contrib that referenced this issue Jun 28, 2024
…,METRICS,LOGS}_PROTOCOL env var (open-telemetry#5807)

This commit adds support for signal-specific environment variables to configure the OTLP protocol used with the exporter.
As stated in the [specification](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.34.0/specification/protocol/exporter.md#configuration-options), you
can now use the following environment variables to configure signal-specific protocols:

- `OTEL_EXPORTER_OTLP_TRACES_PROTOCOL`
- `OTEL_EXPORTER_OTLP_LOGS_PROTOCOL`
- `OTEL_EXPORTER_OTLP_METRICS_PROTOCOL`

The package will first attempt to load the protocol for a signal from the corresponding environment variable. If it is not set or is empty, it will try to determine the protocol from `OTEL_EXPORTER_OTLP_PROTOCOL`. If this is also not defined or is empty, it will fall back to `http/protobuf`.

Signed-off-by: thomasgouveia <[email protected]>
@MrAlias MrAlias closed this as completed in 5b6a960 Jul 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request exporter: autoexport good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
2 participants