Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix unit in system metrics #2922

Merged
merged 2 commits into from
Oct 25, 2024
Merged
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 CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
([#2874](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2874))
- `opentelemetry-instrumentation-confluent-kafka` Fix to allow `topic` to be extracted from `kwargs` in `produce()`
([#2901])(https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2901)
- `opentelemetry-instrumentation-system-metrics` Update metric units to conform to UCUM conventions.
([#2922](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2922))

### Breaking changes

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ def _instrument(self, **kwargs):
name="system.cpu.time",
callbacks=[self._get_system_cpu_time],
description="System CPU time",
unit="seconds",
unit="s",
)

if "system.cpu.utilization" in self._config:
Expand All @@ -206,7 +206,7 @@ def _instrument(self, **kwargs):
name="system.memory.usage",
callbacks=[self._get_system_memory_usage],
description="System memory usage",
unit="bytes",
unit="By",
)

if "system.memory.utilization" in self._config:
Expand Down Expand Up @@ -257,7 +257,7 @@ def _instrument(self, **kwargs):
name="system.disk.io",
callbacks=[self._get_system_disk_io],
description="System disk IO",
unit="bytes",
unit="By",
)

if "system.disk.operations" in self._config:
Expand All @@ -273,7 +273,7 @@ def _instrument(self, **kwargs):
name="system.disk.time",
callbacks=[self._get_system_disk_time],
description="System disk time",
unit="seconds",
unit="s",
)

# TODO Add _get_system_filesystem_usage
Expand All @@ -282,7 +282,7 @@ def _instrument(self, **kwargs):
# callback=self._get_system_filesystem_usage,
# name="system.filesystem.usage",
# description="System filesystem usage",
# unit="bytes",
# unit="By",
# value_type=int,
# )

Expand Down Expand Up @@ -327,7 +327,7 @@ def _instrument(self, **kwargs):
name="system.network.io",
callbacks=[self._get_system_network_io],
description="System network io",
unit="bytes",
unit="By",
)

if "system.network.connections" in self._config:
Expand All @@ -350,15 +350,15 @@ def _instrument(self, **kwargs):
name=f"process.runtime.{self._python_implementation}.memory",
callbacks=[self._get_runtime_memory],
description=f"Runtime {self._python_implementation} memory",
unit="bytes",
unit="By",
)

if "process.runtime.cpu.time" in self._config:
self._meter.create_observable_counter(
name=f"process.runtime.{self._python_implementation}.cpu_time",
callbacks=[self._get_runtime_cpu_time],
description=f"Runtime {self._python_implementation} CPU time",
unit="seconds",
unit="s",
)

if "process.runtime.gc_count" in self._config:
Expand All @@ -371,7 +371,7 @@ def _instrument(self, **kwargs):
name=f"process.runtime.{self._python_implementation}.gc_count",
callbacks=[self._get_runtime_gc_count],
description=f"Runtime {self._python_implementation} GC count",
unit="bytes",
unit="By",
)

if "process.runtime.thread_count" in self._config:
Expand Down