open-telemetry / opentelemetry-python-contrib

OpenTelemetry instrumentation for Python modules
https://opentelemetry.io
Apache License 2.0
698 stars 579 forks source link

opentelemetry-instrumentation-asgi is extremely noisy #2343

Open zacps opened 6 months ago

zacps commented 6 months ago

Describe your environment Potentially relevant python package versions:

fastapi==0.95.2
opentelemetry-distro==0.43b0
opentelemetry-exporter-otlp==1.22.0
opentelemetry-instrumentation-logging==0.43b0
opentelemetry-instrumentation-urllib==0.43b0
opentelemetry-instrumentation-wsgi==0.43b0
opentelemetry-instrumentation-aiohttp-client==0.43b0
opentelemetry-instrumentation-fastapi==0.43b0
opentelemetry-instrumentation-tornado==0.43b0
opentelemetry-instrumentation-urllib3==0.43b0

Steps to reproduce Automatically instrument a FastAPI application

What is the expected behaviour? The start of the trace, and possibly one span representing the time to receive the post content.

What is the actual behaviour? A large number of tiny spans are created. opentelemetry http receive

xrmx commented 6 months ago

Can you provide an example app that show that behaviour please?

zacps commented 6 months ago

This should work with something simple as:

from fastapi import FastAPI

app = FastAPI()

@app.get("/")
def test():
  return "Ok"

Just post a large enough body (json is fine) to see the multiple receive calls.

zilinjak commented 4 months ago

Any news about this bug ? @xrmx

HammadB commented 2 months ago

Any information here?