Telemetry Guide
Overview
NIXL’s telemetry system collects performance metrics and transfer events for monitoring and debugging. Telemetry is disabled by default and must be enabled via environment variables or agent configuration.
The system supports two consumption patterns:
- Shared memory cyclic buffer — Events are written to a memory-mapped file and read by a separate telemetry reader process. This is the default exporter when
NIXL_TELEMETRY_DIRis set. - Prometheus exporter — Events are aggregated and exposed as Prometheus-compatible metrics on an HTTP endpoint.
Only one telemetry exporter plug-in can be loaded per NIXL agent instance.
Architecture
The telemetry system consists of three layers:
-
Telemetry Collection — Built into the core library, intercepts agent operations (memory registration, transfers, metadata exchange) and generates events with microsecond-precision timestamps.
-
Event Buffer — A cyclic (ring) buffer stores events. Buffer size is configurable via
NIXL_TELEMETRY_BUFFER_SIZE(default: 4096 events). When the buffer is full, the oldest events are overwritten silently — the current design allows telemetry loss under high event rates. -
Exporter Plugins — Flush events from the buffer to an external consumer at configurable intervals. The built-in shared memory buffer exporter uses a memory-mapped file that can be read by external telemetry reader applications. The Prometheus exporter aggregates events into metrics exposed on an HTTP endpoint.
The shared memory buffer exporter must be statically linked (built-in module). Other exporters such as the Prometheus exporter are loaded as dynamic plug-ins.
Event Structure
Each telemetry event contains four fields:
Timestamps are recorded after the operation completes, not when it starts. Event categories are not a separate on-wire field. To limit exported metrics, use NIXL_TELEMETRY_ENABLED_METRICS with a comma-separated fnmatch allowlist of event names.
Event Types
The telemetry system defines eight event categories:
Some telemetry categories have no predefined events yet and exist for extensibility. Backend plug-ins can define custom events within any category.
Metrics
The following table lists all built-in telemetry metrics and events generated by NIXL:
The shared memory buffer exporter stores raw per-event data without aggregation. Each event is recorded individually, preserving the full time-series for offline analysis.
Enabling Telemetry
Telemetry is controlled by environment variables set before agent initialization:
For the complete list of telemetry-related environment variables including Prometheus settings, see the Environment Variables page.
NIXL_TELEMETRY_ENABLE accepts y, yes, on, true, enable, or 1 (case-insensitive). Any other value or absence disables telemetry.
Behavior rules:
- If telemetry is disabled via the environment but enabled programmatically (
capture_telemetryin agent config), telemetry is captured internally but not exported. This may incur a performance penalty. - If telemetry is enabled but no exporter is set and
NIXL_TELEMETRY_DIRis unset, no telemetry file is generated andNIXL_TELEMETRY_RUN_INTERVALis unused. - If telemetry is enabled and
NIXL_TELEMETRY_DIRis set, the shared memory buffer exporter writes events to a file in that directory.
Telemetry API
getXferTelemetry (C++)
Retrieve per-transfer telemetry for a completed transfer request. Requires captureTelemetry = true in nixlAgentConfig.
The returned nixl_xfer_telem_t structure contains:
startTime— Timestamp when the transfer was initiatedpostDuration— Time from start to posting to the backendxferDuration— Total transfer time from start to completiontotalBytes— Total bytes transferreddescCount— Number of descriptors in the transfer
For the complete C++ API reference including transfer and telemetry methods, see the C++ API Reference.
get_xfer_telemetry (Python)
Python equivalent of the C++ method. Requires capture_telemetry=True in nixl_agent_config.
The returned object has the same fields as the C++ version: startTime, postDuration, xferDuration, totalBytes, and descCount.
For the complete Python API reference including transfer and telemetry methods, see the Python API Reference.
addTelemetryEvent / getTelemetryEvents (Backend API)
These methods are available on the backend engine base class (nixlBackendEngine) and are used by backend plug-in authors to emit custom telemetry events:
addTelemetryEvent(event_name, value)— Add a custom event to the telemetry buffergetTelemetryEvents()— Retrieve recorded events from a backend
These are internal to the backend plug-in interface.
Telemetry Reader
NIXL provides telemetry reader utilities in both C++ and Python for consuming events from the shared memory cyclic buffer. Below are short snippets showing the core reading loop.
For a complete implementation, see examples/python/telemetry_reader.py.
Running the readers:
Example output:
Prometheus Integration
NIXL includes an experimental Prometheus-compatible telemetry exporter that aggregates events into metrics and exposes them on an HTTP endpoint.
Setup
To enable Prometheus export, set the following environment variables:
Scraping Metrics
Once the exporter is running, configure your Prometheus instance to scrape the NIXL metrics endpoint:
You can verify the endpoint is serving metrics:
The Prometheus exporter is experimental (beta). It is suitable for development and testing but may change in future releases.
Custom Telemetry Plug-ins
NIXL supports custom telemetry exporter plug-ins that implement the telemetry export interface. A custom plug-in consumes events from the cyclic buffer and routes them to any monitoring backend — CSV files, dashboards, or cloud monitoring services.