Commit 4cbd0af6 authored by Dylan Griffith's avatar Dylan Griffith

Merge branch 'craigf/fix-logging-schema-inconsistency-kubernetes' into 'master'

Fix a log schema inconsistency (kubernetes/namespace)

See merge request gitlab-org/gitlab!25436
parents 39bad8e8 b2efd2c1
......@@ -35,12 +35,14 @@ module Gitlab
def log_create_failed(error)
logger.error({
exception: error.class.name,
exception: {
class: error.class.name,
message: error.message
},
status_code: error.error_code,
namespace: name,
class_name: self.class.name,
event: :failed_to_create_namespace,
message: error.message
event: :failed_to_create_namespace
})
end
......
......@@ -92,12 +92,14 @@ describe Gitlab::Kubernetes::Namespace do
it 'logs the error' do
expect(subject.send(:logger)).to receive(:error).with(
hash_including(
exception: 'Kubeclient::HttpError',
exception: {
class: 'Kubeclient::HttpError',
message: 'system failure'
},
status_code: 500,
namespace: 'a_namespace',
class_name: 'Gitlab::Kubernetes::Namespace',
event: :failed_to_create_namespace,
message: 'system failure'
event: :failed_to_create_namespace
)
)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment