Skip to content

Commit d4effae

Browse files
committed
use the errmsg as the status description instead of the _DocumentOut
1 parent 620abb5 commit d4effae

File tree

1 file changed

+1
-1
lines changed
  • instrumentation/opentelemetry-instrumentation-pymongo/src/opentelemetry/instrumentation/pymongo

1 file changed

+1
-1
lines changed

instrumentation/opentelemetry-instrumentation-pymongo/src/opentelemetry/instrumentation/pymongo/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ def failed(self, event: monitoring.CommandFailedEvent):
198198
if span is None:
199199
return
200200
if span.is_recording():
201-
span.set_status(Status(StatusCode.ERROR, event.failure))
201+
span.set_status(Status(StatusCode.ERROR, event.failure.get("errmsg", "Unknown error")))
202202
try:
203203
self.failed_hook(span, event)
204204
except (

0 commit comments

Comments
 (0)