Commit e0d5bee3 authored by Bastian Ike's avatar Bastian Ike Committed by Bastian Ike

Error Tracking: Fix collecting errors for golang

This change makes the schema match Go error events, see:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/72050.
The sentry message format is described here:
https://github.com/getsentry/develop/commit/7578cb2b.

Changelog: fixed
parent 21a5ce7d
......@@ -13,57 +13,72 @@
"type": "object"
},
"exception": {
"type": "object",
"required": ["values"],
"properties": {
"values": {
"oneOf": [
{
"type": "array",
"items": {
"type": "object",
"required": [],
"properties": {
"type": {
"type": "string"
},
"value": {
"type": "string"
},
"stacktrace": {
"$ref": "#/definitions/exception"
}
},
{
"type": "object",
"required": ["values"],
"properties": {
"values": {
"type": "array",
"items": {
"$ref": "#/definitions/exception"
}
}
}
}
]
}
},
"definitions": {
"exception": {
"type": "object",
"required": [],
"properties": {
"type": {
"type": "string"
},
"value": {
"type": "string"
},
"stacktrace": {
"type": "object",
"required": [],
"properties": {
"frames": {
"type": "array",
"items": {
"type": "object",
"required": [],
"properties": {
"frames": {
"type": "array",
"items": {
"type": "object",
"required": [],
"properties": {
"abs_path": {
"type": "string"
},
"function": {
"type": "string"
},
"lineno": {
"type": "number"
},
"in_app": {
"type": "boolean"
},
"filename": {
"type": "string"
},
"pre_context": {
"type": "array"
},
"context_line": {
"type": ["string", "null"]
},
"post_context": {
"type": "array"
}
}
}
"abs_path": {
"type": "string"
},
"function": {
"type": "string"
},
"lineno": {
"type": "number"
},
"in_app": {
"type": "boolean"
},
"filename": {
"type": "string"
},
"pre_context": {
"type": "array"
},
"context_line": {
"type": ["string", "null"]
},
"post_context": {
"type": "array"
}
}
}
......
......@@ -42,6 +42,12 @@ RSpec.describe ErrorTracking::Collector::PayloadValidator do
it_behaves_like 'valid payload'
end
context 'go payload' do
let(:payload) { Gitlab::Json.parse(fixture_file('error_tracking/go_parsed_event.json')) }
it_behaves_like 'valid payload'
end
context 'empty payload' do
let(:payload) { '' }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment