Skip to content

Commit

Permalink
feat: Add basic schema and examples for ingest-events [INC-660] (#230)
Browse files Browse the repository at this point in the history
Adding the schema for ingest-events so we can perform more validations against clients (producers + consumers) on this topic.

Specifically, the are 4 known immediate use cases for this:
- Exceptions raised in the ingest consumer can be checked against this schema and DLQed if they do not conform
- Relay CI can check that messages produced on this topic conform to this schema
- Sentry devserver will validate all incoming messages against this schema
- Sentry CI can launch all consumers and pass these messages in and assert that they do not crash

This is based on https://github.com/getsentry/relay/blob/19230c0deabd41096830e46fbec821999dd51ee3/relay-server/src/services/store.rs#L1246-L1261
  • Loading branch information
lynnagara committed Mar 11, 2024
1 parent 8d6b838 commit 171532b
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 0 deletions.
1 change: 1 addition & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
@@ -1,4 +1,5 @@
# Ingest topics
/topics/ingest-events.yaml @getsentry/owners-snuba @getsentry/ingest @getsentry/ops
/topics/ingest-metrics.yaml @getsentry/owners-snuba @getsentry/ingest
/topics/ingest-performance-metrics.yaml @getsentry/owners-snuba @getsentry/ingest
/topics/ingest-replay-recordings.yaml @getsentry/owners-snuba @getsentry/ingest @getsentry/replay
Expand Down
1 change: 1 addition & 0 deletions examples/ingest-events/1/dev-default-message.msgpack
@@ -0,0 +1 @@
��type�event�payload��{"event_id":"2107c4e968514c8690d3a3a24570c40d","level":"info","version":"7","type":"default","transaction_info":{},"logentry":{"formatted":"Something went wrong"},"logger":"","modules":{"certifi":"2024.2.2","pip":"23.3.1","pywatchman":"1.4.1","sentry-sdk":"1.40.6","setuptools":"68.2.2","urllib3":"2.2.1","wheel":"0.41.3"},"platform":"python","timestamp":1709691573.27258,"received":1709691573.415304,"environment":"production","contexts":{"runtime":{"name":"CPython","version":"3.11.6","build":"3.11.6 (main, Nov 2 2023, 04:39:43) [Clang 14.0.3 (clang-1403.0.22.14.1)]","type":"runtime"},"trace":{"trace_id":"97791ab406224f03be50f19307648648","span_id":"864321f6ade8a8d9","status":"unknown","type":"trace"}},"tags":[["server_name","CH26FF6WL3"]],"extra":{"sys.argv":["send_event.py"]},"sdk":{"name":"sentry.python","version":"1.40.6","integrations":["argv","atexit","dedupe","excepthook","logging","modules","stdlib","threading"],"packages":[{"name":"pypi:sentry-sdk","version":"1.40.6"}]},"key_id":"3","project":3,"grouping_config":{"enhancements":"KLUv_SAYwQAAkwKRs25ld3N0eWxlOjIwMjMtMDEtMTGQ","id":"newstyle:2023-01-11"},"_metrics":{"bytes.ingested.event":906}}�start_time�e�ҵ�event_id� 2107c4e968514c8690d3a3a24570c40d�project_id�remote_addr�172.18.0.1�attachments�
15 changes: 15 additions & 0 deletions schemas/ingest-events.v1.schema.json
@@ -0,0 +1,15 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"description": "Error message from Relay",
"type": "object",
"properties": {
"type": { "type": "string" },
"payload": {
"description": "bytes"
},
"event_id": { "type": "string" },
"project_id": { "type": "integer" },
"start_time": { "type": "integer" }
},
"required": ["type", "event_id", "project_id", "payload", "start_time"]
}
17 changes: 17 additions & 0 deletions topics/ingest-events.yaml
@@ -0,0 +1,17 @@
topic: ingest-events
pipeline: errors
description: Errors data from Relay
services:
producers:
- getsentry/relay
consumers:
- getsentry/sentry
schemas:
- version: 1
compatibility_mode: none
type: msgpack
resource: ingest-events.v1.schema.json
examples:
- ingest-events/1/
topic_creation_config:
max.message.bytes: "10000000"

0 comments on commit 171532b

Please sign in to comment.