Skip to content

feat(platform): export OTLP traces#870

Merged
tbille merged 11 commits intomainfrom
codex/otel-traces
Mar 6, 2026
Merged

feat(platform): export OTLP traces#870
tbille merged 11 commits intomainfrom
codex/otel-traces

Conversation

@tbille
Copy link
Copy Markdown
Contributor

@tbille tbille commented Feb 27, 2026

Description

  • Replace manual platform usage-event posting with OpenTelemetry SDK OTLP/HTTP trace export for platform completions (including MZAI) while keeping payloads prompt/response-free.
  • Add session_label passthrough in SDK/API and export it as trace metadata (anyllm.user_session_label) alongside platform-generated trace session labels.
  • Add scoped forwarding + sanitization guards for active trace exports (token-scoped forwarding processor, content-attribute redaction, secure endpoint enforcement), and expand unit coverage for edge/error paths.
  • Update platform docs to describe trace analytics/redaction behavior and expected session-label semantics.

PR Type

  • 🆕 New Feature
  • 📚 Documentation

Relevant issues

Checklist

  • I understand the code I am submitting.
  • I have added unit tests that prove my fix/feature works
  • I have run this code locally and verified it fixes the issue.
  • New and existing tests pass locally
  • Documentation was updated where necessary
  • I have read and followed the contribution guidelines
  • AI Usage:
    • No AI was used.
    • AI was used for drafting/refactoring.
    • This is fully AI-generated.

AI Usage Information

  • AI Model used: GPT-5

  • AI Developer Tool used: Codex (OpenAI)

  • Any other info you'd like to share:

  • I am an AI Agent filling out this form (check box if true)

@github-actions github-actions bot added the missing-template PR is missing required template checklist label Feb 27, 2026
@tbille tbille temporarily deployed to integration-tests February 27, 2026 13:59 — with GitHub Actions Inactive
@github-actions github-actions bot removed the missing-template PR is missing required template checklist label Feb 27, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Feb 27, 2026

Codecov Report

❌ Patch coverage is 84.79381% with 59 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/any_llm/providers/platform/platform.py 79.78% 13 Missing and 6 partials ⚠️
src/any_llm/providers/platform/utils.py 91.70% 10 Missing and 7 partials ⚠️
src/any_llm/utils/aio.py 80.51% 9 Missing and 6 partials ⚠️
src/any_llm/any_llm.py 20.00% 7 Missing and 1 partial ⚠️
Files with missing lines Coverage Δ
src/any_llm/api.py 58.09% <ø> (-7.62%) ⬇️
src/any_llm/providers/platform/__init__.py 100.00% <100.00%> (ø)
src/any_llm/any_llm.py 69.70% <20.00%> (-3.87%) ⬇️
src/any_llm/utils/aio.py 75.65% <80.51%> (+21.48%) ⬆️
src/any_llm/providers/platform/utils.py 91.90% <91.70%> (-8.10%) ⬇️
src/any_llm/providers/platform/platform.py 86.06% <79.78%> (-1.26%) ⬇️

... and 40 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@tbille tbille temporarily deployed to integration-tests February 27, 2026 15:39 — with GitHub Actions Inactive
@tbille tbille temporarily deployed to integration-tests February 27, 2026 15:39 — with GitHub Actions Inactive
@tbille tbille temporarily deployed to integration-tests February 28, 2026 09:47 — with GitHub Actions Inactive
@tbille tbille temporarily deployed to integration-tests February 28, 2026 09:47 — with GitHub Actions Inactive
@tbille tbille temporarily deployed to integration-tests March 4, 2026 10:58 — with GitHub Actions Inactive
@tbille tbille temporarily deployed to integration-tests March 4, 2026 10:58 — with GitHub Actions Inactive
@tbille tbille force-pushed the codex/otel-traces branch from 7d4daa8 to 7033e02 Compare March 4, 2026 12:26
@tbille tbille temporarily deployed to integration-tests March 4, 2026 12:26 — with GitHub Actions Inactive
@tbille tbille temporarily deployed to integration-tests March 4, 2026 12:26 — with GitHub Actions Inactive
@tbille tbille force-pushed the codex/otel-traces branch from 7033e02 to 2111f87 Compare March 4, 2026 12:33
@tbille tbille temporarily deployed to integration-tests March 4, 2026 12:33 — with GitHub Actions Inactive
@tbille tbille temporarily deployed to integration-tests March 4, 2026 12:33 — with GitHub Actions Inactive
@tbille tbille temporarily deployed to integration-tests March 4, 2026 12:35 — with GitHub Actions Inactive
@tbille tbille temporarily deployed to integration-tests March 4, 2026 12:35 — with GitHub Actions Inactive
@tbille tbille temporarily deployed to integration-tests March 5, 2026 09:20 — with GitHub Actions Inactive
@tbille tbille temporarily deployed to integration-tests March 5, 2026 09:20 — with GitHub Actions Inactive
@tbille tbille temporarily deployed to integration-tests March 5, 2026 10:47 — with GitHub Actions Inactive
@tbille tbille temporarily deployed to integration-tests March 5, 2026 10:47 — with GitHub Actions Inactive
@tbille tbille force-pushed the codex/otel-traces branch from 87f93fa to 7915adc Compare March 5, 2026 15:55
@tbille tbille temporarily deployed to integration-tests March 5, 2026 15:55 — with GitHub Actions Inactive
@tbille tbille temporarily deployed to integration-tests March 5, 2026 15:55 — with GitHub Actions Inactive
dpoulopoulos
dpoulopoulos previously approved these changes Mar 5, 2026
dpoulopoulos
dpoulopoulos previously approved these changes Mar 6, 2026
@tbille tbille merged commit d1dddb3 into main Mar 6, 2026
12 checks passed
@tbille tbille deleted the codex/otel-traces branch March 6, 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.

2 participants