Skip to content

Replay send log markers

When agents use this: Interpret sp-backend schedule logs around each replay HTTP dispatch — the critical entry and exit boundary between replay scheduling and your application.

These structured lines are emitted by sp-schedule (DefaultHttpReplaySender) immediately before and after each entry HTTP call. They appear in correlated log lookups (sp logs --trace-id …, unified trace log downloads) when sp.source is backend and service_name is typically sp-backend.

Query logs with the case traceId (same value as recordedTraceId in the message when correlation succeeded). See sp logs command.


Message prefixes

PrefixSeverityMeaning
Replay send start:INFOSchedule is about to invoke the recorded entry HTTP request
Replay send done:INFOHTTP exchange completed; response status and duration are recorded
Replay send failed:WARNHTTP exchange failed before a normal completion

Each prefix is followed by comma-separated key=value pairs (SLF4J structured message, not JSON).


Structured fields

FieldOnDescription
planIdstart, done, failedReplay plan id for the batch run
targetEnvstart, done, failedtrue when sending to the configured replay test URL (--env / targetEnv); false for record-side sends
methodstart, done, failedHTTP method (GET, POST, …)
urlstart, done, failedFull URL schedule invoked (path and query string included)
recordedTraceIdstart, done, failedW3C trace id from the recording; should match trace_id on the log row when correlation succeeded
spanIdstart, done, failedOpenTelemetry span id active on the send path
httpStatusdone, failedHTTP status code from the response, or -1 when no response was received (connection error, timeout, DNS failure)
durationMsdone, failedWall-clock milliseconds for the HTTP exchange
errorfailed onlyException or error message when the send did not complete successfully

Example lines

text
Replay send start: planId=6a3f2aad59f0c4655b0f99da, targetEnv=true, method=POST, url=http://order-service.test:8080/api/orders, recordedTraceId=2057ad46a7ce03d3955385f2a4142d29, spanId=8d10c94a2a6f4e11

Replay send done: planId=6a3f2aad59f0c4655b0f99da, targetEnv=true, method=POST, url=http://order-service.test:8080/api/orders, recordedTraceId=2057ad46a7ce03d3955385f2a4142d29, spanId=8d10c94a2a6f4e11, httpStatus=200, durationMs=142

Replay send failed: planId=6a3f2aad59f0c4655b0f99da, targetEnv=true, method=POST, url=http://order-service.test:8080/api/orders, recordedTraceId=2057ad46a7ce03d3955385f2a4142d29, spanId=8d10c94a2a6f4e11, httpStatus=-1, durationMs=30001, error=Connection refused

How to use them

  1. Obtain traceId from sp replay case list --plan <planId> --failed --json or replay metadata.
  2. Pull correlated logs for a time window around the failure (see Diagnose replay failure example).
  3. Filter sp.source=backend rows whose body contains Replay send start, Replay send done, or Replay send failed.
ObservationLikely cause
No Replay send start in the windowCase may not have reached HTTP send (preload, schedule, or plan cancellation) — check plan status first
start without matching done or failedSend may still be in flight, or logs were truncated — widen the time window
failed with httpStatus=-1Network or timeout reaching targetEnv — verify --env URL, DNS, firewall, and that the app is running
failed with 4xx/5xxApplication returned an error HTTP status — inspect agent and application logs after the start timestamp
done with 2xx but compare still failsEntry request reached the app; investigate agent mock/compare behavior after the done line

These are not the entry/exit markers but often appear on the same failed send:

Message prefixSeverityMeaning
Replay send error:ERRORStack trace after a failed send (follows Replay send failed)
Replay send result invalid:ERRORResponse received but missing expected trace/replay headers for result extraction

Zero code changes · Full-context visibility · Cost optimization