Exclude extra.server fields from exceptions_json.log
What does this MR do?
These fields aren't really useful in a log, because we should know what the server's OS and runtime were. They contribute to increasing log volume.
For gitlab-com/gl-infra/scalability#379 (closed).
To test this, you can do this locally: bundle exec rails r 'begin; 1/0; rescue => e; Gitlab::ErrorTracking.track_exception(e); end'
. Before this change, you'll see something like:
{"severity":"ERROR","time":"2020-05-21T13:42:26.226Z","correlation_id":null,"extra.server":{"os":{"name":"Darwin","version":"Darwin Kernel Version 19.4.0: Wed Mar 4 22:28:40 PST 2020; root:xnu-6153.101.6~15/RELEASE_X86_64","build":"19.4.0","kernel_version":"Darwin Seans-GL-MBP 19.4.0 Darwin Kernel Version 19.4.0: Wed Mar 4 22:28:40 PST 2020; root:xnu-6153.101.6~15/RELEASE_X86_64 x86_64"},"runtime":{"name":"ruby","version":"ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-darwin19]"}},"exception.class":"ZeroDivisionError","exception.message":"divided by 0","exception.backtrace":[]}
And after:
{"severity":"ERROR","time":"2020-05-21T14:10:19.778Z","correlation_id":null,"exception.class":"ZeroDivisionError","exception.message":"divided by 0","exception.backtrace":[]}
Edited by Sean McGivern