+**Telemetry cost**: OpenTelemetry is on when `OPENTELEMETRY_ENDPOINT` is set, Sentry when `SENTRY_DSN` is set, and both run on every request. On this template with one Granian worker, each adds about 0.3 ms of CPU per request, and the two together cut read throughput by about 40%. OTel traces every request by default. To sample, set `OTEL_TRACES_SAMPLER=parentbased_traceidratio` and `OTEL_TRACES_SAMPLER_ARG` to the ratio; lite-bootstrap leaves the sampler unset, so the OTel SDK reads these. A ratio of 0.1 removes about half of OTel's cost, because unsampled requests skip the span exporter and most span work but still go through the ASGI middleware and the SQLAlchemy hooks. Sentry runs with `traces_sample_rate` unset, yet its ASGI and Litestar integrations build an unsampled transaction and a span per middleware on every request, so turning off its other default integrations saves little.
0 commit comments