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

Honor OTEL_RESOURCE_ATTRIBUTES environment variable #40

Open
zakimaksyutov opened this issue Feb 28, 2024 · 2 comments
Open

Honor OTEL_RESOURCE_ATTRIBUTES environment variable #40

zakimaksyutov opened this issue Feb 28, 2024 · 2 comments

Comments

@zakimaksyutov
Copy link

In my Kubernetes setup every pod gets OTEL_RESOURCE_ATTRIBUTES environment variable set which contains everything needed to troubleshoot/monitor our microservices. Every app instrumented with Open Telemetry automatically picks up these resource attributes. But Nginx does not. As a result, through it emits spans and participated in distributed tracing, it doesn't contain everything.

Describe the solution you'd like

nginx-otel module to honor OTEL_RESOURCE_ATTRIBUTES environment variable and emits them as Resource object.

According to Open Telemetry spec, all producers must honor this environment variable.

Describe alternatives you've considered

The closest - with otel_span_attr it is potentially possible to inject needed information as span attribute. But this still will not be resource attribute and as a result not aligned with the rest of applications. This also will require nginx.conf changes every time we decide to add something to OTEL_RESOURCE_ATTRIBUTES.

@p-pautov
Copy link
Contributor

There is #32 to support custom resource attributes via config, but supporting environment variables like OTEL_RESOURCE_ATTRIBUTES and OTEL_SERVICE_NAME makes sense as well.

@JPeer264
Copy link

JPeer264 commented May 2, 2024

It would also be nice to have the exporter (OTEL_EXPORTER_OTLP_ENDPOINT) and its headers (OTEL_EXPORTER_OTLP_HEADERS) to be configurable via environment variables: https://opentelemetry.io/docs/languages/sdk-configuration/otlp-exporter/.

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

No branches or pull requests

3 participants