Skip to content

feat(traceimport): add Jaeger JSON import for Grafana Explore Tempo downloads#170

Merged
andrewh merged 5 commits into
mainfrom
claude/grafana-tempo-import-feasibility-i7i061
Jun 13, 2026
Merged

feat(traceimport): add Jaeger JSON import for Grafana Explore Tempo downloads#170
andrewh merged 5 commits into
mainfrom
claude/grafana-tempo-import-feasibility-i7i061

Conversation

@andrewh

@andrewh andrewh commented Jun 12, 2026

Copy link
Copy Markdown
Owner

Adds a new jaeger format to motel import that parses Jaeger JSON exports, including the Jaeger-shaped JSON downloaded from Grafana Explore when viewing Tempo traces.

This intentionally scopes the new parser to Jaeger export JSON. It does not add a separate Tempo HTTP API parser; OTLP-shaped JSON remains handled by the existing otlp parser.

Key changes:

  • FormatJaeger constant and parseJaeger parser in pkg/synth/traceimport
  • detectFormat recognizes Jaeger-style data[].spans[].operationName payloads so --format auto works
  • Service name resolved from the inline process field first, then the trace-level processes map
  • Error detection from the error: true boolean tag
  • Timestamps converted from Jaeger microseconds to time.Time
  • CLI --format flag description and import help updated
  • Unit tests plus a Jaeger JSON seed added to the fuzz corpus

Closes #169

claude added 2 commits June 12, 2026 21:13
Adds a new `tempo` format to `motel import` that parses the Jaeger JSON
structure produced by the Grafana Explore "Download" button (and the
Tempo HTTP API with an `application/json` Accept header).

Key changes:
- `FormatTempo` constant and `parseTempo` parser in span.go
- `isTempoData` probe in `detectFormat` so `--format auto` works
- Service name resolved from the inline `process` field first, then the
  trace-level `processes` map (covering both export variants)
- Error detection from the `error: true` boolean tag
- Timestamps converted from Jaeger microseconds to time.Time
- CLI `--format` flag description and Long help updated
- 7 new unit tests + Tempo seed added to the fuzz corpus

Closes #169

https://claude.ai/code/session_0174BijqRTgPxhRxmairMCot
The format we parse is Jaeger JSON — a named format that predates Tempo
and is also emitted by Jaeger itself and other tools. Calling it "tempo"
was misleading (Tempo also exports OTLP, so the name was ambiguous).

Renamed: FormatTempo → FormatJaeger, parseTempo → parseJaeger,
isTempoData → isJaegerData, and all associated helpers and test names.
The --format flag now accepts "jaeger"; help text notes it is also the
format used by Grafana Tempo's UI export.

https://claude.ai/code/session_0174BijqRTgPxhRxmairMCot
@andrewh
andrewh requested a review from Copilot June 12, 2026 21:27

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@andrewh

andrewh commented Jun 13, 2026

Copy link
Copy Markdown
Owner Author

Findings:

  1. [P1] make lint fails in pkg/synth/traceimport/span.go:363. gofmt -s wants the new jaegerTrace struct alignment fixed, so this PR currently fails the repo's lint target.

  2. [P2] Tempo API support is not actually covered around pkg/synth/traceimport/span.go:97 and pkg/synth/traceimport/span.go:393. The new parser only detects/parses Jaeger-style data[].spans[].operationName JSON. Current Grafana Tempo API docs say /api/traces and /api/v2/traces return OpenTelemetry JSON by default, with protobuf available via Accept: application/protobuf. If the PR intends to support Tempo HTTP API JSON, it needs a real fixture/test for that shape or the claim should be narrowed to Grafana Explore/Jaeger export JSON.

  3. [P3] Checked-in docs are stale at docs/reference/synth.md:150 and docs/demos/demo-import.md:90; both still list only auto, stdouttrace, and otlp.

Verification: I applied PR 170 to a temporary copy. make lint failed on pkg/synth/traceimport/span.go. make test passed pkg/synth/traceimport, but full make test failed in unrelated pkg/synth/metricoffset_test.go:166.

Run gofmt on the new Jaeger parser types so make lint passes.

Update import reference docs and demo copy to include the jaeger format, while narrowing Tempo wording to Grafana Explore downloads rather than Tempo HTTP API JSON.
@andrewh andrewh changed the title feat(traceimport): add Grafana Tempo / Jaeger JSON import format feat(traceimport): add Jaeger JSON import for Grafana Explore Tempo downloads Jun 13, 2026
@andrewh
andrewh merged commit 988eb61 into main Jun 13, 2026
2 checks passed
@andrewh
andrewh deleted the claude/grafana-tempo-import-feasibility-i7i061 branch June 13, 2026 10:53
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.

Import Grafana Tempo / Jaeger format trace exports

3 participants