Skip to content

Add class to migration worker and record logs

Terri Chu requested to merge tchu-add-class-to-migration-worker into master

What does this MR do and why?

Adds class to structured logging for Elastic::MigrationWorker and Elastic::MigrationRecord

Screenshots or screen recordings

N/A

How to set up and validate locally

  1. tail the elasticsearch.log - tail -f <gdk_dir>/gitlab/log/elasticsearch.log
  2. run the migration_worker_spec.rb - bundle exec rspec ee/spec/workers/elastic/migration_worker_spec.rb
  3. verify in the log that the class field is set for all log entries

example

{"severity":"INFO","time":"2023-03-09T21:25:16.614Z","correlation_id":"c3016c58da3e3c78bc7363850610a303","class":"Elastic::MigrationWorker","message":"MigrationWorker: migration[ApplyMaxAnalyzedOffset] updating with completed: false","job_status":"running","queue":"default","jid":null}

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Terri Chu

Merge request reports

Loading