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

OpenTelemetry setup does not work with --env-file #27851

Open
tolu opened this issue Jan 28, 2025 · 1 comment
Open

OpenTelemetry setup does not work with --env-file #27851

tolu opened this issue Jan 28, 2025 · 1 comment
Assignees
Labels
bug Something isn't working correctly otel

Comments

@tolu
Copy link

tolu commented Jan 28, 2025

Version: Deno 2.1.7

Configuration of OTEL via (at least these) environment variables from --env-file is not respected as stated in the OTEL docs.

Example repository with reproduction involving

  1. A server bootstrapped with OTEL (either via env file, shell or dockerfile)
  2. A logger that listens on the configured OTLP_ENDPOINT and print content-type and the payload of requests
  3. A client that spams the server with some requests

Assigning values like:

  • OTEL_SERVICE_NAME=my-service
  • OTEL_EXPORTER_OTLP_PROTOCOL=http/json

Still uses protobuf and yields service.name: <unknown_service>

Changing the port of:

  • OTEL_EXPORTER_OTLP_ENDPOINT=localhost:4317

results in no reports arriving at that endpoint.

@devsnek devsnek changed the title OpenTelemetry setup not respecting values from environment variables OpenTelemetry setup does not work with --env-file Jan 28, 2025
@devsnek devsnek added bug Something isn't working correctly otel labels Jan 28, 2025
@tolu
Copy link
Author

tolu commented Jan 28, 2025

I updated example repo with docker and (working) shell examples as well.

Setting environment variables in shell works supremely well.

When running the server in docker, the exporter seems to fail on TCP connection issues, but that might just as well be me that have failed to configure something correctly. 🤔 🙈

name="BatchSpanProcessor.Flush.ExportError" reason="Other(hyper_util::client::legacy::Error(Connect, ConnectError(\"tcp connect error\", Os { code: 111, kind: ConnectionRefused, message: \"Connection refused\" })))" message=Failed during the export process
deno-otel-container  |  name="BatchSpanProcessor.Flush.ExportError" reason="Other(hyper_util::client::legacy::Error(Connect, ConnectError(\"tcp connect error\", Os { code: 111, kind: ConnectionRefused, message: \"Connection refused\" })))" message=Failed during the export process

@devsnek devsnek self-assigned this Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly otel
Projects
None yet
Development

No branches or pull requests

2 participants