Skip to content

docs: note telemetry cost and OTel sampling env vars - #85

Merged
lesnik512 merged 1 commit into
mainfrom
docs-telemetry-cost
Oct 24, 2026
Merged

lesnik512 merged 1 commit into
mainfrom
docs-telemetry-cost

Conversation

@lesnik512

Copy link
Copy Markdown
Member

Adds a "Telemetry cost" paragraph to AGENTS.md next to pool and server sizing.

Numbers come from a benchmark of this template in Docker on Linux: Granian with 1 worker and 2 CPUs, Postgres 17, oha at 32 connections, OTel exporting over gRPC to a real collector, Sentry pointed at a dummy endpoint. Medians of 3 x 10 s runs over 2 rounds:

Variant List decks (rps) Deck with 20 cards (rps)
Baseline 1452 1711
OTel, every request 990 1167
OTel, parentbased_traceidratio 0.1 1175 1316
Sentry, template config 984 1158
Sentry, Litestar and logging integrations only 1086 1258
OTel and Sentry together 748-813 884-890

The OTel and Sentry together row comes from an earlier run with the same setup.

A py-spy profile under load shows where the time goes. OTel spends it in span creation in the SDK, in the OTLP exporter thread, and in the ASGI middleware (collect_request_attributes, the wrapped send). The middleware runs on unsampled requests too. Sentry, with traces_sample_rate unset, still runs start_transaction, continue_trace and a span per middleware through _create_span_call on every request.

No code change: the SDK already reads OTEL_TRACES_SAMPLER and OTEL_TRACES_SAMPLER_ARG, because lite-bootstrap passes no sampler.

@lesnik512
lesnik512 merged commit 7ef1a93 into main Oct 24, 2026
3 checks passed
@lesnik512
lesnik512 deleted the docs-telemetry-cost branch October 24, 2026 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant