Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ extension predating them keeps its PHP tracing and loses only the Drupal page.

| Flag | Environment variable | Default | Description |
| --- | --- | --- | --- |
| `--uri` | `COMPASS_URI` | `http://localhost:28624/v1/traces` | Trace stream to connect to. `extension:///path/to/compass.so` traces a probe file directly. |
| `--uri` | `COMPASS_URI` | `http://localhost:28624/v1/traces` | Trace stream to connect to, served as newline-delimited JSON (`application/x-ndjson`). `extension:///path/to/compass.so` traces a probe file directly. |
| `--token` | `COMPASS_TOKEN` | | Sent to the sidecar as the `X-Skpr-Token` header. |
| `--ca-file` | `COMPASS_CA_FILE` | | Certificate authority which signed the sidecar certificate. |
| `--insecure-skip-verify` | `COMPASS_INSECURE_SKIP_VERIFY` | `false` | Skip verification of the sidecar certificate. |
Expand Down
5 changes: 4 additions & 1 deletion cmd/compass-sidecar/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,10 @@ func main() {
subscriber := b.Subscribe()
defer b.Unsubscribe(subscriber)

w.Header().Set("Content-Type", "text/event-stream")
// The stream is newline-delimited JSON: one trace object per
// line, as json.NewEncoder writes below. It is not SSE, so it
// is labelled as NDJSON rather than text/event-stream.
w.Header().Set("Content-Type", "application/x-ndjson")
w.Header().Set("Cache-Control", "no-cache")
w.Header().Set("Connection", "keep-alive")
w.WriteHeader(http.StatusOK)
Expand Down
Loading