Skip to content
Snippets Groups Projects
  1. Feb 19, 2020
  2. Feb 15, 2020
  3. Jan 24, 2020
  4. Jan 13, 2020
  5. Dec 22, 2019
  6. Dec 17, 2019
  7. Dec 11, 2019
  8. Nov 22, 2019
  9. Nov 18, 2019
  10. Oct 17, 2019
  11. Aug 09, 2019
    • Stan Hu's avatar
      Add Gitaly and Rugged call timing in Sidekiq logs · a74396dc
      Stan Hu authored
      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.
      a74396dc
  12. Jul 18, 2019
  13. Jul 12, 2019
  14. Apr 18, 2019
  15. Mar 27, 2019
  16. Feb 12, 2019
    • Stan Hu's avatar
      Log queue duration in production_json.log · 51ca7922
      Stan Hu authored
      `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.
      51ca7922
  17. Dec 06, 2018
  18. Sep 05, 2018
  19. Jun 06, 2018
  20. Apr 23, 2018
  21. Mar 20, 2018
  22. Feb 28, 2018
  23. Sep 19, 2017
  24. Jul 28, 2017
    • Stan Hu's avatar
      Add remote IP, user ID and username to JSON lograge output · 9bc176b2
      Stan Hu authored
      This makes the logs a bit more useful to search requests by users.
      9bc176b2
    • Stan Hu's avatar
      Fix lograge exclusion in params section · 3a200165
      Stan Hu authored
      Without this fix, we would just see redundant entries in the `params` section:
      
      ```
      {"method":"GET","path":"/-/metrics","format":"html","controller":"MetricsController","action":"index","status":404,"duration":1.42,"view":0.38,"db":0.0,"time":"2017-07-28T02:59:18.167Z","params":{"controller":"metrics","action":"index"}}
      ```
      
      The intended format looks more like this:
      
      ```
      {"method":"GET","path":"/-/metrics","format":"html","controller":"MetricsController","action":"index","status":404,"duration":76.32,"view":69.95,"db":0.0,"time":"2017-07-28T02:59:48.893Z","params":{}}
      ```
      
      The proper form to exclude an array is to preface with an asterisk:
      https://apidock.com/rails/Hash/except
      3a200165
  25. Jul 20, 2017
  26. Jul 18, 2017
    • Stan Hu's avatar
      Add structured logging for Rails processes · e2b1c16a
      Stan Hu authored
      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
      e2b1c16a
Loading