summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorKamil Trzciński <ayufan@ayufan.eu>2018-12-06 20:49:31 +0100
committerKamil Trzciński <ayufan@ayufan.eu>2018-12-06 20:49:31 +0100
commit3560b11922fd180eea5cafd0e763e0e601c5c4ee (patch)
tree6d9c0c285ec80bf983f750937d9c888bfa0283b0 /lib
parent39c1731a53d1014eab7c876d70632b1abf738712 (diff)
downloadgitlab-ce-3560b11922fd180eea5cafd0e763e0e601c5c4ee.tar.gz
Prefer to use correlation-id in logs
This changes `correlation_id` to be `correlation-id` when passed via jobs
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/correlation_id.rb2
-rw-r--r--lib/gitlab/gitaly_client.rb2
-rw-r--r--lib/gitlab/sentry.rb2
3 files changed, 3 insertions, 3 deletions
diff --git a/lib/gitlab/correlation_id.rb b/lib/gitlab/correlation_id.rb
index 0f9bde4390e..8431d88f8eb 100644
--- a/lib/gitlab/correlation_id.rb
+++ b/lib/gitlab/correlation_id.rb
@@ -2,7 +2,7 @@
module Gitlab
module CorrelationId
- LOG_KEY = 'correlation_id'.freeze
+ LOG_KEY = 'correlation-id'.freeze
class << self
def use_id(correlation_id, &blk)
diff --git a/lib/gitlab/gitaly_client.rb b/lib/gitlab/gitaly_client.rb
index 255601382b1..158f7d47bd2 100644
--- a/lib/gitlab/gitaly_client.rb
+++ b/lib/gitlab/gitaly_client.rb
@@ -193,7 +193,7 @@ module Gitlab
feature = feature_stack && feature_stack[0]
metadata['call_site'] = feature.to_s if feature
metadata['gitaly-servers'] = address_metadata(remote_storage) if remote_storage
- metadata['correlation_id'] = Gitlab::CorrelationId.current_id if Gitlab::CorrelationId.current_id
+ metadata[Gitlab::CorrelationId::LOG_KEY] = Gitlab::CorrelationId.current_id if Gitlab::CorrelationId.current_id
metadata.merge!(server_feature_flags)
diff --git a/lib/gitlab/sentry.rb b/lib/gitlab/sentry.rb
index 46d01964eac..3d82934f268 100644
--- a/lib/gitlab/sentry.rb
+++ b/lib/gitlab/sentry.rb
@@ -45,7 +45,7 @@ module Gitlab
context # Make sure we've set everything we know in the context
tags = {
- Gitlab::CorrelationId::LOG_KEY.to_sym => Gitlab::CorrelationId.current_id
+ correlation_id: Gitlab::CorrelationId.current_id
}
Raven.capture_exception(exception, tags: tags, extra: extra)