Skip to content

feat(observability): add bounded OTLP HTTP exporter - #354

Open
PhilipJohnBasile wants to merge 2 commits into
youssofal:mainfrom
PhilipJohnBasile:feat/otlp-http-export
Open

feat(observability): add bounded OTLP HTTP exporter#354
PhilipJohnBasile wants to merge 2 commits into
youssofal:mainfrom
PhilipJohnBasile:feat/otlp-http-export

Conversation

@PhilipJohnBasile

Copy link
Copy Markdown
Contributor

Splits the OTLP/HTTP exporter out of #336.

This PR contains only the observability exporter:

  • dependency-free OTLP/HTTP JSON encoding
  • bounded asynchronous queue and batching
  • short export timeouts and fail-open delivery
  • privacy-default attribute sanitization
  • explicit content opt-in
  • endpoint and header configuration
  • a localhost collector measurement with disabled, healthy, and dead-endpoint arms

It does not add server middleware, policy hooks, replay, memory systems, dashboard code, or workflows.

Measurement on commit 2253b9f, macOS 27.0 arm64, Python 3.14.6, 10,000 spans per arm, batch size 128:

Arm Emit p50 Emit p95 Exported Dropped Request failures
Disabled 7.792 us 8.291 us 0 0 0
Healthy localhost collector 9.833 us 12.458 us 10,000 0 0
Dead endpoint 10.042 us 21.958 us 0 3,202 0

The healthy arm used a 10,000-span bounded queue, reached a high-water mark of 8,080, added 20,304 KiB to process max RSS, and leaked the sentinel content zero times. The dead-endpoint arm used a 1,024-span queue and recorded 54 failed exports without failing a caller.

Reproduce:

python scripts/bench_otlp_export.py \
  --spans 10000 \
  --batch-size 128 \
  --queue-size 1024 \
  --output /tmp/otlp-export.json

Validation:

python -m pytest tests/test_otlp_export.py
6 passed in 0.57s

python -m compileall -q mtplx/otlp_export.py tests/test_otlp_export.py scripts/bench_otlp_export.py
PASS

ruff check mtplx/otlp_export.py tests/test_otlp_export.py scripts/bench_otlp_export.py
PASS

git diff --check
PASS

This measures exporter control-path cost and localhost delivery. It makes no distributed tracing backend or live serving throughput claim.

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