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.
Installation
First, install the opentelemetry-instrumentation-starlette
package. To add it to your project, add the following line to your requirements.txt
file:
shell
# requirements.txt opentelemetry-instrumentation-starlette
Setup
Start AppSignal and define your Starlette application. Then use the StarletteInstrumentor
to instrument your Starlette application:
python
# app.py 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)