Skip to content

Commit cc07442

Browse files
authored
fix(spans): Align the spans topics with reality (#389)
1 parent 7010662 commit cc07442

File tree

4 files changed

+10
-167
lines changed

4 files changed

+10
-167
lines changed

examples/snuba-spans/1/basic_span.json

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -39,39 +39,5 @@
3939
"value": 100.0,
4040
"unit": "byte"
4141
}
42-
},
43-
"_metrics_summary": {
44-
"c:sentry.events.outcomes@none": [
45-
{
46-
"count": 1,
47-
"max": 1.0,
48-
"min": 1.0,
49-
"sum": 1.0,
50-
"tags": {
51-
"category": "error",
52-
"environment": "unknown",
53-
"event_type": "error",
54-
"outcome": "accepted",
55-
"release": "backend@2af74c237fbd61489a1ccc46650f4f85befaf8b8",
56-
"topic": "outcomes-billing",
57-
"transaction": "sentry.tasks.store.save_event"
58-
}
59-
}
60-
],
61-
"c:sentry.events.post_save.normalize.errors@none": [
62-
{
63-
"count": 1,
64-
"max": 0.0,
65-
"min": 0.0,
66-
"sum": 0.0,
67-
"tags": {
68-
"environment": "unknown",
69-
"event_type": "error",
70-
"from_relay": "False",
71-
"release": "backend@2af74c237fbd61489a1ccc46650f4f85befaf8b8",
72-
"transaction": "sentry.tasks.store.save_event"
73-
}
74-
}
75-
]
7642
}
7743
}

schemas/buffered-segments.v1.schema.json

Lines changed: 7 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,22 @@
55
"additionalProperties": true,
66
"properties": {
77
"spans": {
8-
"$ref": "#/definitions/Spans"
8+
"$ref": "#/definitions/SegmentSpans"
99
}
1010
},
1111
"required": ["spans"],
1212
"definitions": {
13-
"Spans": {
13+
"SegmentSpans": {
1414
"type": "array",
1515
"minItems": 1,
1616
"items": {
17-
"$ref": "#/definitions/Span"
17+
"$ref": "#/definitions/SegmentSpan"
1818
}
1919
},
20-
"Span": {
20+
"SegmentSpan": {
2121
"type": "object",
2222
"additionalProperties": true,
23+
"title": "segment_span",
2324
"properties": {
2425
"event_id": {
2526
"$ref": "#/definitions/UUID"
@@ -39,11 +40,11 @@
3940
"description": "The span ID is a unique identifier for a span within a trace. It is an 8 byte hexadecimal string."
4041
},
4142
"parent_span_id": {
42-
"type": "string",
43+
"type": ["string", "null"],
4344
"description": "The parent span ID is the ID of the span that caused this span. It is an 8 byte hexadecimal string."
4445
},
4546
"segment_id": {
46-
"type": "string",
47+
"type": ["string", "null"],
4748
"description": "The segment ID is a unique identifier for a segment within a trace. It is an 8 byte hexadecimal string."
4849
},
4950
"profile_id": {
@@ -62,10 +63,6 @@
6263
"$ref": "#/definitions/UInt32",
6364
"description": "The duration of the span in milliseconds."
6465
},
65-
"exclusive_time_ms": {
66-
"$ref": "#/definitions/PositiveFloat",
67-
"description": "The exclusive time of the span in milliseconds."
68-
},
6966
"retention_days": {
7067
"$ref": "#/definitions/UInt16"
7168
},
@@ -95,17 +92,10 @@
9592
},
9693
"measurements": {
9794
"$ref": "#/definitions/Measurements"
98-
},
99-
"_metrics_summary": {
100-
"type": "object",
101-
"additionalProperties": {
102-
"$ref": "#/definitions/MetricsSummary"
103-
}
10495
}
10596
},
10697
"required": [
10798
"duration_ms",
108-
"exclusive_time_ms",
10999
"is_segment",
110100
"project_id",
111101
"received",
@@ -205,35 +195,6 @@
205195
}
206196
},
207197
"required": ["value"]
208-
},
209-
"MetricsSummary": {
210-
"type": "array",
211-
"items": {
212-
"$ref": "#/definitions/MetricSummaryValue"
213-
}
214-
},
215-
"MetricSummaryValue": {
216-
"type": "object",
217-
"properties": {
218-
"min": {
219-
"type": "number"
220-
},
221-
"max": {
222-
"type": "number"
223-
},
224-
"sum": {
225-
"type": "number"
226-
},
227-
"count": {
228-
"type": "number"
229-
},
230-
"tags": {
231-
"type": "object",
232-
"additionalProperties": {
233-
"type": "string"
234-
}
235-
}
236-
}
237198
}
238199
}
239200
}

