Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
},
{
"group": "Net Diagnostics",
"pages": ["iroh-services/net-diagnostics"]
"pages": ["iroh-services/net-diagnostics/quickstart", "iroh-services/net-diagnostics/usage", "iroh-services/net-diagnostics/reports"]
}
]
}
Expand Down
Binary file added images/metrics-dashboard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/metrics-direct-data-rate.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/metrics-online-endpoints.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/metrics-relay.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/metrics-traffic-received.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/metrics-traffic-sent.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 7 additions & 5 deletions iroh-services/metrics/endpoint.mdx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
title: "Endpoint Metrics"
description: "Detailed metrics at the endpoint level for Pro and Enterprise plans"
description: "Detailed metrics at the endpoint level for Enterprise plans"
---

On the pro and enterprise plan, you can get more detailed
On the enterprise plan, you can get more detailed
metrics at the endpoint level. These metrics give you visibility into the behavior
of individual endpoints in your network. This can help you identify performance issues
or bottlenecks that may be affecting specific endpoints.
Expand All @@ -24,13 +24,15 @@ network is performing optimally, leading to a better overall experience for your

## Retention and Lookback

Projects on the Pro or Enterprise plans have access to
Projects on the Enterprise plan have access to
extended retention and lookback for endpoint-level metrics. This allows you to
analyze historical data and identify trends over time, which can be crucial for
long-term performance optimization and troubleshooting.

