Skip to main content
This guide walks you through installing the OneX Observability SDK, enabling instrumentation for a model, and validating that signals reach your collector.

Prerequisites

  • Python 3.8+
  • pip for installing packages
  • Access to the OneX ingestion endpoint (or a Test environment)

Installation

pip install onex-sdk[pytorch]
Extras are available if you use TensorFlow or JAX:
pip install onex-sdk[tensorflow]
pip install onex-sdk[jax]
pip install onex-sdk[all]  # every framework
Note: Always review the package metadata on PyPI to confirm the latest published version and release notes.

Minimal instrumentation

from onex import OneXMonitor

monitor = OneXMonitor(
    api_key="your-api-key",  # Fetch from https://dashboard.observability.getonex.ai
    endpoint="onex-ingestion-endpoint",  # See "Environment tagging" below
    config={
        "hidden_state_sample_tokens": 8,
        "capture_full_hidden_state": False,
    },
    # Optional: sample_rate=0.1 for 10% of requests; max_requests_per_minute=120 to cap throughput
)

model = monitor.watch(model)
Call your model as usual; the SDK will auto-detect the framework, attach hooks, and stream signals asynchronously.

Environment tagging

The OneX Observability platform supports multiple environments (e.g. sandbox, development, production). Logs and signals are tagged and stored per environment, and which environment receives your data depends on the endpoint you pass to OneXMonitor. Each environment has its own ingestion endpoint in the OneX Observability Dashboard. Use the endpoint for the environment where you want your logs to appear for example, use the development endpoint when running locally, and the production endpoint in production. Signals posted to a given endpoint are associated with that environment in the platform.

Verifying signals

From the platform perspective (OneX Observability Dashboard at https://dashboard.observability.getonex.ai):
  1. Run a forward pass through your instrumented model so the SDK sends signals.
  2. Confirm the API host for your environment receives traffic. The host is determined by the endpoint you passed to OneXMonitor each environment (sandbox, development, production) has its own ingestion URL in the dashboard.
  3. In the dashboard (or your environment’s ingestion base URL), check the batch route (e.g. /api/signals/batch) to verify that signals are posted successfully and appear in your project logs.
To see SDK activity in your terminal (framework detection, signal export, etc.), enable logging when creating the monitor:
monitor = OneXMonitor(
    api_key="your-api-key",
    endpoint="onex-ingestion-endpoint",
    enable_logging=True,  # or config={"enable_logging": True}
    config={...},
)