HTTP 500 test failures - get Correlation ID, link to Kibana/Sentry logs, user/group
As a next iteration of https://gitlab.com/gitlab-org/quality/team-tasks/-/issues/997
Improve debugging of found HTTP 500 errors
- Get Correlation ID. This is not readily available as Capybara/Selenium abstract the underlying calls and act as if an end user.
- Try to link to Kibana logs ( https://<kibana_url>/app/dashboards#/view/AWfFGg4H5VFy3_25mrdc?_g=h@c823129&_a=h@98bdf8e )
- Try a sentry search for any error found
- (Stretch goal) Report the user and group used. Note -
Runtime::User.usernameandRuntime::Namespace.sandbox_namereturn default values. Perhaps we could store a global variable when we login of the user used.
The GitLab plugin https://chrome.google.com/webstore/detail/gitlab-web-debugger/pjpihpogiidfbgdbmkmmhileaijeakan which uses chrome.webRequest.onCompleted shows how links to Kibana / Sentry can be formed eg.
https://<sentry_url>/gitlab/gitlabcom/?query=correlation_id%3A%22<ID_here>%22
https://<kibana_url>/app/kibana#/dashboard/AWfFGg4H5VFy3_25mrdc?_g=()&_a=(description:'To%20investigate%20a%20correlation,%20edit%20the%20%60json.correlation_id.keyword%60%20filter%20below%20the%20search%20bar.',filters:!(('$state':(store:appState),meta:(alias:!n,disabled:!f,index:<index?>,key:json.correlation_id,negate:!f,params:!(%22<id>%22),type:phrases,value:'<id>'),query:(bool:(minimum_should_match:1,should:!((match_phrase:(json.correlation_id:'<id>')),(match_phrase:(json.correlation_id:'<id>')),(match_phrase:(json.correlation_id:'01FSVYGN1263HM26N3D49X84PA')),(match_phrase:(json.correlation_id:'01FSVYGN3DR0VH6S0FAA91SEN3'))))))),fullScreenMode:!f,options:(darkTheme:!f),query:(language:lucene,query:''),timeRestore:!f,title:'Correlation%20Dashboard',viewMode:view)
Also have a look at gitlab-org/gitlab!78531 (diffs) for reference
Tasks:
-
Identify mapping between test environments and sentry - see gitlab-org/gitlab!82209 (merged) -
Identify mapping between test environments and kibana - see gitlab-org/gitlab!82209 (merged) -
Add link to log for the (now given on 500 page) Request ID for sentry / kibana for relevant identified test environments - see gitlab-org/gitlab!82209 (merged) -
MR merged, rolled out
Edited by Will Meek