Skip to content

feat(import): OTel GenAI traces → eval fixtures/trajectories (#15)#23

Merged
amitpaz1 merged 1 commit into
mainfrom
feat/issue-15-otel-import
Jun 26, 2026
Merged

feat(import): OTel GenAI traces → eval fixtures/trajectories (#15)#23
amitpaz1 merged 1 commit into
mainfrom
feat/issue-15-otel-import

Conversation

@amitpaz1

Copy link
Copy Markdown
Member

Closes #15.

What: ingest an OTLP trace export as a replayable eval suite — one EvalCase per trace (input from the GenAI prompt, expected from the completion, ordered tool calls as a trajectory). Fixture ingestion, NOT a trace dashboard (the explicit anti-goal).

How:

  • importers/otel.pyimport_otel(file_path, ...) parses resourceSpans → scopeSpans → spans, groups by traceId (ordered by start time), maps each trace to an EvalCase. Handles both content styles — structured gen_ai.input/output.messages and indexed OpenLLMetry gen_ai.{prompt,completion}.{i}. A trace with tool calls → expected.tools + the tool-check grader; no input → skipped; bad file → OtelImportError.
  • commands/importers.pyimport --from otel --file traces.json (--file added; --db now optional, required per-source); reuses export_suite_yaml.
  • README: the otel import example.

Tests: test_otel_import.py (replay fixture, tools→trajectory/tool-check, indexed OpenLLMetry style, skip-no-input, group-by-trace, bad-file→error). pytest 6/6 + 48 import tests green (no regression); mypy + ruff clean.

Ingest an OTLP trace export as a replayable eval suite — one EvalCase per trace
(input from the GenAI prompt, expected from the completion, ordered tool calls as
a trajectory). Fixture ingestion, NOT a trace dashboard (the explicit anti-goal).

- importers/otel.py: import_otel(file_path, ...) parses resourceSpans →
  scopeSpans → spans, groups by traceId (ordered by start time), and maps each
  trace to an EvalCase. Handles both content styles — structured
  gen_ai.input/output.messages and indexed OpenLLMetry gen_ai.{prompt,completion}
  .{i}. A trace with tool calls → expected.tools + the tool-check grader
  (trajectory); no input → skipped; bad file → OtelImportError.
- commands/importers.py: `import --from otel --file traces.json` (--file added;
  --db now optional, required per-source); reuses export_suite_yaml.
- README: the otel import example.

Tests: test_otel_import.py (replay fixture, tools→trajectory/tool-check, indexed
OpenLLMetry style, skip-no-input, group-by-trace, bad-file→error). pytest 6/6 +
48 import tests green (no regression); mypy + ruff clean.

Closes #15.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019tXZpN29akdmG8AEjgSZwk
@amitpaz1
amitpaz1 merged commit 4e8831f into main Jun 26, 2026
4 checks passed
@amitpaz1
amitpaz1 deleted the feat/issue-15-otel-import branch June 26, 2026 10:09
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.

OTel GenAI trace ingestion as eval fixtures/trajectories (NOT a trace dashboard — anti-goal)

1 participant