Skip to content

Commit 3d6e0cd

Browse files
author
Peter Giacomo Lombardo
authored
PyMongo: Fix key lookup (#254)
1 parent 5dccc24 commit 3d6e0cd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

instana/instrumentation/pymongo.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def started(self, event):
2424
self._collect_command_tags(scope.span, event)
2525

2626
# include collection name into the namespace if provided
27-
if event.command.has_key(event.command_name):
27+
if event.command_name in event.command:
2828
scope.span.set_tag("collection", event.command.get(event.command_name))
2929

3030
self.__active_commands[event.request_id] = scope
@@ -61,7 +61,7 @@ def _collect_command_tags(self, span, event):
6161
span.set_tag("command", cmd)
6262

6363
for key in ["filter", "query"]:
64-
if event.command.has_key(key):
64+
if key in event.command:
6565
span.set_tag("filter", json_util.dumps(event.command.get(key)))
6666
break
6767

0 commit comments

Comments
 (0)