#Duplicate Open Telemetry Modules

1 messages · Page 1 of 1 (latest)

random zinc
#

I have been trying to debug this seemingly duplicate Open telemetry tracer that appears in datadog. Seems like i have a GET GET with two returns.

Been trying to narrow it down but still stuck as before. Does Litestar have it enabled by default or something? You can see i plug my otel into the middleware.

#

config

    """Initialize Open Telemetry configuration."""

    resource = Resource(attributes={SERVICE_NAME: settings.log.DD_SERVICE})
    tracer_provider = TracerProvider(resource=resource)

    processor = BatchSpanProcessor(
        OTLPSpanExporter(endpoint=f"http://{settings.log.DD_AGENT_HOST}:{settings.log.DD_TRACE_AGENT_PORT}/v1/traces")
    )
    tracer_provider.add_span_processor(processor)

    reader = PeriodicExportingMetricReader(
        OTLPMetricExporter(
            endpoint=f"http://{settings.log.DD_AGENT_HOST}:{settings.log.DD_TRACE_AGENT_PORT}/v1/metrics"
        )
    )
    meter_provider = MeterProvider(resource=resource, metric_readers=[reader])

  
    return OpenTelemetryConfig(
        meter=metrics.get_meter(__name__),
        middleware_class=OpenTelemetrySingletonMiddleware,
        meter_provider=meter_provider,
        tracer_provider=tracer_provider,
    )```
normal heath
#

Is there any data in those 2 spans you can share?

random zinc
#

First span: {"asgi":{"event":{"type":"http.response.start"}},"duration":79890,"env":"none","http":{"status_code":"200"},"otel":{"library":{"name":"opentelemetry.instrumentation.asgi","version":"0.57b0"},"status_code":"Unset","trace_id":"9709ef4844038e029c1ed815d93b5cec"},"span":{"kind":"internal"}}

#

Second Span: {"asgi":{"event":{"type":"http.response.body"}},"duration":37107,"env":"none","otel":{"library":{"name":"opentelemetry.instrumentation.asgi","version":"0.57b0"},"status_code":"Unset","trace_id":"9709ef4844038e029c1ed815d93b5cec"},"span":{"kind":"internal"}}

normal heath
#

This looks correct to me though, right? The first span is the start of the response, the next is when the body started

random zinc
#

really? i figured the GET GET is a bug indicating some duplicate trace start

#

i figured the start and response so only 2 spans

normal heath
#

Hmm, do your other endpoints not look like this?

random zinc
#

they all have GET GET or POST POST. been trying to integrate datadog with open telemetry. I suspect it had something with some broken config. Because thats just one of the issues i have. when i integrate sqlalchemy, i get seemingly "orphan" spans

#

you can see the neondb has 1 span indicating orphan, whereas here it shows 8 span so its part of a proper trace

#

the waterfull looks good but the duplicate responses and the random orphan spans

wild plank
#

Maybe this is why you are seeing two requests?

#

each trace will contain at least two parts, response.start and response.body