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,747
    • Issues 36,747
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 1,499
    • Merge Requests 1,499
  • 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
  • Merge requests
  • !26586

You need to sign in or sign up before continuing.
Merged
Created Mar 05, 2020 by Bob Van Landuyt@reprazentMaintainer6 of 6 tasks completed6/6 tasks

Add a separate logger for Sidekiq clients

  • Overview 20
  • Commits 2
  • Pipelines 12
  • Changes 7

What does this MR do?

On omnibus instances running regular sidekiq (not sidekiq cluster) these messages come in the same file. So this is no change to the end user. Who can view this file in the admin interface.

This also adds a Gitlab::SidkiqLogging::ClientLogger, will allow Sidekiq client, in our case Rails, can also emit log messages related to sidekiq jobs.

Instead of having these messages printed to STDOUT (which results in production.log), this changes the Sidekiq.logger to a separate writing to log/sidekiq_client.log. This allows us to ingest these messages in the same index as the messages the Sidekiq process emits. Having them in the same index allows us to gather statistics about jobs that haven't been processed.

The logger will follow the structure configured for sidekiq in gitlab.rb, so when json logging is enabled, the messages would look like this:

{"severity":"INFO","time":"2020-03-05T15:45:01.349Z","message":"hello world"}

Otherwise, we'll be writing that message like this:

I, [2020-03-05T17:16:58.541421 #15874]  INFO -- : hello world

Both messages were written from a rails console (a Sidekiq client). The messages emitted from sidekiq-server remain the same and go to their STDOUT.

This is part of gitlab-com/gl-infra/scalability#200 (closed) which is needed for gitlab-com/gl-infra/scalability#42 (closed) and already used in !26399 (merged)

The sidekiq.log is currently not ingested by ES, as we get the sidekiq logs directly from the sidekiq-cluster STDOUT, so this wouldn't change anything for GitLab.com.

Does this MR meet the acceptance criteria?

Conformity

  • [-] Changelog entry
  • Documentation (if required)
  • Code review guidelines
  • Merge request performance guidelines
  • Style guides
  • [-] Database guides
  • Separation of EE specific content

Availability and Testing

  • Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process.
  • [-] Tested in all supported browsers
  • [-] Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Edited Mar 06, 2020 by Bob Van Landuyt
Assignee
Assign to
Reviewer
Request review from
12.9
Milestone
12.9 (Past due)
Assign milestone
Time tracking
Source branch: bvl-sidekiq-logger-structured