davidB / tracing-opentelemetry-instrumentation-sdk

Middlewares and tools to integrate axum + tracing + opentelemetry
Creative Commons Zero v1.0 Universal
149 stars 42 forks source link

OpenTelemetry trace error occurred. HTTP status client error (404 Not Found) for url (http://localhost:4318/) #155

Closed EMUNES closed 1 month ago

EMUNES commented 2 months ago

I found this error when testing the example axum_oltp. I have deployed jaeger on docker following this repo's instruction. However, it reports this error on port 4318, which is the OLTP http port.

I found a possible related issue about this here. But I have no idea how to make configurations for this crate to fix this problem.

Logs:

     0.000634300s DEBUG otel::setup::resource: key: telemetry.sdk.version, value: 0.23.0
    at C:\Users\HZB\.cargo\registry\src\index.crates.io-6f17d22bba15001f\init-tracing-opentelemetry-0.19.0\src\resource.rs:65 on main

     0.001000700s DEBUG otel::setup::resource: key: service.name, value: unknown_service
    at C:\Users\HZB\.cargo\registry\src\index.crates.io-6f17d22bba15001f\init-tracing-opentelemetry-0.19.0\src\resource.rs:65 on main

     0.001283100s DEBUG otel::setup::resource: key: os.type, value: windows
    at C:\Users\HZB\.cargo\registry\src\index.crates.io-6f17d22bba15001f\init-tracing-opentelemetry-0.19.0\src\resource.rs:65 on main

     0.001464200s DEBUG otel::setup::resource: key: telemetry.sdk.language, value: rust
    at C:\Users\HZB\.cargo\registry\src\index.crates.io-6f17d22bba15001f\init-tracing-opentelemetry-0.19.0\src\resource.rs:65 on main

     0.001596900s DEBUG otel::setup::resource: key: telemetry.sdk.name, value: opentelemetry     
    at C:\Users\HZB\.cargo\registry\src\index.crates.io-6f17d22bba15001f\init-tracing-opentelemetry-0.19.0\src\resource.rs:65 on main

     0.001811600s DEBUG otel::setup: OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: "http://localhost:4318" 
    at C:\Users\HZB\.cargo\registry\src\index.crates.io-6f17d22bba15001f\init-tracing-opentelemetry-0.19.0\src\otlp.rs:31 on main

     0.001987100s DEBUG otel::setup: OTEL_EXPORTER_OTLP_TRACES_PROTOCOL: "http/protobuf"
    at C:\Users\HZB\.cargo\registry\src\index.crates.io-6f17d22bba15001f\init-tracing-opentelemetry-0.19.0\src\otlp.rs:32 on main

     0.003359400s DEBUG otel::setup: OTEL_TRACES_SAMPLER: "parentbased_always_on"
    at C:\Users\HZB\.cargo\registry\src\index.crates.io-6f17d22bba15001f\init-tracing-opentelemetry-0.19.0\src\otlp.rs:115 on main

     0.003868100s DEBUG otel::setup: OTEL_PROPAGATORS: "tracecontext,baggage"
    at C:\Users\HZB\.cargo\registry\src\index.crates.io-6f17d22bba15001f\init-tracing-opentelemetry-0.19.0\src\lib.rs:59 on main

Error:

   366.797249200s TRACE otel::tracing: close, time.busy: 1.37ms, time.idle: 432µs
    at C:\Users\HZB\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tracing-opentelemetry-instrumentation-sdk-0.19.0\src\http\http_server.rs:13 on tokio-runtime-worker
    in otel::tracing::HTTP request with http.request.method: GET, network.protocol.version: 1.1, server.address: "127.0.0.1:7999", user_agent.original: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36", url.path: "/", url.scheme: "", otel.name: GET, otel.kind: Server, span.type: "web", http.route: "/", otel.name: "GET /", http.response.status_code: 200

OpenTelemetry trace error occurred. HTTP status client error (404 Not Found) for url (http://localhost:4318/)
davidB commented 2 months ago

I don't know which crates you talk (they are several on this repo), but configuration could be done by environment variables a subset of https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables/ (also look at the names in uppercase in the log above)

EMUNES commented 1 month ago

This error does not occur after updating to the newest packages.