Starlette Instrumentation

AppSignal for PythonThis feature requires version 0.1.4 or higher.
StarletteThis feature requires version 0.13.0 or higher.

Starlette is a lightweight, high-performance web framework for building asynchronous Python applications.


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

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

# requirements.txt opentelemetry-instrumentation-starlette


Start AppSignal and define your Starlette application. Then use the StarletteInstrumentor to instrument your Starlette application:

# from starlette.applications import Starlette from opentelemetry.instrumentation.starlette import StarletteInstrumentor import appsignal appsignal.start() # ... your application's code goes here ... app = Starlette( # ... ) StarletteInstrumentor().instrument_app(app)