> For the complete documentation index, see [llms.txt](https://docs.hypertensor.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hypertensor.org/copy-of-subnet-template/telemetry.md).

# Telemetry

Telemetry is a real-time stream of structured data emitted by peers to describe their internal activity, performance, and state. It enables external services to observe, monitor, and analyze system behavior without directly interacting with core logic.

Telemetry events are transmitted over a WebSocket connection, allowing consumers to subscribe to and process events such as network activity, state changes, and performance metrics as they occur.

## Usage:

```python
telemetry = Telemetry(
    url="ws://localhost:9000",
    subnet_id=1,
    subnet_node_id=10,
    peer_id=ID.from_base58("12D3Koo...")
)

async with trio.open_nursery() as nursery:
    telemetry.start(nursery)

    await telemetry.emit_async("node_started")
    await telemetry.emit_async("peer_connected", peer="12D3Koo...")
```

You can spin up and customize the Telemetry endpoint by cloning [https://github.com/hypertensor-blockchain/subnet-telemetry](https://github.com/hypertensor-blockchain/subnet-telemetryhttps://github.com/hypertensor-blockchain/subnet-telemetry). See the README.md for documentation on how to build and start the telemetry server.
