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

axum-otlp example not working out of the box? #187

Open
xmo-odoo opened this issue Nov 25, 2024 · 1 comment
Open

axum-otlp example not working out of the box? #187

xmo-odoo opened this issue Nov 25, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@xmo-odoo
Copy link

xmo-odoo commented Nov 25, 2024

Trying to better understand what the repository provides I decided to run the "axum-otlp" example to see how it fared. Now the readme does suggest OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317 and that works (so does OTEL_EXPORTER_OTLP_PROTOCOL=grpc), however it doesn't seem to work using the protobuf exporter (to the endpoint http://localhost:4318), which is the default configuration, even though it's not saying anything and the DEBUG reporting for the otel configuration seems happy with everything.

The odd part is the corresponding example from open-telemetry/opentelemetry-rust (the somewhat ill named tracing-jaeger) does work with no issue, it seems to send trace with either OTEL_EXPORTER_OTLP_PROTOCOL (although I've not found a way to confirm that it was taking that key into account as it does not report anything).

I'm not sure what gives.

In both cases, my collector is CtrlSpice/otel-desktop-viewer

@davidB davidB self-assigned this Dec 4, 2024
@davidB davidB added the enhancement New feature or request label Dec 4, 2024
@davidB
Copy link
Owner

davidB commented Dec 10, 2024

Thanks for reporting, there is an issue in the computation of OTEL_EXPORTER_OTLP_TRACES_ENDPOINT from OTEL_EXPORTER_OTLP_PROTOCOL when protocol is http/protobuf.

As a workaround, you can set explicitly

export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT="http://127.0.0.1:4318/v1/traces"

(see https://opentelemetry.io/docs/languages/sdk-configuration/otlp-exporter/)

I'll release a patched version (and maybe later another version without the code related to environment variables as now, it seems to be handled by the crate opentelemetry)

FIX in 0f45ecb

@davidB davidB added bug Something isn't working and removed enhancement New feature or request labels Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants