From 732df5e7968e8c7165cb06397b4b7c74f9c7e0c4 Mon Sep 17 00:00:00 2001 From: Leighton Date: Thu, 18 Jun 2020 13:34:29 -0700 Subject: [PATCH 1/3] remove dependency metrics --- azure_monitor/CHANGELOG.md | 3 +++ .../src/azure_monitor/sdk/auto_collection/__init__.py | 3 --- azure_monitor/tests/auto_collection/test_auto_collection.py | 6 ------ 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/azure_monitor/CHANGELOG.md b/azure_monitor/CHANGELOG.md index 7534ca4..2c0131e 100644 --- a/azure_monitor/CHANGELOG.md +++ b/azure_monitor/CHANGELOG.md @@ -2,6 +2,9 @@ ## Unreleased +- Remove dependency metrics from auto-collection +- ([#92](https://github.com/microsoft/opentelemetry-azure-monitor-python/pull/92)) + ## 0.3b.1 Released 2020-05-21 diff --git a/azure_monitor/src/azure_monitor/sdk/auto_collection/__init__.py b/azure_monitor/src/azure_monitor/sdk/auto_collection/__init__.py index 6c4d05e..4c33a14 100644 --- a/azure_monitor/src/azure_monitor/sdk/auto_collection/__init__.py +++ b/azure_monitor/src/azure_monitor/sdk/auto_collection/__init__.py @@ -44,7 +44,4 @@ def __init__( ): col_type = AutoCollectionType.STANDARD_METRICS self._performance_metrics = PerformanceMetrics(meter, labels, col_type) - self._dependency_metrics = DependencyMetrics( - meter, labels, span_processor - ) self._request_metrics = RequestMetrics(meter, labels, span_processor) diff --git a/azure_monitor/tests/auto_collection/test_auto_collection.py b/azure_monitor/tests/auto_collection/test_auto_collection.py index 25c1c81..e853598 100644 --- a/azure_monitor/tests/auto_collection/test_auto_collection.py +++ b/azure_monitor/tests/auto_collection/test_auto_collection.py @@ -29,9 +29,6 @@ def tearDownClass(cls): @mock.patch( "azure_monitor.sdk.auto_collection.PerformanceMetrics", autospec=True ) - @mock.patch( - "azure_monitor.sdk.auto_collection.DependencyMetrics", autospec=True - ) @mock.patch( "azure_monitor.sdk.auto_collection.RequestMetrics", autospec=True ) @@ -46,11 +43,8 @@ def test_constructor( span_processor=self._span_processor, ) self.assertEqual(mock_performance.called, True) - self.assertEqual(mock_dependencies.called, True) self.assertEqual(mock_requests.called, True) self.assertEqual(mock_performance.call_args[0][0], self._meter) self.assertEqual(mock_performance.call_args[0][1], self._test_labels) - self.assertEqual(mock_dependencies.call_args[0][0], self._meter) - self.assertEqual(mock_dependencies.call_args[0][1], self._test_labels) self.assertEqual(mock_requests.call_args[0][0], self._meter) self.assertEqual(mock_requests.call_args[0][1], self._test_labels) From 24f8a591dc513589bde79b3472cc7b6005769c38 Mon Sep 17 00:00:00 2001 From: Leighton Date: Thu, 18 Jun 2020 13:51:35 -0700 Subject: [PATCH 2/3] fix test --- azure_monitor/tests/auto_collection/test_auto_collection.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure_monitor/tests/auto_collection/test_auto_collection.py b/azure_monitor/tests/auto_collection/test_auto_collection.py index e853598..d9bc07e 100644 --- a/azure_monitor/tests/auto_collection/test_auto_collection.py +++ b/azure_monitor/tests/auto_collection/test_auto_collection.py @@ -33,7 +33,7 @@ def tearDownClass(cls): "azure_monitor.sdk.auto_collection.RequestMetrics", autospec=True ) def test_constructor( - self, mock_performance, mock_dependencies, mock_requests + self, mock_requests, mock_performance ): """Test the constructor.""" From 039fc584732ed52e9667ea4417e10e864b82ddf9 Mon Sep 17 00:00:00 2001 From: Leighton Date: Thu, 18 Jun 2020 13:54:46 -0700 Subject: [PATCH 3/3] lint --- azure_monitor/tests/auto_collection/test_auto_collection.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/azure_monitor/tests/auto_collection/test_auto_collection.py b/azure_monitor/tests/auto_collection/test_auto_collection.py index d9bc07e..40c2f8d 100644 --- a/azure_monitor/tests/auto_collection/test_auto_collection.py +++ b/azure_monitor/tests/auto_collection/test_auto_collection.py @@ -32,9 +32,7 @@ def tearDownClass(cls): @mock.patch( "azure_monitor.sdk.auto_collection.RequestMetrics", autospec=True ) - def test_constructor( - self, mock_requests, mock_performance - ): + def test_constructor(self, mock_requests, mock_performance): """Test the constructor.""" AutoCollection(