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

add more environment variables to OTEL exporter #106

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

hgiasac
Copy link
Contributor

@hgiasac hgiasac commented Feb 21, 2024

  • Add more required configurations for OTEL exporter (OTEL_EXPORTER_OTLP_HEADERS and OTEL_RESOURCE_ATTRIBUTES)
  • Relax other OTEL configs to follow the OTEL spec. Existing OTEL exporter SDKs mostly support those environment variables internally. Therefore we don't need to implement them in connector SDKs.

Rendered

@hgiasac hgiasac requested a review from paf31 February 21, 2024 17:44
- Connectors can use environment variables as part of their configuration. Configuration that varies between different environments or regions (like connection strings) should be configurable via environment variables.
- The connector should send any relevant trace spans in the OTLP format to the OTEL collector hosted at the URL provided by the `OTEL_EXPORTER_OTLP_ENDPOINT` environment variable.
- Note: `OTEL_EXPORTER_OTLP_ENDPOINT` indicates the _root URL_ of the collector, and not the `/v1/traces` endpoint.
- Spans should indicate the service name provided by the `OTEL_SERVICE_NAME` environment variable.
- The connector can configure additional headers to add in outgoing gRPC or HTTP requests by the `OTEL_EXPORTER_OTLP_HEADERS` environment variables.
Copy link
Collaborator

Choose a reason for hiding this comment

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

It's not the connector which configures these though, right? It's the user of the Docker image?

Copy link
Collaborator

Choose a reason for hiding this comment

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

The connector presumably just needs to respect the OTEL spec and pass them along?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right. My words may cause confusing here

- The connector can configure additional headers to add in outgoing gRPC or HTTP requests by the `OTEL_EXPORTER_OTLP_HEADERS` environment variables.
- The connector also can configure additional resource attributes for requests by the `OTEL_RESOURCE_ATTRIBUTES` environment variables.
- Note: the value of `OTEL_EXPORTER_OTLP_HEADERS` and `OTEL_RESOURCE_ATTRIBUTES` is key-value pairs, for example, `api-key=key,other-config-value=value`.
- Other OTLP exporter configurations are optional. However, they must follow the [Environment Variable Specification](https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables) and [SDK config](https://opentelemetry.io/docs/languages/sdk-configuration/otlp-exporter/).
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we need to be a bit careful here because the environment variable spec says too much IMO. For example, it requires OTEL_PROPAGATORS, but the NDC spec requires tracecontext propagation. There are a lot of other env vars that we don't need to support in full.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have added a line to clarify the required tracecontext propagation.

I'm wondering if we should specify a list of individual env vars to support, or to just say "a connector should support OTEL in full" but clarify which parts we actually care about right now.

IMO not all languages implement OTEL SDK. It seems too much to expect the author to support OTEL in full. However, we can clarify that the connector can support other configurations depending on the underlying SDK.

Anyway, it would be great if you could suggest better words to make the proposal clearer.

Copy link
Collaborator

@paf31 paf31 left a comment

Choose a reason for hiding this comment

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

I'm wondering if we should specify a list of individual env vars to support, or to just say "a connector should support OTEL in full" but clarify which parts we actually care about right now.

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.

None yet

2 participants