Skip to content

OpenTelemetry telemetry as stdout JSON lines - #12

Merged
mtauha merged 6 commits into
mainfrom
feat/otel-telemetry
Oct 2, 2026
Merged

mtauha merged 6 commits into
mainfrom
feat/otel-telemetry

Conversation

@mtauha

@mtauha mtauha commented Oct 2, 2026

Copy link
Copy Markdown
Member

Uses FastAPI 0.142's native OpenTelemetry support with app-local providers whose exporters write one JSON object per line to stdout, so telemetry reaches MotherDuck through the existing log export.

  • One server span per request (client address and service version added), FastAPI's error/validation logs linked by trace id. Metrics and per-operation spans off; /health excluded; PSX_TELEMETRY=off disables it.
  • Custom spans: cache.historical (HIT/MISS/STALE, memory/redis/none tier, cooldown) and psx.fetch (SDK function, proxied, cache-only hit).
  • No headers are recorded; a test pins that X-PSX-Proxy credentials never appear in telemetry.
  • Exporter side: https://github.com/psxdata/psx-log-exporter/pull/1

Deploys on the next published release; after that, check that the JSON lines reach the FastAPI Cloud logs intact.

Known issue, not changed here: api/requirements.txt (Docker image) still pins psxdata==1.1.1 while pyproject pins 1.2.0.

@mtauha
mtauha merged commit 051a88b into main Oct 2, 2026
4 checks passed
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