open-telemetry / open-telemetry/opentelemetry-python-contrib

starlette / fastapi: handle co-existence with native telemetry

Open
#5,000 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
1.1k
Forks
1.1k
Avg merge
4d 15h
Merged PRs (30d)
16

Description

In https://github.com/Kludex/starlette/pull/3438/ (merged in main) starlette added native opentelemetry support. We should test that and if that's active disable our own instrumentation to avoid duplicated telemetry.

If the native instrumentation is available from starlette.middleware.opentelemetry import OpenTelemetryMiddleware would not fail. Also we should check that the middleware is in use.

We should check both starlette and fastapi instrumentation.

cc @Kludex

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the Starlette and FastAPI instrumentation entry points and their existing middleware-related tests. Check whether Starlette's native OpenTelemetryMiddleware is available and active, then verify the analogous FastAPI behavior. Done means native middleware does not cause duplicate instrumentation and both integrations are covered by tests.

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
Active
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.