feat(traceimport): add Jaeger JSON import for Grafana Explore Tempo downloads#170
Conversation
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
|
Findings:
Verification: I applied PR 170 to a temporary copy. |
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.
Adds a new
jaegerformat tomotel importthat 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
otlpparser.Key changes:
FormatJaegerconstant andparseJaegerparser inpkg/synth/traceimportdetectFormatrecognizes Jaeger-styledata[].spans[].operationNamepayloads so--format autoworksprocessfield first, then the trace-levelprocessesmaperror: trueboolean tagtime.Time--formatflag description and import help updatedCloses #169