Skip to content

Commit ef3bb11

Browse files
committed
Add database name to span name
1 parent 620e8b5 commit ef3bb11

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def started(self, event: monitoring.CommandStartedEvent):
121121
):
122122
return
123123
command = event.command.get(event.command_name, "")
124-
name = event.command_name
124+
name = f"{event.database_name}.{event.command_name}" if event.database_name else event.command_name
125125
statement = event.command_name
126126
if command:
127127
statement += " " + str(command)

0 commit comments

Comments
 (0)