Skip to content

GitLab Next

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
GitLab
GitLab
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 36,749
    • Issues 36,749
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 1,495
    • Merge Requests 1,495
  • Requirements
    • Requirements
    • List
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Operations
    • Operations
    • Metrics
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI/CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GitLab.org
  • GitLabGitLab
  • Issues
  • #32906

Closed
Open
Created Sep 27, 2019 by Kamil Trzciński@ayufan🔴Maintainer0 of 3 tasks completed0/3 tasks

Exception logging

Description of the proposal

I made this MR: !17819 (merged) that adds exceptions_json.log that persists all exceptions that are requested by developer via usage of Gitlab::Sentry:.

This was added to solve a problem of manual exception logging done in number of places of the codebase:

  1. app/services/clusters/applications/base_helm_service.rb:27,
  2. lib/gitlab/bitbucket_import/importer.rb:47,
  3. lib/gitlab/bitbucket_server_import/importer.rb:167,
  4. etc.

The proposal would be to disallow all manual exception logging, and require to only use Gitlab::Sentry.track_exception* variants. This would send exception to Sentry (if configured), and log to json file (always).

Having a structured logging actually allows the persistence of exception be useful as:

  1. we always clean backtrace,
  2. we always include correlation id,
  3. we can include some user details,
  4. later we could include information about execution context, like currently running sidekiq job.

I still wonder about the ability to have a RuboCop to prevent that, but I have no idea yet. Maybe discovering what is being executed in rescue block, idk.

  • Mention the proposal in the next backend weekly call and the #backend channel to encourage contribution
  • Proceed with the proposal once 50% of the maintainers have weighed in, and 80% of the votes are 👍
  • Once approved, mention it again in the next backend weekly call and the #backend channel

/cc @gitlab-org/maintainers/rails-backend

Edited Sep 27, 2019 by Kamil Trzciński
Assignee
Assign to
12.6
Milestone
12.6 (Past due)
Assign milestone
Time tracking
None
Due date
None