diff --git a/opentelemetry-sdk/src/opentelemetry/sdk/metrics/__init__.py b/opentelemetry-sdk/src/opentelemetry/sdk/metrics/__init__.py index fcb7e6207e5..bb495bc1be3 100644 --- a/opentelemetry-sdk/src/opentelemetry/sdk/metrics/__init__.py +++ b/opentelemetry-sdk/src/opentelemetry/sdk/metrics/__init__.py @@ -298,7 +298,7 @@ def get_label_set(self, labels: Dict[str, str]): # Use simple encoding for now until encoding API is implemented encoded = tuple(sorted(labels.items())) # If LabelSet exists for this meter in memory, use existing one - if not encoded in self.labels: + if encoded not in self.labels: self.labels[encoded] = LabelSet(labels=labels) return self.labels[encoded]