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,12 +13,30 @@ ...@@ -13,12 +13,30 @@
"type": "object" "type": "object"
}, },
"exception": { "exception": {
"oneOf": [
{
"type": "array",
"items": {
"$ref": "#/definitions/exception"
}
},
{
"type": "object", "type": "object",
"required": ["values"], "required": ["values"],
"properties": { "properties": {
"values": { "values": {
"type": "array", "type": "array",
"items": { "items": {
"$ref": "#/definitions/exception"
}
}
}
}
]
}
},
"definitions": {
"exception": {
"type": "object", "type": "object",
"required": [], "required": [],
"properties": { "properties": {
...@@ -70,7 +88,4 @@ ...@@ -70,7 +88,4 @@
} }
} }
} }
}
}
}
} }
...@@ -42,6 +42,12 @@ RSpec.describe ErrorTracking::Collector::PayloadValidator do ...@@ -42,6 +42,12 @@ RSpec.describe ErrorTracking::Collector::PayloadValidator do
it_behaves_like 'valid payload' it_behaves_like 'valid payload'
end 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 context 'empty payload' do
let(:payload) { '' } 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