+OpenTelemetry is on when `OPENTELEMETRY_ENDPOINT` is set, Sentry when `SENTRY_DSN` is set, and both run on every request. On litestar-sqlalchemy-template, which wires them through lite-bootstrap the same way, each added about 0.3 ms of CPU per request with one Granian worker, and the two together cut read throughput by about 40%; this template has not been measured. 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. On the Litestar template a ratio of 0.1 removed 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.
0 commit comments