summaryrefslogtreecommitdiff
path: root/config/initializers/lograge.rb
Commit message (Collapse)AuthorAgeFilesLines
* Add Gitaly and Rugged call timing in Sidekiq logsStan Hu2019-08-091-13/+1
| | | | | | | | | | This will help identify Sidekiq jobs that invoke excessive number of filesystem access. The timing data is stored in `RequestStore`, but this is only active within the middleware and is not directly accessible to the Sidekiq logger. However, it is possible for the middleware to modify the job hash to pass this data along to the logger.
* Add Rugged calls and duration to API and Rails logsStan Hu2019-07-181-0/+7
| | | | | | | | This adds `rugged_duration_ms` and `rugged_calls` fields to `api_json.log` and `production_json.log`. This will make it easier to identify performance issues caused by excessive I/O. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/64676
* Upgrade to Rails 5.2upgrade-rails-5-2-ceHeinrich Lee Yu2019-07-121-1/+1
| | | | Updates changed method names and fixes spec failures
* Migrate correlation and tracing code to LabKitan-use-labkitAndrew Newdigate2019-04-181-1/+1
| | | | | | | | | | | | | | | This change is a fairly straightforward refactor to extract the tracing and correlation-id code from the gitlab rails codebase into the new LabKit-Ruby project. The corresponding import into LabKit-Ruby was in https://gitlab.com/gitlab-org/labkit-ruby/merge_requests/1 The code itself remains very similar for now. Extracting it allows us to reuse it in other projects, such as Gitaly-Ruby. This will give us the advantages of correlation-ids and distributed tracing in that project too.
* Log Gitaly RPC duration to api_json.log and production_json.logStan Hu2019-03-271-1/+6
| | | | | | | This makes it easier to debug Gitaly performance issues in the field. This commit also makes the tracking of query time thread-safe via RequestStore.
* Log queue duration in production_json.logStan Hu2019-02-121-1/+2
| | | | | | | | `queue_duration` is a useful metric that is currently in api_json.log but not in production_json.log. We should add it because it tells us how long the request sat in Workhorse before Unicorn processed it. Having this field enables the support team to better troubleshoot when delays began to happen.
* Log and pass correlation-id between Unicorn, Sidekiq and GitalyKamil Trzciński2018-12-061-0/+1
| | | | | | | | The Correlation ID is taken or generated from received X-Request-ID. Then it is being passed to all executed services (sidekiq workers or gitaly calls). The Correlation ID is logged in all structured logs as `correlation_id`.
* Add User-Agent to production_json.logStan Hu2018-09-051-1/+2
| | | | | This will help production gain more visibility which browsers may be having issues.
* Log response body to production_json.log when a controller responds with a ↵Stan Hu2018-06-061-0/+1
| | | | | | | | | | 422 status We have a number of import errors occurring with 422 errors, and it's hard to determine why they are happening. This change will surface the errors in the log lines. Relates to #47365
* Bump lograge to 0.10.0 and remove monkey patchStan Hu2018-04-231-18/+0
| | | | | | lograge 0.10.0 contains the `Location` query string fix in https://github.com/roidrage/lograge/pull/241 among other minor changes: https://github.com/roidrage/lograge/blob/master/CHANGELOG.md
* Strip any query string parameters from Location headers from logrageStan Hu2018-03-201-0/+18
| | | | Port of https://github.com/roidrage/lograge/pull/241
* Fix for open-ended parameter's in lograge causing elastic memory issuesAndrew Newdigate2018-02-281-1/+6
|
* Detect n+1 issues involving GitalyAndrew Newdigate2017-09-191-1/+6
|
* Add remote IP, user ID and username to JSON lograge outputsh-augment-lograge-outputStan Hu2017-07-281-1/+4
| | | | This makes the logs a bit more useful to search requests by users.
* Standardize on ISO8601 UTC time for logragesh-lograge-iso6801-timeStan Hu2017-07-201-1/+1
|
* Add structured logging for Rails processessh-structured-loggingStan Hu2017-07-181-0/+21
This introduces JSON logging for Rails views saved to a file called `development_json.log`, `production_json.log`, etc. For example, instead of this unparsable log: ``` Started GET "/" for 127.0.0.1 at 2012-03-10 14:28:14 +0100 Processing by HomeController#index as HTML Rendered text template within layouts/application (0.0ms) Rendered layouts/_assets.html.erb (2.0ms) Rendered layouts/_top.html.erb (2.6ms) Rendered layouts/_about.html.erb (0.3ms) Rendered layouts/_google_analytics.html.erb (0.4ms) Completed 200 OK in 79ms (Views: 78.8ms | ActiveRecord: 0.0ms) ``` We get a single line with this: ``` {"method":"GET","path":"/,"format":"html","controller":"HomeController","action":"index","status":200,"duration":79,"view":78.8,"db":0.0,"location":"http://localhost/","time":"2017-07-18 09:35:17 -0700"} ``` Part of #20060