Skip to content

Commit d288a50

Browse files
Add spans data schema (#153)
* add spans data bag to schema * add transactions title * move additional props inside type * style(lint): Auto commit lint changes --------- Co-authored-by: getsantry[bot] <66042841+getsantry[bot]@users.noreply.github.com>
1 parent b1385c0 commit d288a50

File tree

2 files changed

+58
-2
lines changed

2 files changed

+58
-2
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ The yaml file of a topic has 2 keys:
3737
## Using the schema (in Python)
3838

3939
```python
40-
from sentry_kafka_schemas import get_codec, ValidationError
40+
from sentry_kafka_schemas import get_codec
41+
from sentry_kafka_schemas.codecs import ValidationError
4142
from sentry_kafka_schemas.schema_types.ingest_metrics_v1 import IngestMetric
4243

4344
SCHEMA: Codec[IngestMetric] = get_codec("ingest-metrics")

schemas/transactions.v1.schema.json

Lines changed: 56 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"title": "transaction_stream_message",
34
"type": "array",
45
"items": [
56
{ "const": 2 },
@@ -970,7 +971,7 @@
970971
"type": ["object", "null"]
971972
},
972973
"data": {
973-
"type": ["object", "null"]
974+
"anyOf": [{ "$ref": "#/definitions/SpanData" }, { "type": "null" }]
974975
},
975976
"hash": {
976977
"type": "string"
@@ -1106,6 +1107,60 @@
11061107
"additionalProperties": true
11071108
}
11081109
]
1110+
},
1111+
"SpanData": {
1112+
"description": "Spans data bag",
1113+
"anyOf": [
1114+
{
1115+
"type": "object",
1116+
"properties": {
1117+
"environment": {
1118+
"type": ["string", "null"]
1119+
},
1120+
"http.method": {
1121+
"type": ["string", "null"]
1122+
},
1123+
"span.action": {
1124+
"type": ["string", "null"]
1125+
},
1126+
"span.domain": {
1127+
"type": ["string", "null"]
1128+
},
1129+
"span.module": {
1130+
"type": ["string", "null"]
1131+
},
1132+
"span.op": {
1133+
"type": ["string", "null"]
1134+
},
1135+
"span.group": {
1136+
"description": "hex hash of the scrubbed span description",
1137+
"type": ["string", "null"]
1138+
},
1139+
"span.status": {
1140+
"type": ["string", "null"]
1141+
},
1142+
"span.system": {
1143+
"type": ["string", "null"]
1144+
},
1145+
"span.status_code": {
1146+
"type": ["integer", "null"]
1147+
},
1148+
"status_code": {
1149+
"type": ["integer", "null"]
1150+
},
1151+
"transaction": {
1152+
"type": ["string", "null"]
1153+
},
1154+
"transaction.op": {
1155+
"type": ["string", "null"]
1156+
},
1157+
"transaction.method": {
1158+
"type": ["string", "null"]
1159+
}
1160+
},
1161+
"additionalProperties": true
1162+
}
1163+
]
11091164
}
11101165
}
11111166
}

0 commit comments

Comments
 (0)