From 7bddbb54195be4004275c83ef2592b362e443dc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Em=C3=ADdio=20Neto?= <9735060+emdneto@users.noreply.github.com> Date: Wed, 29 May 2024 14:17:50 -0300 Subject: [PATCH] fix: remove dependency on sdk for system-metrics instrumentation (#2557) --- .../pyproject.toml | 1 - .../opentelemetry/instrumentation/system_metrics/__init__.py | 5 ++--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/instrumentation/opentelemetry-instrumentation-system-metrics/pyproject.toml b/instrumentation/opentelemetry-instrumentation-system-metrics/pyproject.toml index fe60ca1251..aa2d8083ec 100644 --- a/instrumentation/opentelemetry-instrumentation-system-metrics/pyproject.toml +++ b/instrumentation/opentelemetry-instrumentation-system-metrics/pyproject.toml @@ -26,7 +26,6 @@ classifiers = [ dependencies = [ "opentelemetry-instrumentation == 0.46b0.dev", "opentelemetry-api ~= 1.11", - "opentelemetry-sdk ~= 1.11", "psutil ~= 5.9", ] diff --git a/instrumentation/opentelemetry-instrumentation-system-metrics/src/opentelemetry/instrumentation/system_metrics/__init__.py b/instrumentation/opentelemetry-instrumentation-system-metrics/src/opentelemetry/instrumentation/system_metrics/__init__.py index 74d4f6a431..6342d287d5 100644 --- a/instrumentation/opentelemetry-instrumentation-system-metrics/src/opentelemetry/instrumentation/system_metrics/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-system-metrics/src/opentelemetry/instrumentation/system_metrics/__init__.py @@ -91,7 +91,6 @@ from opentelemetry.instrumentation.system_metrics.package import _instruments from opentelemetry.instrumentation.system_metrics.version import __version__ from opentelemetry.metrics import CallbackOptions, Observation, get_meter -from opentelemetry.sdk.util import get_dict_as_key _logger = logging.getLogger(__name__) @@ -638,8 +637,8 @@ def _get_system_network_connections( net_connection, metric ) - connection_counters_key = get_dict_as_key( - self._system_network_connections_labels + connection_counters_key = tuple( + sorted(self._system_network_connections_labels.items()) ) if connection_counters_key in connection_counters: