Skip to content

Commit 5846980

Browse files
wip
1 parent 83daac8 commit 5846980

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

lib/mongo/tracing/open_telemetry/command_tracer.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,11 @@ def maybe_trace_error(result, span)
192192
return if result.successful?
193193

194194
span.set_attribute('db.response.status_code', result.error.code.to_s)
195+
begin
196+
result.validate!
197+
rescue Mongo::Error::OperationFailure => e
198+
span.record_exception(e)
199+
end
195200
end
196201

197202
# Generates a summary string for the query.

spec/runners/unified/assertions.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ def assert_type(object, type, msg = nil)
312312
ok = [*type].reduce(false) { |acc, x| acc || type_matches?(object, x) }
313313

314314
unless ok
315-
raise Error::ResultMismatch, (msg || '') + " Object '#{object}' is not of type #{type}"
315+
raise Error::ResultMismatch, (msg || '') + ": \"Object '#{object.inspect}' is not of type #{type}\""
316316
end
317317
end
318318

spec/spec_tests/open_telemetry_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
warn "Skipping OpenTelemetry unified spec test: #{filename}"
2222
end
2323

24-
describe 'CSOT unified spec tests' do
24+
describe 'OTel unified spec tests' do
2525
if [ 1, '1', 'yes', 'true' ].include?(ENV['OTEL_SPEC_TESTS'])
2626
define_unified_spec_tests(base, TESTS_TO_RUN)
2727
else

0 commit comments

Comments
 (0)