open-telemetry / open-telemetry/opentelemetry-python-contrib
Adding addition middleware in FastAPI with FastAPIInstrumentor is creating a strange span.
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.1k
- Forks
- 1.1k
- Avg merge
- 4d 15h
- Merged PRs (30d)
- 16
Description
I have added a simple middleware in FastAPI and this has created a strange span, which you can see in the image.
I have used the following middleware.
@app.middleware("http")
async def hello(request: Request, call_next):
resp = await call_next(request)
return resp
How can I create middleware that will not create a new span? Or at least without warning clock skew adjustment disabled; not applying calculated delta of -5.163065ms ?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at instrumentation/opentelemetry-instrumentation-fastapi/src/opentelemetry/instrumentation/fastapi/init.py around line 198, then reproduce the reported middleware in a minimal FastAPI application. Compare the generated spans and clock-skew warning with and without the middleware; completion requires identifying whether the behavior is an instrumentation bug or documenting the supported way to avoid it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- fastapi, python
- Domain
- observability
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100