Naar hoofdinhoud gaan
FastAPI is een modern, high-performance webframework voor het bouwen van API’s met Python.

Installatie

🐍 Vergeet niet om eerst het AppSignal for Python-package te installeren in uw applicatie.
Installeer eerst het opentelemetry-instrumentation-fastapi-pakket. Om het aan uw project toe te voegen, voegt u de volgende regel toe aan uw requirements.txt-bestand:
# requirements.txt
opentelemetry-instrumentation-fastapi

Setup

Start AppSignal en definieer uw FastAPI-applicatie. Gebruik vervolgens de FastAPIInstrumentor om uw FastAPI-applicatie te instrumenteren:
# app.py
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)