Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
### Breaking Changes

### Bugs Fixed
- The sdkversion should only show the exporter/distro version which emits the sdkstats. Removed the AZURE_MONITOR_DISTRO_VERSION variable
([#46963](https://github.com/Azure/azure-sdk-for-python/pull/46963))

### Other Changes

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
_APPLICATIONINSIGHTS_METRIC_NAMESPACE_OPT_IN = "APPLICATIONINSIGHTS_METRIC_NAMESPACE_OPT_IN"

# SDK version
_AZURE_MONITOR_DISTRO_VERSION = "AZURE_MONITOR_DISTRO_VERSION"
_MICROSOFT_OPENTELEMETRY_VERSION = "MICROSOFT_OPENTELEMETRY_VERSION"

_APPLICATIONINSIGHTS_METRICS_TO_LOGANALYTICS_ENABLED = "APPLICATIONINSIGHTS_METRICS_TO_LOGANALYTICS_ENABLED"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
from azure.monitor.opentelemetry.exporter._connection_string_parser import ConnectionStringParser
from azure.monitor.opentelemetry.exporter._constants import (
_AKS_ARM_NAMESPACE_ID,
_AZURE_MONITOR_DISTRO_VERSION,
_DEFAULT_AAD_SCOPE,
_FUNCTIONS_WORKER_RUNTIME,
_INSTRUMENTATIONS_BIT_MAP,
Expand Down Expand Up @@ -120,7 +119,6 @@ def _get_sdk_version_prefix():

def _get_sdk_version():
prefix = _get_sdk_version_prefix()
distro_version = environ.get(_AZURE_MONITOR_DISTRO_VERSION)
ms_otel_version = environ.get(_MICROSOFT_OPENTELEMETRY_VERSION)
if ms_otel_version:
return "{}py{}:otel{}:mot{}".format(
Expand All @@ -129,13 +127,6 @@ def _get_sdk_version():
opentelemetry_version,
ms_otel_version,
)
if distro_version:
return "{}py{}:otel{}:dst{}".format(
prefix,
platform.python_version(),
opentelemetry_version,
distro_version,
)
return "{}py{}:otel{}:ext{}".format(
prefix,
platform.python_version(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -808,7 +808,6 @@ def test_is_synthetic_source_test(self):
)
Comment thread
rads-1996 marked this conversation as resolved.
@patch.dict(
"azure.monitor.opentelemetry.exporter._utils.environ",
{},
clear=True,
)
def test_get_sdk_version_default(self, mock_python_version, mock_prefix):
Expand All @@ -829,12 +828,11 @@ def test_get_sdk_version_default(self, mock_python_version, mock_prefix):
)
@patch.dict(
"azure.monitor.opentelemetry.exporter._utils.environ",
{"AZURE_MONITOR_DISTRO_VERSION": "1.8.8"},
clear=True,
)
def test_get_sdk_version_distro(self, mock_python_version, mock_prefix):
result = _utils._get_sdk_version()
self.assertEqual(result, "uum_py3.11.0:otel1.20.0:dst1.8.8")
self.assertEqual(result, "uum_py3.11.0:otel1.20.0:ext{}".format(_utils.ext_version))

@patch(
"azure.monitor.opentelemetry.exporter._utils._get_sdk_version_prefix",
Expand Down Expand Up @@ -872,7 +870,6 @@ def test_get_sdk_version_microsoft_opentelemetry(self, mock_python_version, mock
@patch.dict(
"azure.monitor.opentelemetry.exporter._utils.environ",
{
"AZURE_MONITOR_DISTRO_VERSION": "1.8.8",
"MICROSOFT_OPENTELEMETRY_VERSION": "2.0.0",
},
clear=True,
Expand Down
Loading