Add support for traces exported from Tempo#129
Merged
krisztianfekete merged 2 commits intomainfrom Apr 30, 2026
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds end-to-end support for Tempo-exported OTLP trace uploads by switching the backend (and parts of the UI) to content-based trace-format auto-detection, expanding OTLP shape compatibility, and hardening the offline-eval UI path.
Changes:
- Add an auto-detecting trace loader (
load_traces/detect_format) and flip defaults so trace format is inferred unless explicitly overridden. - Expand OTLP parsing to accept Tempo v1/v2 export shapes and improve ADK span detection/recovery for Tempo-compacted traces.
- Update the UI to accept
.jsonand.jsonltrace uploads, use the unified loader, and guard against malformed SSE completion payloads.
Reviewed changes
Copilot reviewed 23 out of 24 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| ui/src/lib/trace-loader.ts | Replaces Jaeger-default parsing with loadTraces() auto-detection for Jaeger JSON, OTLP JSON, Tempo wrappers, and OTLP JSONL. |
| ui/src/context/TraceProvider.tsx | Prevents offline-eval crash by guarding traceResults.map and normalizing error handling. |
| ui/src/components/upload/UploadView.tsx | Allows .json,.jsonl trace uploads in the offline-eval upload view. |
| ui/src/components/upload/TraceEditorDrawer.tsx | Switches editor parsing to loadTraces() to support non-Jaeger formats. |
| ui/src/components/builder/TraceUploadZone.tsx | Updates UI text to reflect .json/.jsonl trace support. |
| ui/src/api/client.ts | Removes explicit trace_format form field from convert calls (backend auto-detects). |
| tests/test_otlp_loader.py | Adds regression coverage for Tempo v1/v2 OTLP export shapes and a real Tempo fixture. |
| tests/test_loader_auto.py | New tests for loader auto-detection and load_traces dispatch behavior. |
| tests/test_extraction.py | Adds ADK marker fallbacks and subtree recovery tests for Tempo-compacted traces. |
| tests/test_converter.py | Adds integration test covering load→detect→convert on the real Tempo fixture. |
| tests/test_api.py | Updates streaming tests to patch load_traces; adds /convert auto-detect API regression tests. |
| src/agentevals/runner.py | Uses unified load_traces() instead of a per-format loader factory. |
| src/agentevals/mcp_server.py | Makes trace_format optional and updates docs to reflect auto-detection. |
| src/agentevals/loader/otlp.py | Extends OTLP loader to support batches, instrumentationLibrarySpans, and Tempo v2 wrapper. |
| src/agentevals/loader/auto.py | Introduces content-based format detection and unified file-loading entrypoint. |
| src/agentevals/loader/init.py | Exposes auto-loader entrypoints and constants at the package level. |
| src/agentevals/extraction.py | Broadens ADK detection signals and adds has_adk_descendant recovery. |
| src/agentevals/eval_config_loader.py | Adjusts config merging for optional trace_format (None = auto). |
| src/agentevals/converter.py | Reuses ADK detection helpers and recovers invoke_agent via ADK-instrumented descendants. |
| src/agentevals/config.py | Makes trace_format optional and updates config descriptions for auto-detection. |
| src/agentevals/cli.py | Makes --format optional and constrains overrides to known formats. |
| src/agentevals/api/routes.py | Switches /convert and streaming paths to use load_traces() auto-detection. |
| samples/tempo_export_with_batches.json | Adds a real Tempo export fixture used by regression/integration tests. |
| docs/streaming.md | Updates documentation to reflect auto-detected Jaeger vs OTLP loading behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes the offline-eval crash on Tempo/OTLP .json uploads and cleans up the codebase to auto-detect trace formats instead of defaulting to Jaeger.
loader/auto.pywithload_traces / detect_formatsniffs JSON top-level keys and dispatches;--formatandtrace_formatdefaults flipped from"jaeger-json"toNone (auto), override still works.instrumentationLibrarySpans,instrumentationLibrary, and the Tempo v2{"trace": {...}}envelope all parse correctly.is_adk_scopenow also matchesgen_ai.system == "gcp.vertex.agent"andgcp.vertex.agent.*custom attrs; newhas_adk_descendantrecoversinvoke_agentparents whose markers got dropped on export.loadJaegerTraces->loadTraces, trace dropzones accept.json,.jsonl, defensive guard aroundresult.traceResults.mapso malformed SSE payloads surface a real error. We will be removing this duplicated trace parsing in a follow-up PR, see Eliminate duplicated trace parsing between frontend and backend #130Fixes #127