Skip to main content
Sentry SDK intake, one JSON line per envelope itemsee the endpoints

Sentry SDK intake into your own bucket

Change one DSN and every error, transaction, span and log a Sentry SDK sends becomes a JSON line in your bucket or table, ready for SQL.

s3://analytics-raw/raw/s2b/stream=4f1c2b9e-8d3a-4e7b-9c51-0a6f2d8e3b17/date=2026-11-24/hour=09/5 objects · 11 lines
line 2 of dlv_003620hsnk209iqnl36prv7k2lppi.ndjson.gzevent
{
"v": 1,
"delivery_batch_id": "dlv_003620hsnk209iqnl36prv7k2lppi",
"stream_id": "4f1c2b9e-8d3a-4e7b-9c51-0a6f2d8e3b17",
"batch_id": "bat_003620hsh14vidvc1pufa8adub0b6",
"received_at": "2026-11-24T09:21:33.657593Z",
"signal": "event",
"data": {
"type": "event",
"envelope": {
"event_id": "07a0065d44bc44abb59fa8e6eebac313",
"sent_at": "2026-11-24T09:21:33.634Z",
"sdk": {…}, 2 keys
"trace": {…} 3 keys
},
"item": {"type": "event"},
"encoding": "json",
"payload": {
"exception": {
"values": [
{
"type": "Error",
"value": "order not found",
"stacktrace": {…}, 1 keys
"mechanism": {…} 2 keys
}
]
},
"event_id": "07a0065d44bc44abb59fa8e6eebac313",
"level": "error",
"platform": "node",
"contexts": {…}, 2 keys
"timestamp": 1795512093.594,
"environment": "production",
"sdk": {…} 2 keys
}
}
}

one dsn, any sentry sdk

Set it wherever the SDK takes its DSN. A DSN ships inside browser apps, so give it a key that writes only to this stream.

<key>
API key, used as the DSN's public key
api.send2bucket.com/v1/events/sentry/
the Sentry intake
<stream_id>
stream ID, optional for a key with one stream
1
project ID, ignored
import sentry_sdk

sentry_sdk.init(
    dsn="https://<key>@api.send2bucket.com/v1/events/sentry/1",
    traces_sample_rate=1.0,
    enable_logs=True,
    _experiments={"transport_compression_algo": "gzip"},
)

the same DSN, in any Sentry SDK

  • Pythonsentry_sdk.init(dsn=…)
  • Node.jsSentry.init({dsn: …})
  • JavaScript in the browserSentry.init({dsn: …})

every envelope item, one line

Logs are stored as log, transactions and spans as span, trace metrics as metric, everything else as event.

type
the item type: event, transaction, span, log
envelope
the envelope header: event_id, sent_at, sdk, trace
item
the item header: type, length, content_type
encoding
json for a JSON object, else base64
payload
the item as the SDK sent it
-> your bucket, a log line
{"v":1,"delivery_batch_id":"dlv_003620i4jcmfsomeheno4l974n9q2","stream_id":"4f1c2b9e-8d3a-4e7b-9c51-0a6f2d8e3b17","batch_id":"bat_003620i4dkhq147n80kko0ds6ceu6","received_at":"2026-11-24T09:23:46.096032Z","signal":"log","data":{"type":"log","envelope":{"sent_at":"2026-11-24T09:23:46.047882Z"},"item":{"item_count":1,"type":"log","content_type":"application/vnd.sentry.items.log+json","length":628},"encoding":"json","payload":{"timestamp":1795512226.0473495,"level":"info","body":"nightly report written","attributes":{"sentry.sdk.name":{"value":"sentry.python.starlette","type":"string"},"sentry.sdk.version":{"value":"3.0.0","type":"string"},"sentry.environment":{"value":"production","type":"string"},"sentry.severity_number":{"value":9,"type":"integer"},"sentry.severity_text":{"value":"info","type":"string"}},"trace_id":"9e3073ac20eb4c30853d38b7d78e8143"}}}
  • event
  • transaction
  • span
  • log
  • otel_log
  • attachment
  • session
  • client_report
  • trace_metric
  • statsd
  • metric_buckets

one envelope, start to finish

A 200 with the event's ID means the items are stored durably and will be delivered at least once. Every reply allows any origin, so browser SDKs need nothing more.

the key is read from the first of

  1. X-Sentry-Auth, or Authorization: Sentry …
  2. the sentry_key query parameter browser SDKs send
  3. the envelope header's dsn
send one envelope
$ curl -i https://api.send2bucket.com/v1/events/sentry/api/1/envelope/ \
  -H "X-Sentry-Auth: Sentry sentry_version=7, sentry_key=$S2B_API_KEY" \
  --data-binary $'{"event_id":"9ec79c33ec9942ab8353589fcb2e04dc"}\n{"type":"event"}\n{"message":"hello from curl","level":"info"}\n'
<- 200{"id":"9ec79c33ec9942ab8353589fcb2e04dc"}
-> your bucket, the line it becomes

s3://analytics-raw/raw/s2b/stream=4f1c2b9e-8d3a-4e7b-9c51-0a6f2d8e3b17/date=2026-11-19/hour=03/dlv_01jd3kg8m4.ndjson.gz

{"v":1,"delivery_batch_id":"dlv_01jd3kg8m4","stream_id":"4f1c2b9e-8d3a-4e7b-9c51-0a6f2d8e3b17","batch_id":"bat_01jd3kg6q0","received_at":"2026-11-19T03:04:12.300125Z","signal":"event","data":{"type":"event","envelope":{"event_id":"9ec79c33ec9942ab8353589fcb2e04dc"},"item":{"type":"event"},"encoding":"json","payload":{"message":"hello from curl","level":"info"}}}

errors by exception, in sql

DuckDB reads the objects in place. The last exception in values is the one thrown.

duckdb · errors by exception
SELECT data->>'$.payload.platform' AS platform,
       data->>'$.payload.exception.values[#-1].type' AS type,
       data->>'$.payload.exception.values[#-1].value' AS message,
       count(*) AS events
FROM sentry
WHERE data->>'$.type' = 'event'
GROUP BY ALL
ORDER BY events DESC;
platformtypemessageevents
pythonZeroDivisionErrordivision by zero4
nodeErrororder not found1

2 rows

$ curl -i https://api.send2bucket.com/v1/events/sentry/api/1/envelope/

send your first envelope

Create a stream and an API key in the dashboard, add a destination, then set the DSN.

  • [ok] errors, transactions, spans, logs, sessions and attachments
  • [ok] one JSON line per item, in your bucket or table
  • [ok] any Sentry SDK, with one DSN
create an ingestion stream

see pricing