schemas/ingest-spans.v1.schema.json

Lines changed: 1 addition & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,13 @@
2626
"description": "The span ID is a unique identifier for a span within a trace. It is an 8 byte hexadecimal string."
2727
},
2828
"parent_span_id": {
29-
"type": "string",
29+
"type": ["string", "null"],
3030
"description": "The parent span ID is the ID of the span that caused this span. It is an 8 byte hexadecimal string."
3131
},
32-
"segment_id": {
33-
"type": "string",
34-
"description": "The segment ID is a unique identifier for a segment within a trace. It is an 8 byte hexadecimal string."
35-
},
3632
"profile_id": {
3733
"$ref": "#/definitions/UUID",
3834
"description": "The profile ID. It is an 16 byte hexadecimal string."
3935
},
40-
"is_segment": {
41-
"type": "boolean",
42-
"description": "Whether this span is a segment or not."
43-
},
4436
"start_timestamp_ms": {
4537
"$ref": "#/definitions/UInt",
4638
"description": "The start timestamp of the span in milliseconds since epoch."
@@ -57,10 +49,6 @@
5749
"$ref": "#/definitions/UInt32",
5850
"description": "The duration of the span in milliseconds."
5951
},
60-
"exclusive_time_ms": {
61-
"$ref": "#/definitions/PositiveFloat",
62-
"description": "The exclusive time of the span in milliseconds."
63-
},
6452
"retention_days": {
6553
"$ref": "#/definitions/UInt16"
6654
},
@@ -93,18 +81,10 @@
9381
},
9482
"data": {
9583
"$ref": "#/definitions/Data"
96-
},
97-
"_metrics_summary": {
98-
"type": "object",
99-
"additionalProperties": {
100-
"$ref": "#/definitions/MetricsSummary"
101-
}
10284
}
10385
},
10486
"required": [
10587
"duration_ms",
106-
"exclusive_time_ms",
107-
"is_segment",
10888
"project_id",
10989
"organization_id",
11090
"received",
@@ -209,35 +189,6 @@
209189
}
210190
},
211191
"required": ["value"]
212-
},
213-
"MetricsSummary": {
214-
"type": "array",
215-
"items": {
216-
"$ref": "#/definitions/MetricSummaryValue"
217-
}
218-
},
219-
"MetricSummaryValue": {
220-
"type": "object",
221-
"properties": {
222-
"min": {
223-
"type": "number"
224-
},
225-
"max": {
226-
"type": "number"
227-
},
228-
"sum": {
229-
"type": "number"
230-
},
231-
"count": {
232-
"type": "number"
233-
},
234-
"tags": {
235-
"type": "object",
236-
"additionalProperties": {
237-
"type": "string"
238-
}
239-
}
240-
}
241192
}
242193
}
243194
}

schemas/snuba-spans.v1.schema.json

Lines changed: 2 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@
2626
"description": "The span ID is a unique identifier for a span within a trace. It is an 8 byte hexadecimal string."
2727
},
2828
"parent_span_id": {
29-
"type": "string",
29+
"type": ["string", "null"],
3030
"description": "The parent span ID is the ID of the span that caused this span. It is an 8 byte hexadecimal string."
3131
},
3232
"segment_id": {
33-
"type": "string",
33+
"type": ["string", "null"],
3434
"description": "The segment ID is a unique identifier for a segment within a trace. It is an 8 byte hexadecimal string."
3535
},
3636
"profile_id": {
@@ -93,12 +93,6 @@
9393
},
9494
"data": {
9595
"$ref": "#/definitions/Data"
96-
},
97-
"_metrics_summary": {
98-
"type": "object",
99-
"additionalProperties": {
100-
"$ref": "#/definitions/MetricsSummary"
101-
}
10296
}
10397
},
10498
"required": [
@@ -209,35 +203,6 @@
209203
}
210204
},
211205
"required": ["value"]
212-
},
213-
"MetricsSummary": {
214-
"type": "array",
215-
"items": {
216-
"$ref": "#/definitions/MetricSummaryValue"
217-
}
218-
},
219-
"MetricSummaryValue": {
220-
"type": "object",
221-
"properties": {
222-
"min": {
223-
"type": "number"
224-
},
225-
"max": {
226-
"type": "number"
227-
},
228-
"sum": {
229-
"type": "number"
230-
},
231-
"count": {
232-
"type": "number"
233-
},
234-
"tags": {
235-
"type": "object",
236-
"additionalProperties": {
237-
"type": "string"
238-
}
239-
}
240-
}
241206
}
242207
}
243208
}

0 commit comments

Comments
 (0)