Passer au contenu principal
Starlette est un framework web léger et performant pour la création d’applications Python asynchrones.

Installation

🐍 N’oubliez pas d’installer le paquet AppSignal for Python dans votre application au préalable.
Tout d’abord, installez le package opentelemetry-instrumentation-starlette. Pour l’ajouter à votre projet, ajoutez la ligne suivante à votre fichier requirements.txt :
# requirements.txt
opentelemetry-instrumentation-starlette

Configuration

Démarrez AppSignal et définissez votre application Starlette. Utilisez ensuite StarletteInstrumentor pour instrumenter votre application Starlette :
# 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)