FastAPI Instrumentation

AppSignal for PythonThis feature requires version 0.1.4 or higher.
FastAPIThis feature requires version 0.58 or higher.

FastAPI is a modern, high-performance web framework for building APIs with Python.

Install the Instrumentation

Don't forget to install the AppSignal for Python package in your application first.

First, install the opentelemetry-instrumentation-fastapi package. To add it to your project, add the following line to your requirements.txt file:

# requirements.txt opentelemetry-instrumentation-fastapi


Start AppSignal and define your FastAPI application. Then use the FastAPIInstrumentor to instrument your FastAPI application:

# from fastapi import FastAPI from opentelemetry.instrumentation.fastapi import FastAPIInstrumentor import appsignal appsignal.start() app = FastAPI() # ... your app's code goes here ... FastAPIInstrumentor().instrument_app(app)