From 726130ff68c9e386cfac3f31d80355c1ee991f07 Mon Sep 17 00:00:00 2001 From: Peter Giacomo Lombardo Date: Tue, 18 Aug 2020 07:48:17 +0000 Subject: [PATCH] PyMongo: Fix key lookup --- instana/instrumentation/pymongo.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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