diff --git a/exporter/opentelemetry-exporter-prometheus/src/opentelemetry/exporter/prometheus/__init__.py b/exporter/opentelemetry-exporter-prometheus/src/opentelemetry/exporter/prometheus/__init__.py index 6ff56be0243..26d0a3930aa 100644 --- a/exporter/opentelemetry-exporter-prometheus/src/opentelemetry/exporter/prometheus/__init__.py +++ b/exporter/opentelemetry-exporter-prometheus/src/opentelemetry/exporter/prometheus/__init__.py @@ -351,6 +351,6 @@ def _create_info_metric( self, name: str, description: str, attributes: Dict[str, str] ) -> InfoMetricFamily: """Create an Info Metric Family with list of attributes""" - i = InfoMetricFamily(name, description, labels=attributes) - i.add_metric(labels=list(attributes.keys()), value=attributes) - return i + info = InfoMetricFamily(name, description, labels=attributes) + info.add_metric(labels=list(attributes.keys()), value=attributes) + return info diff --git a/exporter/opentelemetry-exporter-prometheus/tests/test_prometheus_exporter.py b/exporter/opentelemetry-exporter-prometheus/tests/test_prometheus_exporter.py index 0d047a3f514..c7ce1afae19 100644 --- a/exporter/opentelemetry-exporter-prometheus/tests/test_prometheus_exporter.py +++ b/exporter/opentelemetry-exporter-prometheus/tests/test_prometheus_exporter.py @@ -334,9 +334,9 @@ def test_target_info_disabled(self): result = list(metric_reader._collector.collect()) for prometheus_metric in result: - self.assertNotEquals(type(prometheus_metric), InfoMetricFamily) - self.assertNotEquals(prometheus_metric.name, "target") - self.assertNotEquals( + self.assertNotEqual(type(prometheus_metric), InfoMetricFamily) + self.assertNotEqual(prometheus_metric.name, "target") + self.assertNotEqual( prometheus_metric.documentation, "Target metadata" ) self.assertNotIn("os", prometheus_metric.samples[0].labels)