Please refer to the pricing page for more details on plan features
and benefits. [Contact us](mailto:support@iroh.computer) if you have any questions about upgrading your plan.
Please refer to the [pricing page](https://n0des.iroh.computer/pricing?utm_source=docs&utm_content=endpoint-metrics) for more details on plan features
and benefits.

[Contact us](mailto:support@iroh.computer) if you have any questions about upgrading your plan.

## Glossary

Expand Down
15 changes: 9 additions & 6 deletions iroh-services/metrics/how-it-works.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@ description: "Understanding how Iroh Services collects and processes metrics"

To enable metrics collection, simply add endpoints to your network through the
Iroh Services dashboard. Metrics will be automatically collected and reported once:
1. The ssh key is uploaded to the platform.
2. The endpoint is built using the uploaded ssh key and Iroh Services platform endpoint id.
3. The endpoint sends metrics data to the project in the Iroh Services platform.

1. The endpoint is built using the API Secret Key
2. The endpoint sends metrics data to a Cloud endpoint hosted in the Iroh Services platform.
3. The Iroh Services platform aggregates the data and makes it available in the project dashboard.
4. Iroh services deletes data on a rolling bases outside the retention window, based on your [plan](https://n0des.iroh.computer/pricing).


## How it works

Expand All @@ -22,14 +25,14 @@ key match what has been set up in your project on the Iroh Services platform.
2. Call `endpoint.online().await` before creating the Client. The endpoint must be online before the client is instantiated in order to
authenticate to the platform.
3. Once authenticated, endpoints will start sending granular-level data about their behavior and connection status.
4. Every 10 seconds, the Iroh Services platform will aggregate key project-level metrics which are visible in the project dashboard.
4. Once per minute, the Iroh Services platform will aggregate key project-level metrics which are visible in the project dashboard.

## Metrics Retention

Project-level metrics are retained based on your events plan. Please refer to the
pricing page for more details on plan features and benefits.
[pricing page for more details on plan features and benefits](https://n0des.iroh.computer/pricing).

Endpoint level metrics are only available on Pro and Enterprise. For projects on
Endpoint level metrics are only available on Enterprise plans. For projects on
these plans, the amount of endpoint-level raw data retained is calculated on
your purchased metrics package. There is a rolling lookback window for metrics
retention that is based on your metrics package. [Contact
Expand Down
37 changes: 29 additions & 8 deletions iroh-services/metrics/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,39 @@ All endpoint metrics are aggregated at the project level, to provide insights
into overall network performance. This aggregated data helps in understanding
trends and patterns without exposing individual endpoint details.

Read more about [project metrics](/iroh-services/metrics/index).
![Project metrics dashboard](/images/metrics-dashboard.png)

## Endpoint metrics
### Online Endpoints

Mmore detailed metrics are available for each endpoint added to the network.
These metrics are available at the endpoint level, so you can drill down into
specific behaviors to better understand performance issues. Projects that have
been upgraded to Enterprise plan have access to endpoint-level
metrics retention and lookback.
The number of endpoints currently online and connected to your project. This gives you a real-time view of your network's active nodes.

Read more about [endpoint metrics](/iroh-services/metrics/endpoint).
![Online endpoints metric](/images/metrics-online-endpoints.png)

### Direct Data Rate

Direct data rate measures the amount of data being transferred directly between
endpoints in your network, without relaying through a server. A higher direct
data rate indicates better peer-to-peer connectivity and can lead to improved
performance and lower latency for your users.

![Direct data rate metric](/images/metrics-direct-data-rate.png)

### Traffic Sent & Received

This metric tracks the amount of data being sent and received by your endpoints.
Monitoring traffic patterns can help you identify potential bottlenecks and
optimize network performance.

![Traffic sent and received metric](/images/metrics-traffic-received.png)

![Traffic sent metric](/images/metrics-traffic-sent.png)

## Relay metrics

If you have dedicated relays set up for your project, you can also view metrics
related to relay performance, such as number of endpoints over time and relay data transfer.

![Relay metrics dashboard](/images/metrics-relay.png)

## Privacy

Expand Down
131 changes: 0 additions & 131 deletions iroh-services/net-diagnostics.mdx

This file was deleted.

56 changes: 56 additions & 0 deletions iroh-services/net-diagnostics/quickstart.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
title: "Quickstart"
description: "Diagnose user connectivity issues with remote diagnostic reporting"
---

Net Diagnostics lets you run network connectivity reports on your endpoints.

Reports cover NAT type, UDP connectivity, relay latency, port
mapping protocol availability, and direct addresses — everything you need to
debug connection issues.

You can initiate reports from iroh-services, which will reach out to configured
remote nodes that have authorized diagnostics, gather
details about the endpoint's connectivity context, and forward the report to
your project on iroh services to assess how to help your user get the best
connection they can.


#### 1. Get your API secret

Go to your project's **Settings** page and copy the API secret. In your terminal, export it as an environment variable:

```bash
export N0DES_API_SECRET=<your-api-secret>
```

### 2. Run the diagnostics client

Clone the repository and run the `net_diagnostics` example:

```bash
git clone https://github.com/n0-computer/iroh-n0des.git
cd iroh-n0des
cargo run --example net_diagnostics --features net_diagnostics,client_host
```

Leave this terminal open. The example connects to n0des, grants the diagnostics capability to your project, and waits for incoming diagnostics requests.

### 3. Run a diagnostic from the dashboard

Go to your project's **Endpoints** page. You should see the example client listed as an online endpoint. Click **Run Diagnostics** to generate a report.

The report appears on the **Net Diagnostics** page and includes:

- **NAT Type** — No NAT, Endpoint-Independent, Endpoint-Dependent, or Unknown
- **UDP Connectivity** — IPv4 and IPv6 status with public addresses
- **NAT Mapping** — whether mapping varies by destination (symmetric NAT detection)
- **Direct Addresses** — local addresses the endpoint is listening on
- **Port Mapping** — UPnP, PCP, and NAT-PMP availability
- **Relay Latencies** — per-relay IPv4, IPv6, and HTTPS round-trip times
- **Captive Portal** — detection of captive portal interference

## Next Steps

- [Integrate diagnostics into your own app with the usage guide](./usage) to get on-demand reports from your users' endpoints.
- [Learn more about report details](./reports) to understand what each metric means and how it impacts connectivity.
25 changes: 25 additions & 0 deletions iroh-services/net-diagnostics/reports.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

### NAT Types

| NAT Type | What it means | Connection quality |
|---|---|---|
| **No NAT** | Local address matches public address | Direct connections work with correct firewall config |
| **Endpoint-Independent** | One outbound UDP packet opens a port for any sender | Holepunching works reliably |
| **Endpoint-Dependent** | Only the specific destination can reply (symmetric NAT) | Connections will primarily use relays |
| **Unknown** | NAT behavior could not be determined | Check UDP connectivity |

### Connectivity Summary

The report includes a color-coded connectivity summary:

- **Green** — UDP works and NAT is favorable. Direct connections should work.
- **Orange** — Endpoint-Dependent NAT. Direct connections may be difficult; traffic will often be relayed.
- **Red** — No UDP connectivity. Traffic will be relayed.

## How It Works

When you click **Run Diagnostics** in the dashboard, the platform dials back
into your endpoint using the capability token your app granted. Your
`ClientHost` receives the request, runs the diagnostics locally (probing UDP
connectivity, NAT behavior, relay latency, and port mapping), and returns the
report to the platform for display.
Loading
Loading