Registry /
observability / nv-one-logger-training-telemetry
Install & Compatibility
Where this runs
tested against v2.3.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 29.2MB
glibcpy 3.10–3.920 runs
installs and imports cleanly · install 3.6s · import 0.000s · 29MB
27MB installed
● package 27MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
TelemetryClient
✓ import nv_one_logger
✗ from nv_one_logger import TelemetryClient
This quickstart demonstrates how to initialize `TelemetryClient` with a `TelemetryConfig` and log common training data such as hyperparameters, metrics over steps, and artifact paths. It includes example environment variable usage for configurability and handles potential connection errors for backend services.
from nvtelemetry.client import TelemetryClient
from nvtelemetry.config import TelemetryConfig
from datetime import datetime
import os
# Example configuration (adjust as needed for actual usage)
# In a real environment, project and run_id might be set via environment variables
# or a more complex configuration management system.
# Using os.environ.get for dynamic values, falling back to defaults for example
project_name = os.environ.get("ONE_LOGGER_PROJECT_NAME", "my_ml_project_example")
run_id = os.environ.get("ONE_LOGGER_RUN_ID", f"run_{datetime.now().strftime('%Y%m%d%H%M%S')}")
config = TelemetryConfig(
project=project_name,
model="my_model_v1",
run_id=run_id,
framework="pytorch",
framework_version="1.13.1",
container_image="nvcr.io/nvidia/pytorch:23.05-py3",
tags={
"experiment": "initial_test",
"dataset": "cifar10"
},
mlflow_tracking_uri=os.environ.get("ONE_LOGGER_MLFLOW_TRACKING_URI", "") # Example for MLflow backend
)
try:
# Initialize the client. This will connect to the configured backend (if any).
with TelemetryClient(config=config) as client:
print(f"Telemetry client initialized for project '{config.project}', run: {config.run_id}")
# Log hyperparameters
client.log_hyperparameters(learning_rate=0.001, batch_size=32, epochs=10)
print("Logged hyperparameters.")
# Log metrics over steps/epochs
for epoch in range(3):
train_loss = 0.5 - epoch * 0.05
val_loss = 0.6 - epoch * 0.08
accuracy = 0.7 + epoch * 0.03
client.log_metrics(step=epoch, train_loss=train_loss, val_loss=val_loss, accuracy=accuracy)
print(f"Logged metrics for epoch {epoch}: train_loss={train_loss:.3f}, val_loss={val_loss:.3f}, accuracy={accuracy:.3f}")
# Log an artifact path (this just records the path, not the artifact itself)
client.log_artifact_path("model_checkpoint", "/path/to/my_model_checkpoint.pt")
print("Logged artifact path.")
# Log a final message
client.log_message("Training run completed successfully.")
print("Logged completion message.")
except Exception as e:
print(f"An error occurred during telemetry logging: {e}")
print("Note: In a real environment, TelemetryClient might require specific endpoint configuration or environment variables (e.g., ONE_LOGGER_MLFLOW_TRACKING_URI, ONE_LOGGER_NEMO_SERVICE_URL) to connect to a telemetry backend like MLflow or NVIDIA NeMo Service. This example primarily demonstrates the API usage, and may not send data to a remote service without proper setup.")
Upgrade
Version history
2.3.1latest on PyPI · released Oct 29, 2025
Audit
Dependencies
one-loggerrequiredCore dependency for logging infrastructure and backend integration.
pydanticrequiredUsed for data validation and settings management, specifically for TelemetryConfig.
nv-context-taggerrequiredUsed for adding context tags to telemetry events.
protobufrequiredUsed for data serialization of telemetry messages.