Using a fresh project and adding the required OpenTelemetry environment variables as described in https://usefresh.dev/docs/advanced/opentelemetry, shows no indication that OpenTelemetry is logging anything.
Summary of problems I found:
OTEL_TRACES_EXPORTER variable name is incorrect, should be OTEL_EXPORTER_OTLP_PROTOCOL.
- Without
OTEL_EXPORTER_OTLP_PROTOCOL=console, no metrics are sent to any endpoint.
Repro using console:
- Create a new project:
deno run -Ar jsr:@fresh/init telemetry-test --tailwind false --vscode false
cd telemetry-test
deno task build
OTEL_DENO=true OTEL_TRACES_EXPORTER=console deno task start
- Go to http://localhost:8000
- Navigate around a bit
- Notice no extra logging in the terminal
Repro using Jaeger:
- Create a new project:
deno run -Ar jsr:@fresh/init telemetry-test --tailwind false --vscode false
- Run Jaeger:
docker run --rm --name jaeger -p 16686:16686 -p 4317:4317 -p 4318:4318 -p 5778:5778 -p 9411:9411 cr.jaegertracing.io/jaegertracing/jaeger:2.19.0
cd telemetry-test
deno task build
OTEL_DENO=true OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317 deno task start
- Go to http://localhost:8000
- Navigate around a bit
- Go to http://localhost:16686
- Notice that the service (as
unknown_service is not listed, only Jaeger itself is listed (after F5)
Optionally check http://localhost:16686/api/v3/services to see if unknown_service is listed. That should be the Fresh application.
One problem I managed to solve by comparing the Fresh and Deno docs is that the OTEL_TRACES_EXPORTER variable should be named OTEL_EXPORTER_OTLP_PROTOCOL
With that variable change, the console starts logging things, confirming that OpenTelemetry is doing something.
NOTE:
After a lot of testing, I found that OTEL_DENO=true OTEL_EXPORTER_OTLP_PROTOCOL=console deno task start also sends data to the Jaeger endpoint. Without OTEL_EXPORTER_OTLP_PROTOCOL=console I have not been able to make that happen.
deno 2.8.2 (stable, release, x86_64-unknown-linux-gnu)
v8 14.9.207.2-rusty
typescript 6.0.3
Using a fresh project and adding the required OpenTelemetry environment variables as described in https://usefresh.dev/docs/advanced/opentelemetry, shows no indication that OpenTelemetry is logging anything.
Summary of problems I found:
OTEL_TRACES_EXPORTERvariable name is incorrect, should beOTEL_EXPORTER_OTLP_PROTOCOL.OTEL_EXPORTER_OTLP_PROTOCOL=console, no metrics are sent to any endpoint.Repro using console:
deno run -Ar jsr:@fresh/init telemetry-test --tailwind false --vscode falsecd telemetry-testdeno task buildOTEL_DENO=true OTEL_TRACES_EXPORTER=console deno task startRepro using Jaeger:
deno run -Ar jsr:@fresh/init telemetry-test --tailwind false --vscode falsedocker run --rm --name jaeger -p 16686:16686 -p 4317:4317 -p 4318:4318 -p 5778:5778 -p 9411:9411 cr.jaegertracing.io/jaegertracing/jaeger:2.19.0cd telemetry-testdeno task buildOTEL_DENO=true OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317 deno task startunknown_serviceis not listed, only Jaeger itself is listed (after F5)Optionally check http://localhost:16686/api/v3/services to see if
unknown_serviceis listed. That should be the Fresh application.One problem I managed to solve by comparing the Fresh and Deno docs is that the
OTEL_TRACES_EXPORTERvariable should be namedOTEL_EXPORTER_OTLP_PROTOCOLWith that variable change, the console starts logging things, confirming that OpenTelemetry is doing something.
NOTE:
After a lot of testing, I found that
OTEL_DENO=true OTEL_EXPORTER_OTLP_PROTOCOL=console deno task startalso sends data to the Jaeger endpoint. WithoutOTEL_EXPORTER_OTLP_PROTOCOL=consoleI have not been able to make that happen.