fix(telemetry): use .batches for Tempo trace lookup in integration test

Tempo /api/traces/{id} returns OTLP-shaped JSON with a top-level
"batches" key, not "data". The cross-check in check_log_correlation
was querying jq '.data | length' which always returned null, causing
the Log-Tempo cross-check to fail even when the trace existed.
This commit is contained in:
Pratik Mankawde
2026-05-13 12:16:41 +01:00
parent 4bbe28cb92
commit fac3287912

View File

@@ -103,8 +103,9 @@ check_log_correlation() {
# Cross-check: verify the sample trace_id exists in Tempo
if [ -n "$sample_trace_id" ]; then
local trace_found
# Tempo /api/traces/{id} returns OTLP shape: {"batches":[...]}
trace_found=$(curl -sf "$TEMPO/api/traces/$sample_trace_id" \
| jq '.data | length' 2>/dev/null) || trace_found=0
| jq '.batches | length' 2>/dev/null) || trace_found=0
if [ "$trace_found" -gt 0 ]; then
ok "Log-Tempo cross-check: trace_id=$sample_trace_id found in Tempo"
else