Skip to content

Commit

Permalink
Merge pull request #2469 from DataDog/zarir/error_message
Browse files Browse the repository at this point in the history
Changes `error.msg` to `error.message` for UNC
  • Loading branch information
TonyCTHsu committed Dec 6, 2022
2 parents f27e708 + 2bc4095 commit b23c1d5
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion lib/datadog/tracing/metadata/ext.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ module Distributed
# @public_api
module Errors
STATUS = 1
TAG_MSG = 'error.msg'
TAG_MSG = 'error.message'
TAG_STACK = 'error.stack'
TAG_TYPE = 'error.type'
end
Expand Down
10 changes: 5 additions & 5 deletions spec/datadog/tracing/contrib/grape/tracer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@
expect(spans[0].status).to eq(1)
expect(spans[0].get_tag('error.stack')).to_not be_nil
expect(spans[0].get_tag('error.type')).to_not be_nil
expect(spans[0].get_tag('error.msg')).to_not be_nil
expect(spans[0].get_tag('error.message')).to_not be_nil
expect(spans[0].get_tag(Datadog::Tracing::Metadata::Ext::TAG_COMPONENT)).to eq('grape')
expect(spans[0].get_tag(Datadog::Tracing::Metadata::Ext::TAG_OPERATION))
.to eq('endpoint_run')
Expand All @@ -284,7 +284,7 @@
expect(spans[0].status).to eq(1)
expect(spans[0].get_tag('error.stack')).to_not be_nil
expect(spans[0].get_tag('error.type')).to_not be_nil
expect(spans[0].get_tag('error.msg')).to_not be_nil
expect(spans[0].get_tag('error.message')).to_not be_nil
expect(spans[0].get_tag(Datadog::Tracing::Metadata::Ext::TAG_COMPONENT)).to eq('grape')
expect(spans[0].get_tag(Datadog::Tracing::Metadata::Ext::TAG_OPERATION))
.to eq('endpoint_run')
Expand All @@ -303,7 +303,7 @@
expect(spans[0].status).to eq(1)
expect(spans[0].get_tag('error.stack')).to_not be_nil
expect(spans[0].get_tag('error.type')).to_not be_nil
expect(spans[0].get_tag('error.msg')).to_not be_nil
expect(spans[0].get_tag('error.message')).to_not be_nil
expect(spans[0].get_tag(Datadog::Tracing::Metadata::Ext::TAG_COMPONENT)).to eq('grape')
expect(spans[0].get_tag(Datadog::Tracing::Metadata::Ext::TAG_OPERATION))
.to eq('endpoint_run')
Expand All @@ -322,7 +322,7 @@
expect(spans[0]).to_not have_error
expect(spans[0].get_tag('error.stack')).to be_nil
expect(spans[0].get_tag('error.type')).to be_nil
expect(spans[0].get_tag('error.msg')).to be_nil
expect(spans[0].get_tag('error.message')).to be_nil
expect(spans[0].get_tag(Datadog::Tracing::Metadata::Ext::TAG_COMPONENT)).to eq('grape')
expect(spans[0].get_tag(Datadog::Tracing::Metadata::Ext::TAG_OPERATION))
.to eq('endpoint_run')
Expand All @@ -341,7 +341,7 @@
expect(spans[0].status).to eq(0)
expect(spans[0].get_tag('error.stack')).to be_nil
expect(spans[0].get_tag('error.type')).to be_nil
expect(spans[0].get_tag('error.msg')).to be_nil
expect(spans[0].get_tag('error.message')).to be_nil
expect(spans[0].get_tag(Datadog::Tracing::Metadata::Ext::TAG_COMPONENT)).to eq('grape')
expect(spans[0].get_tag(Datadog::Tracing::Metadata::Ext::TAG_OPERATION))
.to eq('endpoint_run')
Expand Down
4 changes: 2 additions & 2 deletions spec/datadog/tracing/contrib/http/request_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
expect(span.get_tag('span.kind')).to eq('client')
expect(span.status).to eq(1)
expect(span.get_tag('error.type')).to eq('Net::HTTPNotFound')
expect(span.get_tag('error.msg')).to be nil
expect(span.get_tag('error.message')).to be nil
end

it_behaves_like 'a peer service span' do
Expand Down Expand Up @@ -136,7 +136,7 @@
expect(response.code).to eq('404')
expect(span.status).to eq(1)
expect(span.get_tag('error.type')).to eq('Net::HTTPNotFound')
expect(span.get_tag('error.msg')).to eq(body)
expect(span.get_tag('error.message')).to eq(body)
end
end
end
Expand Down
6 changes: 3 additions & 3 deletions spec/datadog/tracing/contrib/mongodb/client_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ def quantized?(object, options = {})
end
expect(span.get_tag('mongodb.rows')).to be nil
expect(span.status).to eq(1)
expect(span.get_tag('error.msg')).to eq('ns not found (26)')
expect(span.get_tag('error.message')).to eq('ns not found (26)')
end

context 'that triggers #failed before #started' do
Expand Down Expand Up @@ -536,15 +536,15 @@ def quantized?(object, options = {})
expect(insert_span.resource).to match(/"operation"\s*=>\s*:insert/)
expect(insert_span.status).to eq(1)
expect(insert_span.get_tag('error.type')).to eq('Mongo::Monitoring::Event::CommandFailed')
expect(insert_span.get_tag('error.msg')).to match(/.*is not authorized to access.*/)
expect(insert_span.get_tag('error.message')).to match(/.*is not authorized to access.*/)
expect(insert_span.get_tag('db.system')).to eq('mongodb')
end

