Skip to content

Commit 8e5d8ef

Browse files
committed
Fix unit in system metrics
1 parent beed0aa commit 8e5d8ef

File tree

1 file changed

+8
-8
lines changed
  • instrumentation/opentelemetry-instrumentation-system-metrics/src/opentelemetry/instrumentation/system_metrics

1 file changed

+8
-8
lines changed

instrumentation/opentelemetry-instrumentation-system-metrics/src/opentelemetry/instrumentation/system_metrics/__init__.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ def _instrument(self, **kwargs):
190190
name="system.cpu.time",
191191
callbacks=[self._get_system_cpu_time],
192192
description="System CPU time",
193-
unit="seconds",
193+
unit="s",
194194
)
195195

196196
if "system.cpu.utilization" in self._config:
@@ -206,7 +206,7 @@ def _instrument(self, **kwargs):
206206
name="system.memory.usage",
207207
callbacks=[self._get_system_memory_usage],
208208
description="System memory usage",
209-
unit="bytes",
209+
unit="By",
210210
)
211211

212212
if "system.memory.utilization" in self._config:
@@ -257,7 +257,7 @@ def _instrument(self, **kwargs):
257257
name="system.disk.io",
258258
callbacks=[self._get_system_disk_io],
259259
description="System disk IO",
260-
unit="bytes",
260+
unit="By",
261261
)
262262

263263
if "system.disk.operations" in self._config:
@@ -273,7 +273,7 @@ def _instrument(self, **kwargs):
273273
name="system.disk.time",
274274
callbacks=[self._get_system_disk_time],
275275
description="System disk time",
276-
unit="seconds",
276+
unit="s",
277277
)
278278

279279
# TODO Add _get_system_filesystem_usage
@@ -282,7 +282,7 @@ def _instrument(self, **kwargs):
282282
# callback=self._get_system_filesystem_usage,
283283
# name="system.filesystem.usage",
284284
# description="System filesystem usage",
285-
# unit="bytes",
285+
# unit="By",
286286
# value_type=int,
287287
# )
288288

@@ -327,7 +327,7 @@ def _instrument(self, **kwargs):
327327
name="system.network.io",
328328
callbacks=[self._get_system_network_io],
329329
description="System network io",
330-
unit="bytes",
330+
unit="By",
331331
)
332332

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

356356
if "process.runtime.cpu.time" in self._config:
357357
self._meter.create_observable_counter(
358358
name=f"process.runtime.{self._python_implementation}.cpu_time",
359359
callbacks=[self._get_runtime_cpu_time],
360360
description=f"Runtime {self._python_implementation} CPU time",
361-
unit="seconds",
361+
unit="s",
362362
)
363363

364364
if "process.runtime.gc_count" in self._config:

0 commit comments

Comments
 (0)