Skip to content

fastapi instrumentation: add possibility to exclude some routes #147

@guillaume-chervet

Description

@guillaume-chervet

Hi,
Thank you for that awesome lib 😊

Jaegger is crumbling under my logs because I have a “/health” route that is called every second on more than 20 services. Is it possible to add the possibility of excluding routes?

Idea exemple :

from opentelemetry.instrumentation.fastapi import FastAPIInstrumentor

@FastAPIInstrumentor.exclude()
@app.get("/health")
async def health():
    return {"status": "OK"}

Or

FastAPIInstrumentor.instrument_app(app, ["/health"])

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions