Skip to content

Label the trace stream as NDJSON, not SSE - #182

Merged
nickschuch merged 1 commit into
mainfrom
fix/traces-content-type
Sep 4, 2026
Merged

Label the trace stream as NDJSON, not SSE#182
nickschuch merged 1 commit into
mainfrom
fix/traces-content-type

Conversation

@nickschuch

Copy link
Copy Markdown
Contributor

The /v1/traces handler advertised Content-Type text/event-stream but wrote newline-delimited JSON: json.NewEncoder emits one object per line, not the 'data:'-prefixed, blank-line-separated frames SSE requires. A conformant SSE client reads the whole response as one unterminated event. The Compass CLI works only because it parses the body as line-delimited JSON and never checks the content type.

Relabel the response as application/x-ndjson, which matches the bytes on the wire; no wire change is needed and the CLI is unaffected. Document the format on the --uri row in the README.

The /v1/traces handler advertised Content-Type text/event-stream but wrote
newline-delimited JSON: json.NewEncoder emits one object per line, not the
'data:'-prefixed, blank-line-separated frames SSE requires. A conformant SSE
client reads the whole response as one unterminated event. The Compass CLI
works only because it parses the body as line-delimited JSON and never checks
the content type.

Relabel the response as application/x-ndjson, which matches the bytes on the
wire; no wire change is needed and the CLI is unaffected. Document the format
on the --uri row in the README.
@nickschuch
nickschuch merged commit 7381017 into main Sep 4, 2026
5 checks passed
@nickschuch
nickschuch deleted the fix/traces-content-type branch September 4, 2026 06:35
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.

1 participant