Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(spans): Fix types for integer and number fields #185

Merged
merged 2 commits into from
Oct 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions schemas/ingest-spans.v1.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"type": "string"
},
"exclusive_time": {
"type": "number"
"$ref": "#/definitions/PositiveFloat"
},
"is_segment": {
"type": "boolean"
Expand All @@ -57,7 +57,7 @@
"type": "string"
},
"start_timestamp": {
"type": "number"
"$ref": "#/definitions/PositiveFloat"
},
"status": {
"type": "string"
Expand All @@ -69,7 +69,7 @@
}
},
"timestamp": {
"type": "number"
"$ref": "#/definitions/PositiveFloat"
},
"trace_id": {
"$ref": "#/definitions/UUID"
Expand All @@ -81,6 +81,10 @@
"type": "string",
"minLength": 32,
"maxLength": 36
},
"PositiveFloat": {
"type": "number",
"minimum": 0
}
}
}
32 changes: 25 additions & 7 deletions schemas/snuba-spans.v1.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
"$ref": "#/definitions/UUID"
},
"organization_id": {
"type": "integer"
"$ref": "#/definitions/UInt"
},
"project_id": {
"type": "integer"
"$ref": "#/definitions/UInt"
},
"trace_id": {
"$ref": "#/definitions/UUID",
Expand Down Expand Up @@ -46,22 +46,22 @@
"description": "Whether this span is a segment or not."
},
"start_timestamp_ms": {
"type": "integer",
"$ref": "#/definitions/UInt",
"description": "The start timestamp of the span in milliseconds since epoch."
},
"duration_ms": {
"type": "integer",
"$ref": "#/definitions/UInt32",
"description": "The duration of the span in milliseconds."
},
"exclusive_time_ms": {
"type": "integer",
"$ref": "#/definitions/PositiveFloat",
"description": "The exclusive time of the span in milliseconds."
},
"retention_days": {
"type": ["integer", "null"]
"$ref": "#/definitions/UInt16"
},
"description": {
"type": ["string"]
"type": "string"
},
"tags": {
"description": " Manual key/value tag pairs.",
Expand Down Expand Up @@ -146,6 +146,24 @@
"type": "string",
"minLength": 32,
"maxLength": 36
},
"UInt16": {
"type": "integer",
"minimum": 0,
"maximum": 65535
},
"UInt32": {
"type": "integer",
"minimum": 0,
"maximum": 4294967295
},
"UInt": {
"type": "integer",
"minimum": 0
},
"PositiveFloat": {
"type": "number",
"minimum": 0
}
}
}
Loading