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
2 changes: 2 additions & 0 deletions sdk/monitor/azure-monitor-opentelemetry/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
## 1.8.8 (Unreleased)

### Features Added
- Set `AZURE_MONITOR_DISTRO_VERSION` environment variable to pass distro version to the exporter
([#46666](https://github.com/Azure/azure-sdk-for-python/pull/46666))

### Breaking Changes

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# --------------------------------------------------------------------------

from azure.monitor.opentelemetry.exporter._constants import ( # pylint: disable=import-error,no-name-in-module
Comment thread
rads-1996 marked this conversation as resolved.
_AZURE_MONITOR_DISTRO_VERSION,
_AZURE_MONITOR_DISTRO_VERSION_ARG,
)

Comment thread
rads-1996 marked this conversation as resolved.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
from azure.monitor.opentelemetry._constants import (
_AZURE_APP_SERVICE_RESOURCE_DETECTOR_NAME,
_AZURE_VM_RESOURCE_DETECTOR_NAME,
_AZURE_MONITOR_DISTRO_VERSION,
_FULLY_SUPPORTED_INSTRUMENTED_LIBRARIES,
_PREVIEW_INSTRUMENTED_LIBRARIES,
BROWSER_SDK_LOADER_CONFIG_ARG,
Expand Down Expand Up @@ -92,6 +93,7 @@ def _get_configurations(**kwargs) -> Dict[str, ConfigurationValue]:
for key, val in kwargs.items():
configurations[key] = val
configurations[DISTRO_VERSION_ARG] = VERSION
environ[_AZURE_MONITOR_DISTRO_VERSION] = VERSION
Comment thread
rads-1996 marked this conversation as resolved.

_default_disable_logging(configurations)
_default_disable_metrics(configurations)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -804,6 +804,12 @@ def test_get_configurations_env_vars_parentbased_trace_id_ratio_non_numeric_valu
self.assertEqual(configurations["sampling_arg"], 1.0)
self.assertEqual(configurations["sampler_type"], "parentbased_trace_id_ratio")

@patch.dict("os.environ", {}, clear=True)
@patch("opentelemetry.sdk.resources.Resource.create", return_value=TEST_DEFAULT_RESOURCE)
def test_get_configurations_sets_distro_version_env_var(self, resource_create_mock):
_get_configurations()
self.assertEqual(environ.get("AZURE_MONITOR_DISTRO_VERSION"), VERSION)

Comment thread
rads-1996 marked this conversation as resolved.
@patch.dict(
"os.environ",
{
Expand Down
Loading