Starlette Instrumentation

This feature requires AppSignal for Python version 0.1.4 or higher.
This feature requires Starlette version 0.13.0 or higher.

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

Installation

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:

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)