diff --git a/instana/instrumentation/pymongo.py b/instana/instrumentation/pymongo.py index 6c2ada3f..a3747bae 100644 --- a/instana/instrumentation/pymongo.py +++ b/instana/instrumentation/pymongo.py @@ -24,7 +24,7 @@ def started(self, event): self._collect_command_tags(scope.span, event) # include collection name into the namespace if provided - if event.command.has_key(event.command_name): + if event.command_name in event.command: scope.span.set_tag("collection", event.command.get(event.command_name)) self.__active_commands[event.request_id] = scope @@ -61,7 +61,7 @@ def _collect_command_tags(self, span, event): span.set_tag("command", cmd) for key in ["filter", "query"]: - if event.command.has_key(key): + if key in event.command: span.set_tag("filter", json_util.dumps(event.command.get(key))) break