Skip to content

Bug: /otel/v1/traces does not decompress gzip #2411

Description

@nizmle

Identical OTLP/JSON payload, same headers. Uncompressed → 200. Gzipped → 400.

curl -X POST https://api.braintrust.dev/otel/v1/traces \
  -H "Authorization: Bearer $KEY" -H "x-bt-parent: project_id:$PROJECT" \
  -H "Content-Type: application/json" --data-binary @payload.json          # 200

gzip -c payload.json > payload.json.gz
curl -X POST https://api.braintrust.dev/otel/v1/traces \
  -H "Authorization: Bearer $KEY" -H "x-bt-parent: project_id:$PROJECT" \
  -H "Content-Type: application/json" -H "Content-Encoding: gzip" \
  --data-binary @payload.json.gz                                           # 400

The gzipped request returns Invalid traces data: resourceSpans Required, i.e. the compressed bytes
are parsed as JSON without inflating first.

This blocks Cloudflare Workers Observability entirely. Cloudflare always sends Content-Type: application/json with Content-Encoding: gzip , confirmed by echoing the request to our own Worker and logging the first bytes as 1f 8b 08 00.

There is no setting on either side to turn it off. gzip is standard in the OTLP/HTTP spec.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions