Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,16 @@ Authentication is intentionally omitted: pick the scheme that fits your project
just --list
```

## Tracing in production
Setting `OPENTELEMETRY_ENDPOINT` turns tracing on, and by default every request is traced. In a benchmark of `GET /api/decks/{id}/`, that cut throughput by about 40%. Sampling with the standard OpenTelemetry variables brings that down to about 20%:

```bash
OTEL_TRACES_SAMPLER=parentbased_traceidratio
OTEL_TRACES_SAMPLER_ARG=0.1
```

This keeps one trace in ten, and follows the caller's decision when a request arrives with a trace context. Errors still reach Sentry when `SENTRY_DSN` is set.

## 📝 [License](https://github.com/modern-python/fastapi-sqlalchemy-template/blob/main/LICENSE)

## Part of `modern-python`
Expand Down
Loading