expect(auth_span.name).to eq('mongo.cmd')
expect(auth_span.resource).to match(/"operation"\s*=>\s*[:"]saslStart/)
expect(auth_span.status).to eq(1)
expect(auth_span.get_tag('error.type')).to eq('Mongo::Monitoring::Event::CommandFailed')
expect(auth_span.get_tag('error.msg')).to eq('Unsupported mechanism PLAIN (2)')
expect(auth_span.get_tag('error.message')).to eq('Unsupported mechanism PLAIN (2)')
expect(auth_span.get_tag('db.system')).to eq('mongodb')
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/datadog/tracing/contrib/mysql2/patcher_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
expect(span.status).to eq(1)
expect(span.get_tag('span.kind')).to eq('client')
expect(span.get_tag('db.system')).to eq('mysql')
expect(span.get_tag('error.msg'))
expect(span.get_tag('error.message'))
.to eq("Unknown column 'INVALID' in 'field list'")
end

Expand Down
4 changes: 2 additions & 2 deletions spec/datadog/tracing/contrib/rack/integration_test_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@
expect(span.get_tag('http.url')).to eq('/exception/')
expect(span.get_tag('http.base_url')).to eq('http://example.org')
expect(span.get_tag('error.type')).to eq('StandardError')
expect(span.get_tag('error.msg')).to eq('Unable to process the request')
expect(span.get_tag('error.message')).to eq('Unable to process the request')
expect(span.get_tag('error.stack')).to_not be nil
expect(span.status).to eq(1)
expect(span).to be_root_span
Expand Down Expand Up @@ -490,7 +490,7 @@
expect(span.get_tag('http.url')).to eq('/exception/')
expect(span.get_tag('http.base_url')).to eq('http://example.org')
expect(span.get_tag('error.type')).to eq('NoMemoryError')
expect(span.get_tag('error.msg')).to eq('Non-standard error')
expect(span.get_tag('error.message')).to eq('Non-standard error')
expect(span.get_tag('error.stack')).to_not be nil
expect(span.status).to eq(1)
expect(span).to be_root_span
Expand Down
4 changes: 2 additions & 2 deletions spec/datadog/tracing/contrib/rails/cache_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@
expect(span.get_tag('rails.cache.backend').to_s).to eq('file_store')
expect(span.get_tag('rails.cache.key')).to eq('exception')
expect(span.get_tag('error.type')).to eq('RuntimeError')
expect(span.get_tag('error.msg')).to eq('oops')
expect(span.get_tag('error.message')).to eq('oops')

expect(span.get_tag(Datadog::Tracing::Metadata::Ext::TAG_COMPONENT))
.to eq('active_support')
Expand Down Expand Up @@ -349,7 +349,7 @@
expect(span.get_tag('rails.cache.backend').to_s).to eq('file_store')
expect(span.get_tag('rails.cache.keys')).to eq('["exception", "another", "one"]')
expect(span.get_tag('error.type')).to eq('RuntimeError')
expect(span.get_tag('error.msg')).to eq('oops')
expect(span.get_tag('error.message')).to eq('oops')

expect(span.get_tag(Datadog::Tracing::Metadata::Ext::TAG_COMPONENT))
.to eq('active_support')
Expand Down
8 changes: 4 additions & 4 deletions spec/datadog/tracing/contrib/rails/middleware_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def call(env)
expect(span.get_tag('http.method')).to eq('GET')
expect(span.get_tag('http.status_code')).to eq('500')
expect(span.get_tag('error.type')).to eq('NotImplementedError')
expect(span.get_tag('error.msg')).to eq('NotImplementedError')
expect(span.get_tag('error.message')).to eq('NotImplementedError')
expect(span).to have_error
expect(span.get_tag('error.stack')).to_not be nil
end
Expand Down Expand Up @@ -205,7 +205,7 @@ def call(env)
expect(span.get_tag('http.status_code')).to eq('404')

expect(span.get_tag('error.type')).to be nil
expect(span.get_tag('error.msg')).to be nil
expect(span.get_tag('error.message')).to be nil
expect(span).to_not have_error
expect(span.get_tag('error.stack')).to be nil
end
Expand Down Expand Up @@ -266,7 +266,7 @@ def call(env)
expect(span.get_tag('http.method')).to eq('GET')
expect(span.get_tag('http.status_code')).to eq('500')
expect(span.get_tag('error.type')).to eq('CustomError')
expect(span.get_tag('error.msg')).to eq('Custom error message!')
expect(span.get_tag('error.message')).to eq('Custom error message!')
expect(span).to have_error
expect(span.get_tag('error.stack')).to_not be nil
end
Expand Down Expand Up @@ -312,7 +312,7 @@ def call(env)
expect(span.get_tag('http.method')).to eq('GET')
expect(span.get_tag('http.status_code')).to eq('404')
expect(span.get_tag('error.type')).to be nil
expect(span.get_tag('error.msg')).to be nil
expect(span.get_tag('error.message')).to be nil
expect(span).to_not have_error
expect(span.get_tag('error.stack')).to be nil
end
Expand Down
2 changes: 1 addition & 1 deletion spec/datadog/tracing/contrib/redis/shared_examples.rb
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@

end
expect(span.status).to eq(1)
expect(span.get_tag('error.msg')).to match(/ERR unknown command/)
expect(span.get_tag('error.message')).to match(/ERR unknown command/)
expect(span.get_tag('error.type')).to match(/CommandError/)
expect(span.get_tag('error.stack').length).to be >= 3
end
Expand Down

0 comments on commit b23c1d5

Please sign in to comment.