Kedro hook to trace system resources (Memory, CPU, Disk I/O, Network, Swap) during pipeline execution via pluggable sinks
Project description
kedro-psutil-telemetry
A Kedro hook that continuously samples system resources in a background thread during pipeline execution and dispatches metrics to pluggable sinks (console, MLflow, or your own).
Full documentation at saemeon.github.io/kedro-psutil-telemetry
Installation
pip install kedro-psutil-telemetry
With MLflow support:
pip install kedro-psutil-telemetry[mlflow]
Quick Start
Register the hook in your Kedro project's settings.py:
from kedro_psutil_telemetry import PipelinePsutilTelemetry
# Log to console (default)
HOOKS = (PipelinePsutilTelemetry(),)
from kedro_psutil_telemetry import PipelinePsutilTelemetry, mlflow_sink
# Log to an active MLflow run
HOOKS = (PipelinePsutilTelemetry(sink=mlflow_sink),)
Metrics
All metrics are tagged with the currently-running node name and use the configurable prefix (default: "pipeline").
| Metric | Description |
|---|---|
{prefix}.mem.rss_mb |
RSS memory of main process + children (MB) |
{prefix}.mem.swap_mb |
System swap usage (MB) |
{prefix}.cpu.percent |
System-wide CPU utilisation (%) |
{prefix}.io.read_mb |
Disk read since last sample (MB) |
{prefix}.io.write_mb |
Disk write since last sample (MB) |
{prefix}.net.sent_mbs |
Network bytes sent per second (MB/s) |
{prefix}.net.recv_mbs |
Network bytes received per second (MB/s) |
A peak-RSS and peak-CPU summary is logged at the end of every run.
Configuration
HOOKS = (
PipelinePsutilTelemetry(
sink=mlflow_sink, # or a list of sinks, or your own callable
interval=2.0, # sample every 2 seconds (default: 1.0)
prefix="pipeline", # metric name prefix (default: "pipeline")
include_children=True, # include child processes (default: True)
cpu=False, # disable a metric by passing False
net_sent=False,
disk_read="my.reads", # rename a metric by passing a string
),
)
Custom Sinks
Any callable matching (name: str, value: float, step: int, tags: dict | None) -> None works as a sink:
def my_sink(name, value, step, tags=None):
print(f"{name}={value:.2f} @ step {step} node={tags.get('node')}")
HOOKS = (PipelinePsutilTelemetry(sink=my_sink),)
Auto-discovery vs. manual registration
Installing the package registers PipelinePsutilTelemetry as a Kedro hook entry point so Kedro can discover it automatically with default settings. For any customisation (sink, interval, prefix, etc.) register the hook manually in settings.py as shown above — the entry point instantiates with defaults only.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file kedro_psutil_telemetry-0.0.1.tar.gz.
File metadata
- Download URL: kedro_psutil_telemetry-0.0.1.tar.gz
- Upload date:
- Size: 213.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bd3f41eaf349fb167590a8fa78738f65b5229cf7b5ae82f445ce6b672ce52c0d
|
|
| MD5 |
3aae83b5f532bd68fc68bcc5b5a57f7d
|
|
| BLAKE2b-256 |
cb043eaf72072b78d6db876f0fa212dbb0ac3162a835399de6d020ed994ea2dd
|
Provenance
The following attestation bundles were made for kedro_psutil_telemetry-0.0.1.tar.gz:
Publisher:
publish.yml on saemeon/kedro-psutil-telemetry
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kedro_psutil_telemetry-0.0.1.tar.gz -
Subject digest:
bd3f41eaf349fb167590a8fa78738f65b5229cf7b5ae82f445ce6b672ce52c0d - Sigstore transparency entry: 1149198463
- Sigstore integration time:
-
Permalink:
saemeon/kedro-psutil-telemetry@a05b81bb1334ed0455c730c496f7570b212f8482 -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/saemeon
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a05b81bb1334ed0455c730c496f7570b212f8482 -
Trigger Event:
release
-
Statement type:
File details
Details for the file kedro_psutil_telemetry-0.0.1-py3-none-any.whl.
File metadata
- Download URL: kedro_psutil_telemetry-0.0.1-py3-none-any.whl
- Upload date:
- Size: 8.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d2eefb2aea44164af7937782fd265dec85fce344f887b559568f16ee368a8e26
|
|
| MD5 |
6b760118546fe3b16fdb9549c2e92f70
|
|
| BLAKE2b-256 |
c3011bccf5ae278d28aaa4a68fbed4ee1dc4d4bc0df40dfe42db91e57d014854
|
Provenance
The following attestation bundles were made for kedro_psutil_telemetry-0.0.1-py3-none-any.whl:
Publisher:
publish.yml on saemeon/kedro-psutil-telemetry
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kedro_psutil_telemetry-0.0.1-py3-none-any.whl -
Subject digest:
d2eefb2aea44164af7937782fd265dec85fce344f887b559568f16ee368a8e26 - Sigstore transparency entry: 1149198766
- Sigstore integration time:
-
Permalink:
saemeon/kedro-psutil-telemetry@a05b81bb1334ed0455c730c496f7570b212f8482 -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/saemeon
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a05b81bb1334ed0455c730c496f7570b212f8482 -
Trigger Event:
release
-
Statement type: