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 CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
([#4139](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4139))

### Fixed
- `opentelemetry-instrumentation-system-metrics`: Rename deprecated `system.disk.time` metric to `system.disk.operation.time` per updated semantic conventions.
([#4248](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4248))
- `opentelemetry-instrumentation-mysql`: Refactor MySQL integration test mocks to use concrete DBAPI connection attributes, reducing noisy attribute type warnings.
([#4116](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4116))
- `opentelemetry-instrumentation-cassandra`: Use `_instruments_any` instead of `_instruments` for driver dependencies so that having either `cassandra-driver` or `scylla-driver` installed is sufficient
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"system.swap.utilization": ["used", "free"],
"system.disk.io": ["read", "write"],
"system.disk.operations": ["read", "write"],
"system.disk.time": ["read", "write"],
"system.disk.operation.time": ["read", "write"],
"system.network.dropped.packets": ["transmit", "receive"],
"system.network.packets": ["transmit", "receive"],
"system.network.errors": ["transmit", "receive"],
Expand Down Expand Up @@ -131,7 +131,7 @@
"system.swap.utilization": ["used", "free"],
"system.disk.io": ["read", "write"],
"system.disk.operations": ["read", "write"],
"system.disk.time": ["read", "write"],
"system.disk.operation.time": ["read", "write"],
"system.network.dropped.packets": ["transmit", "receive"],
"system.network.packets": ["transmit", "receive"],
"system.network.errors": ["transmit", "receive"],
Expand Down Expand Up @@ -332,10 +332,9 @@ def _instrument(self, **kwargs: Any):
unit="operations",
)

# FIXME: this has been replaced by system.disk.operation.time
if "system.disk.time" in self._config:
if "system.disk.operation.time" in self._config:
self._meter.create_observable_counter(
name="system.disk.time",
name="system.disk.operation.time",
callbacks=[self._get_system_disk_time],
description="System disk time",
unit="s",
Expand Down Expand Up @@ -710,7 +709,7 @@ def _get_system_disk_time(
) -> Iterable[Observation]:
"""Observer callback for disk time"""
for device, counters in psutil.disk_io_counters(perdisk=True).items():
for metric in self._config["system.disk.time"]:
for metric in self._config["system.disk.operation.time"]:
if hasattr(counters, f"{metric}_time"):
self._system_disk_time_labels["device"] = device
self._system_disk_time_labels["direction"] = metric
Expand All @@ -728,7 +727,7 @@ def _get_system_disk_merged(
# operations or the value type should be Double

for device, counters in psutil.disk_io_counters(perdisk=True).items():
for metric in self._config["system.disk.time"]:
for metric in self._config["system.disk.operation.time"]:
if hasattr(counters, f"{metric}_merged_count"):
self._system_disk_merged_labels["device"] = device
self._system_disk_merged_labels["direction"] = metric
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def test_system_metrics_instrument(self):
"system.swap.utilization",
"system.disk.io",
"system.disk.operations",
"system.disk.time",
"system.disk.operation.time",
"system.network.dropped_packets",
"system.network.packets",
"system.network.errors",
Expand Down Expand Up @@ -511,7 +511,7 @@ def test_system_disk_operations(self, mock_disk_io_counters):
self._test_metrics("system.disk.operations", expected)

@mock.patch("psutil.disk_io_counters")
def test_system_disk_time(self, mock_disk_io_counters):
def test_system_disk_operation_time(self, mock_disk_io_counters):
DiskIO = namedtuple(
"DiskIO",
[
Expand Down Expand Up @@ -562,7 +562,7 @@ def test_system_disk_time(self, mock_disk_io_counters):
{"device": "sdb", "direction": "write"}, 14 / 1000
),
]
self._test_metrics("system.disk.time", expected)
self._test_metrics("system.disk.operation.time", expected)

@mock.patch("psutil.net_io_counters")
def test_system_network_dropped_packets(self, mock_net_io_counters):
Expand Down
Loading