Log Diagnostic Reports file size
What does this MR do and why?
Additionally logs the size of the report (in bytes).
This would allow us to troubleshoot potential issues even easier (example using reports logs).
We also will be able to correlate report size and the time it takes to produce it.
The logging code (as well as reports dump) is behind an :ops
FF report_jemalloc_stats
, so could be disabled if it'll misbehave.
How to set up and validate locally
Very similar to !91283 (merged).
- Pull this branch
- Make sure you have
GITLAB_DIAGNOSTIC_REPORTS_ENABLED
set to true (need to restart the Puma and/or Sidekiq) - Set smaller constants
lib/gitlab/memory/reports_daemon.rb
. e.g:DEFAULT_SLEEP_S
could be 5,DEFAULT_SLEEP_MAX_DELTA_S
= 1,DEFAULT_SLEEP_BETWEEN_REPORTS_S
= 1. You could do it via ENV vars (in GDK/GCK) or just hacking the code. - Make sure
report_jemalloc_stats
feature flag is enabled or runFeature.enabled(:report_jemalloc_stats)
- Check
tail -f log/application_json.log
. Could also... | grep jemalloc
. - On OSX+GDK, you will notice an additional field
report_size
, but the value will be 0, becauselibjemalloc
must be onLD_PRELOAD
, which is not how GDK is configured by default. So, no reports would be produced on OSX, but the code shouldn't break. - On GCK, this aspect is already configured similar to production, so you will be able to see real file sizes.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #362900 (closed)
Edited by Aleksei Lipniagov