lens.contrib.fastapi

View as Markdown

FastAPI auto-instrumentation helper.

Module Contents

Functions

NameDescription
instrument_fastapiApply OpenTelemetry auto-instrumentation to a FastAPI app.

API

lens.contrib.fastapi.instrument_fastapi(
app,
service_name: str = 'nemo-gym'
) -> None

Apply OpenTelemetry auto-instrumentation to a FastAPI app.

Requires opentelemetry-instrumentation-fastapi >= 0.40b0.

Parameters:

app

The FastAPI application instance.

service_name
strDefaults to 'nemo-gym'

Service name for span naming.