Skip to content
Download

SSE streams

The engine pushes new records to the app over Server-Sent Events. Any client can open the same streams.

Path Event payload
GET /api/logs/stream One log record per event.
GET /api/traces/stream One span per event.
GET /api/metrics/stream One data point per event.
GET /api/alerts/stream One fired alert per event.
Terminal window
curl -N "http://127.0.0.1:54321/api/logs/stream"

Each event is one line of JSON after data:. The connection stays open until the client closes it. The engine sends a comment line at intervals to keep the connection alive.

The log stream accepts the same filters as GET /api/logs: severity, service, and collectorId. Add them to the query string.

Terminal window
curl -N "http://127.0.0.1:54321/api/logs/stream?severity=ERROR" \
| sed -n 's/^data: //p' \
| jq -r '.body'