From 4ae3cffd2449a2db40d844fc1b0536667340ae68 Mon Sep 17 00:00:00 2001 From: Leighton Chen Date: Fri, 15 Apr 2022 11:52:21 -0700 Subject: [PATCH 1/5] sha --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 203deb8568..b7fdac5618 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -6,7 +6,7 @@ on: - 'release/*' pull_request: env: - CORE_REPO_SHA: f81381cf8aca64a707d934f20c6c27d40b949dce + CORE_REPO_SHA: 3cde5a97a1068a4436a999a9f84fc14667a06647 jobs: build: From eb7ee6d0a42e79b6e9ce308e11bf9895a8cc64e9 Mon Sep 17 00:00:00 2001 From: Leighton Chen Date: Fri, 15 Apr 2022 12:16:57 -0700 Subject: [PATCH 2/5] callbacks --- .../setup.cfg | 4 +-- .../system_metrics/__init__.py | 34 +++++++++---------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/instrumentation/opentelemetry-instrumentation-system-metrics/setup.cfg b/instrumentation/opentelemetry-instrumentation-system-metrics/setup.cfg index 84af307853..8d8e5fe4ce 100644 --- a/instrumentation/opentelemetry-instrumentation-system-metrics/setup.cfg +++ b/instrumentation/opentelemetry-instrumentation-system-metrics/setup.cfg @@ -40,8 +40,8 @@ package_dir= =src packages=find_namespace: install_requires = - opentelemetry-api ~= 1.10.0 - opentelemetry-sdk ~= 1.10.0 + opentelemetry-api == 1.10.0 + opentelemetry-sdk == 1.10.0 [options.extras_require] test = 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 3317b3fc65..8f2ef31c18 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 @@ -156,42 +156,42 @@ def _instrument(self, **kwargs): ) self._meter.create_observable_counter( - callback=self._get_system_cpu_time, + callbacks=[self._get_system_cpu_time], name="system.cpu.time", description="System CPU time", unit="seconds", ) self._meter.create_observable_gauge( - callback=self._get_system_cpu_utilization, + callbacks=[self._get_system_cpu_utilization], name="system.cpu.utilization", description="System CPU utilization", unit="1", ) self._meter.create_observable_gauge( - callback=self._get_system_memory_usage, + callbacks=[self._get_system_memory_usage], name="system.memory.usage", description="System memory usage", unit="bytes", ) self._meter.create_observable_gauge( - callback=self._get_system_memory_utilization, + callbacks=[self._get_system_memory_utilization], name="system.memory.utilization", description="System memory utilization", unit="1", ) self._meter.create_observable_gauge( - callback=self._get_system_swap_usage, + callbacks=[self._get_system_swap_usage], name="system.swap.usage", description="System swap usage", unit="pages", ) self._meter.create_observable_gauge( - callback=self._get_system_swap_utilization, + callbacks=[self._get_system_swap_utilization], name="system.swap.utilization", description="System swap utilization", unit="1", @@ -217,21 +217,21 @@ def _instrument(self, **kwargs): # ) self._meter.create_observable_counter( - callback=self._get_system_disk_io, + callbacks=[self._get_system_disk_io], name="system.disk.io", description="System disk IO", unit="bytes", ) self._meter.create_observable_counter( - callback=self._get_system_disk_operations, + callbacks=[self._get_system_disk_operations], name="system.disk.operations", description="System disk operations", unit="operations", ) self._meter.create_observable_counter( - callback=self._get_system_disk_time, + callbacks=[self._get_system_disk_time], name="system.disk.time", description="System disk time", unit="seconds", @@ -260,56 +260,56 @@ def _instrument(self, **kwargs): # OSs, how to do the same in Windows? self._meter.create_observable_counter( - callback=self._get_system_network_dropped_packets, + callbacks=[self._get_system_network_dropped_packets], name="system.network.dropped_packets", description="System network dropped_packets", unit="packets", ) self._meter.create_observable_counter( - callback=self._get_system_network_packets, + callbacks=[self._get_system_network_packets], name="system.network.packets", description="System network packets", unit="packets", ) self._meter.create_observable_counter( - callback=self._get_system_network_errors, + callbacks=[self._get_system_network_errors], name="system.network.errors", description="System network errors", unit="errors", ) self._meter.create_observable_counter( - callback=self._get_system_network_io, + callbacks=[self._get_system_network_io], name="system.network.io", description="System network io", unit="bytes", ) self._meter.create_observable_up_down_counter( - callback=self._get_system_network_connections, + callbacks=[self._get_system_network_connections], name="system.network.connections", description="System network connections", unit="connections", ) self._meter.create_observable_counter( - callback=self._get_runtime_memory, + callbacks=[self._get_runtime_memory], name=f"runtime.{self._python_implementation}.memory", description=f"Runtime {self._python_implementation} memory", unit="bytes", ) self._meter.create_observable_counter( - callback=self._get_runtime_cpu_time, + callbacks=[self._get_runtime_cpu_time], name=f"runtime.{self._python_implementation}.cpu_time", description=f"Runtime {self._python_implementation} CPU time", unit="seconds", ) self._meter.create_observable_counter( - callback=self._get_runtime_gc_count, + callbacks=[self._get_runtime_gc_count], name=f"runtime.{self._python_implementation}.gc_count", description=f"Runtime {self._python_implementation} GC count", unit="bytes", From e3a75bf342c0eec839f7f82c076b5be200495285 Mon Sep 17 00:00:00 2001 From: Leighton Chen Date: Fri, 15 Apr 2022 12:22:27 -0700 Subject: [PATCH 3/5] Update setup.cfg --- .../opentelemetry-instrumentation-system-metrics/setup.cfg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/instrumentation/opentelemetry-instrumentation-system-metrics/setup.cfg b/instrumentation/opentelemetry-instrumentation-system-metrics/setup.cfg index 8d8e5fe4ce..84af307853 100644 --- a/instrumentation/opentelemetry-instrumentation-system-metrics/setup.cfg +++ b/instrumentation/opentelemetry-instrumentation-system-metrics/setup.cfg @@ -40,8 +40,8 @@ package_dir= =src packages=find_namespace: install_requires = - opentelemetry-api == 1.10.0 - opentelemetry-sdk == 1.10.0 + opentelemetry-api ~= 1.10.0 + opentelemetry-sdk ~= 1.10.0 [options.extras_require] test = From 0f85b8e3626bdf0fc0a09e54d201725f63830594 Mon Sep 17 00:00:00 2001 From: Leighton Chen Date: Fri, 15 Apr 2022 12:55:13 -0700 Subject: [PATCH 4/5] callbacks --- .../system_metrics/__init__.py | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) 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 8f2ef31c18..7442089dbd 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 @@ -156,43 +156,43 @@ def _instrument(self, **kwargs): ) self._meter.create_observable_counter( - callbacks=[self._get_system_cpu_time], name="system.cpu.time", + callbacks=[self._get_system_cpu_time], description="System CPU time", unit="seconds", ) self._meter.create_observable_gauge( - callbacks=[self._get_system_cpu_utilization], name="system.cpu.utilization", + callbacks=[self._get_system_cpu_utilization], description="System CPU utilization", unit="1", ) self._meter.create_observable_gauge( - callbacks=[self._get_system_memory_usage], name="system.memory.usage", + callbacks=[self._get_system_memory_usage], description="System memory usage", unit="bytes", ) self._meter.create_observable_gauge( - callbacks=[self._get_system_memory_utilization], name="system.memory.utilization", + callbacks=[self._get_system_memory_utilization], description="System memory utilization", unit="1", ) self._meter.create_observable_gauge( - callbacks=[self._get_system_swap_usage], name="system.swap.usage", + callbacks=[self._get_system_swap_usage], description="System swap usage", unit="pages", ) self._meter.create_observable_gauge( - callbacks=[self._get_system_swap_utilization], name="system.swap.utilization", + callbacks=[self._get_system_swap_utilization], description="System swap utilization", unit="1", ) @@ -200,8 +200,8 @@ def _instrument(self, **kwargs): # TODO Add _get_system_swap_page_faults # self._meter.create_observable_counter( - # callback=self._get_system_swap_page_faults, # name="system.swap.page_faults", + # callbacks=[self._get_system_swap_page_faults], # description="System swap page faults", # unit="faults", # value_type=int, @@ -209,30 +209,30 @@ def _instrument(self, **kwargs): # TODO Add _get_system_swap_page_operations # self._meter.create_observable_counter( - # callback=self._get_system_swap_page_operations, # name="system.swap.page_operations", + # callbacks=self._get_system_swap_page_operations, # description="System swap page operations", # unit="operations", # value_type=int, # ) self._meter.create_observable_counter( - callbacks=[self._get_system_disk_io], name="system.disk.io", + callbacks=[self._get_system_disk_io], description="System disk IO", unit="bytes", ) self._meter.create_observable_counter( - callbacks=[self._get_system_disk_operations], name="system.disk.operations", + callbacks=[self._get_system_disk_operations], description="System disk operations", unit="operations", ) self._meter.create_observable_counter( - callbacks=[self._get_system_disk_time], name="system.disk.time", + callbacks=[self._get_system_disk_time], description="System disk time", unit="seconds", ) @@ -260,57 +260,57 @@ def _instrument(self, **kwargs): # OSs, how to do the same in Windows? self._meter.create_observable_counter( - callbacks=[self._get_system_network_dropped_packets], name="system.network.dropped_packets", + callbacks=[self._get_system_network_dropped_packets], description="System network dropped_packets", unit="packets", ) self._meter.create_observable_counter( - callbacks=[self._get_system_network_packets], name="system.network.packets", + callbacks=[self._get_system_network_packets], description="System network packets", unit="packets", ) self._meter.create_observable_counter( - callbacks=[self._get_system_network_errors], name="system.network.errors", + callbacks=[self._get_system_network_errors], description="System network errors", unit="errors", ) self._meter.create_observable_counter( - callbacks=[self._get_system_network_io], name="system.network.io", + callbacks=[self._get_system_network_io], description="System network io", unit="bytes", ) self._meter.create_observable_up_down_counter( - callbacks=[self._get_system_network_connections], name="system.network.connections", + callbacks=[self._get_system_network_connections], description="System network connections", unit="connections", ) self._meter.create_observable_counter( - callbacks=[self._get_runtime_memory], name=f"runtime.{self._python_implementation}.memory", + callbacks=[self._get_runtime_memory], description=f"Runtime {self._python_implementation} memory", unit="bytes", ) self._meter.create_observable_counter( - callbacks=[self._get_runtime_cpu_time], name=f"runtime.{self._python_implementation}.cpu_time", + callbacks=[self._get_runtime_cpu_time], description=f"Runtime {self._python_implementation} CPU time", unit="seconds", ) self._meter.create_observable_counter( - callbacks=[self._get_runtime_gc_count], name=f"runtime.{self._python_implementation}.gc_count", + callbacks=[self._get_runtime_gc_count], description=f"Runtime {self._python_implementation} GC count", unit="bytes", ) From 2ae36e53d581485c66158527880459f47ac8bf27 Mon Sep 17 00:00:00 2001 From: Leighton Chen Date: Fri, 15 Apr 2022 13:32:05 -0700 Subject: [PATCH 5/5] Update test.yml --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b7fdac5618..54ce8f74f5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -6,7 +6,7 @@ on: - 'release/*' pull_request: env: - CORE_REPO_SHA: 3cde5a97a1068a4436a999a9f84fc14667a06647 + CORE_REPO_SHA: d52b80124ac0c9ea9515a1d90dfec37c532f8cd9 jobs: build: