From 34c5df8ad00803fcfbe1eb505df4d0656e06d341 Mon Sep 17 00:00:00 2001 From: jerevoss Date: Wed, 5 Jun 2024 15:38:13 -0700 Subject: [PATCH 1/3] Distro release 1.6.0 --- sdk/monitor/azure-monitor-opentelemetry/CHANGELOG.md | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/sdk/monitor/azure-monitor-opentelemetry/CHANGELOG.md b/sdk/monitor/azure-monitor-opentelemetry/CHANGELOG.md index 0939ae37990f..efc33b59f5d3 100644 --- a/sdk/monitor/azure-monitor-opentelemetry/CHANGELOG.md +++ b/sdk/monitor/azure-monitor-opentelemetry/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 1.6.0 (Unreleased) +## 1.6.0 (2024-06-05) ### Features Added @@ -9,12 +9,6 @@ - Rework autoinstrumentation: Configure exporters and samplers directly ([#35890](https://github.com/Azure/azure-sdk-for-python/pull/35890)) -### Breaking Changes - -### Bugs Fixed - -### Other Changes - ## 1.5.0 (2024-05-31) ### Features Added From 600df78f3e9062114f2af766cde3dc9ac09afdca Mon Sep 17 00:00:00 2001 From: jerevoss Date: Wed, 5 Jun 2024 16:37:30 -0700 Subject: [PATCH 2/3] Fix exporter entry point names --- .../opentelemetry/_autoinstrumentation/configurator.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sdk/monitor/azure-monitor-opentelemetry/azure/monitor/opentelemetry/_autoinstrumentation/configurator.py b/sdk/monitor/azure-monitor-opentelemetry/azure/monitor/opentelemetry/_autoinstrumentation/configurator.py index cbbd23f58c57..a7ce562d9169 100644 --- a/sdk/monitor/azure-monitor-opentelemetry/azure/monitor/opentelemetry/_autoinstrumentation/configurator.py +++ b/sdk/monitor/azure-monitor-opentelemetry/azure/monitor/opentelemetry/_autoinstrumentation/configurator.py @@ -40,16 +40,16 @@ def _configure(self, **kwargs): warn(_PREVIEW_ENTRY_POINT_WARNING) try: if environ.get(OTEL_TRACES_EXPORTER, "").lower().strip() != "none": - kwargs.setdefault(TRACE_EXPORTER_NAMES_ARG, ["azure-monitor-opentelemetry-exporter"]) + kwargs.setdefault(TRACE_EXPORTER_NAMES_ARG, ["azure_monitor_opentelemetry_exporter"]) try: sample_rate = float(environ.get("OTEL_TRACES_SAMPLER_ARG", 1.0)) except ValueError: sample_rate = 1.0 kwargs.setdefault(SAMPLER_ARG, ApplicationInsightsSampler(sample_rate)) if environ.get(OTEL_METRICS_EXPORTER, "").lower().strip() != "none": - kwargs.setdefault(METRIC_EXPORTER_NAMES_ARG, ["azure-monitor-opentelemetry-exporter"]) + kwargs.setdefault(METRIC_EXPORTER_NAMES_ARG, ["azure_monitor_opentelemetry_exporter"]) if environ.get(OTEL_LOGS_EXPORTER, "").lower().strip() != "none": - kwargs.setdefault(LOG_EXPORTER_NAMES_ARG, ["azure-monitor-opentelemetry-exporter"]) + kwargs.setdefault(LOG_EXPORTER_NAMES_ARG, ["azure_monitor_opentelemetry_exporter"]) # As of OTel SDK 1.25.0, exporters passed as kwargs will be added to those specified in env vars. super()._configure(**kwargs) AzureStatusLogger.log_status(True) From 46861dcfe69b624602d77b2458e8a685bf150fb3 Mon Sep 17 00:00:00 2001 From: jerevoss Date: Thu, 6 Jun 2024 11:47:27 -0700 Subject: [PATCH 3/3] Tests --- .../azure-monitor-opentelemetry/CHANGELOG.md | 2 +- .../autoinstrumentation/test_configurator.py | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/sdk/monitor/azure-monitor-opentelemetry/CHANGELOG.md b/sdk/monitor/azure-monitor-opentelemetry/CHANGELOG.md index efc33b59f5d3..265957fe6cbe 100644 --- a/sdk/monitor/azure-monitor-opentelemetry/CHANGELOG.md +++ b/sdk/monitor/azure-monitor-opentelemetry/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 1.6.0 (2024-06-05) +## 1.6.0 (2024-06-06) ### Features Added diff --git a/sdk/monitor/azure-monitor-opentelemetry/tests/autoinstrumentation/test_configurator.py b/sdk/monitor/azure-monitor-opentelemetry/tests/autoinstrumentation/test_configurator.py index 2eb027fc62d0..d492e290e986 100644 --- a/sdk/monitor/azure-monitor-opentelemetry/tests/autoinstrumentation/test_configurator.py +++ b/sdk/monitor/azure-monitor-opentelemetry/tests/autoinstrumentation/test_configurator.py @@ -29,9 +29,9 @@ def test_configure(self, mock_diagnostics, attach_mock, sampler_mock, super_mock sampler_mock.assert_called_once_with(1.0) super_mock()._configure.assert_called_once_with( auto_instrumentation_version="TEST_VERSION", - trace_exporter_names=["azure-monitor-opentelemetry-exporter"], - metric_exporter_names=["azure-monitor-opentelemetry-exporter"], - log_exporter_names=["azure-monitor-opentelemetry-exporter"], + trace_exporter_names=["azure_monitor_opentelemetry_exporter"], + metric_exporter_names=["azure_monitor_opentelemetry_exporter"], + log_exporter_names=["azure_monitor_opentelemetry_exporter"], sampler="TEST_SAMPLER", ) mock_diagnostics.info.assert_called_once_with( @@ -56,9 +56,9 @@ def test_configure_sampler_arg(self, mock_diagnostics, attach_mock, sampler_mock sampler_mock.assert_called_once_with(0.5) super_mock()._configure.assert_called_once_with( auto_instrumentation_version="TEST_VERSION", - trace_exporter_names=["azure-monitor-opentelemetry-exporter"], - metric_exporter_names=["azure-monitor-opentelemetry-exporter"], - log_exporter_names=["azure-monitor-opentelemetry-exporter"], + trace_exporter_names=["azure_monitor_opentelemetry_exporter"], + metric_exporter_names=["azure_monitor_opentelemetry_exporter"], + log_exporter_names=["azure_monitor_opentelemetry_exporter"], sampler="TEST_SAMPLER", ) mock_diagnostics.info.assert_called_once_with( @@ -80,9 +80,9 @@ def test_configure_preview(self, mock_diagnostics, attach_mock, sampler_mock, su configurator._configure() sampler_mock.assert_called_once_with(1.0) super_mock()._configure.assert_called_once_with( - trace_exporter_names=["azure-monitor-opentelemetry-exporter"], - metric_exporter_names=["azure-monitor-opentelemetry-exporter"], - log_exporter_names=["azure-monitor-opentelemetry-exporter"], + trace_exporter_names=["azure_monitor_opentelemetry_exporter"], + metric_exporter_names=["azure_monitor_opentelemetry_exporter"], + log_exporter_names=["azure_monitor_opentelemetry_exporter"], sampler="TEST_SAMPLER", ) mock_diagnostics.info.assert_called_once_with(