# Observability

RailProtocol records every payment on Solana and surfaces a real-time view of your agent fleet's spend, protocol usage, policy events, and transaction history in the dashboard. The blockchain is the primary source of truth. The dashboard is a lens on it.

***

## Dashboard

The dashboard is available at [app.railprotocol.org](https://app.railprotocol.org).

### Live transaction feed

The default view shows every payment as it settles, in real time. Each entry includes:

* Agent ID
* Protocol used (x402 or MPP)
* Amount paid (USDC)
* Endpoint called
* Solana transaction hash (links to Solana Explorer)
* Time

### Spend breakdown

The **Spend** tab shows USDC spend broken down by:

* Agent
* Protocol (x402 vs. MPP)
* Time window (1h, 24h, 7d, 30d, custom)
* Domain

Use this to identify which agents are spending the most and where that spend is going.

### Protocol split

The **Protocol** tab shows x402 vs. MPP volume over time. Useful for understanding which protocols your agent's services use and whether the protocol preference setting is having the desired effect.

### Policy events

The **Policies** tab shows all rejected payments with:

* Rejection reason (daily budget exceeded, per-call limit, domain not allowed, rate limit)
* Endpoint that triggered the rejection
* Amount that was requested vs. the limit
* Agent ID and timestamp

### On-chain ledger

The **Ledger** tab shows every transaction with a direct link to its Solana Explorer entry. The data in this view is derived from on-chain state. It cannot be modified by RailProtocol.

***

## Querying transactions

Via CLI:

```bash
# List recent transactions for an agent
rail transactions list --agent my-agent --limit 50

# Filter by protocol
rail transactions list --agent my-agent --protocol x402

# Filter by time window
rail transactions list --agent my-agent --since 24h

# Filter by domain
rail transactions list --agent my-agent --domain api.dune.com
```

Output:

```
TX HASH                      PROTOCOL  AMOUNT      ENDPOINT                           TIME
5yJ8kX...mQ9pL              x402      0.002 USDC  api.dune.com/v1/query/...          2 min ago
3xH7jY...nP8qM              mpp       0.012 USDC  api.browserbase.com/v1/sessions    5 min ago
9wF6iZ...oQ7rN              x402      0.004 USDC  api.coingecko.com/v3/coins/...     8 min ago
```

Inspect a single transaction:

```bash
rail transactions inspect 5yJ8kX...mQ9pL
```

```
Transaction:     5yJ8kX...mQ9pL
Agent:           my-agent
Protocol:        x402
Amount:          0.002 USDC
Endpoint:        api.dune.com/v1/query/1234/results
Policy check:    passed
Parent tx:       (none — top level)
Solana:          https://explorer.solana.com/tx/5yJ8kX...mQ9pL
Timestamp:       2026-05-09T14:23:01Z
```

***

## Spend summary

```bash
rail spend --agent my-agent --window 7d
```

```
Agent:         my-agent
Period:        last 7 days
Total spend:   8.42 USDC
Transactions:  312

By protocol:
  x402:        6.14 USDC  (72.9%)
  MPP:         2.28 USDC  (27.1%)

By domain:
  api.dune.com             3.20 USDC
  api.browserbase.com      2.14 USDC
  fal.ai                   1.92 USDC
  api.coingecko.com        1.16 USDC
```

***

## Alerts

Set threshold-based alerts to be notified before problems become incidents.

### Budget threshold alert

```bash
rail alerts create \
  --agent my-agent \
  --type budget_pct \
  --threshold 80 \
  --notify webhook:https://hooks.yourapp.com/rail
```

Fires when the agent has consumed 80% of its daily budget.

### Spend rate alert

```bash
rail alerts create \
  --agent my-agent \
  --type spend_rate \
  --threshold 5 \
  --window 1h \
  --notify email:you@example.com
```

Fires when the agent spends more than 5 USDC in any 1-hour window.

### Policy violation alert

```bash
rail alerts create \
  --agent my-agent \
  --type policy_violation \
  --notify webhook:https://hooks.yourapp.com/rail
```

Fires on every rejected payment.

**Notification channels:**

* Webhook (POST JSON payload to your URL)
* Email
* Slack (via webhook URL)

***

## Metrics API

All dashboard data is available via the REST API for integration into external monitoring infrastructure.

```
GET /v1/agents/{agentId}/metrics
  ?metrics=spend,tx_count,policy_violations,protocol_split
  &window=24h
  &resolution=1h
Authorization: Bearer $RAIL_API_KEY
```

Response:

```json
{
  "agentId": "my-agent",
  "window": "24h",
  "resolution": "1h",
  "metrics": {
    "spend": [
      { "timestamp": "2026-05-09T00:00:00Z", "value": 1.24 },
      { "timestamp": "2026-05-09T01:00:00Z", "value": 0.98 }
    ],
    "protocol_split": {
      "x402": 0.72,
      "mpp": 0.28
    },
    "policy_violations": [
      { "timestamp": "2026-05-09T03:00:00Z", "count": 3, "reason": "per_call_limit_exceeded" }
    ]
  }
}
```

***

## Solana as the source of truth

The RailProtocol dashboard is a view on the on-chain ledger. Every transaction hash links to a public Solana Explorer entry that contains:

* Sender address (agent wallet)
* Receiver address (service wallet)
* USDC amount
* Block timestamp
* Program instruction data (including protocol and endpoint hash)

This data cannot be modified by RailProtocol. If you ever need to verify a transaction independently of the dashboard, use the Solana transaction hash directly.

```bash
# Open the Solana Explorer entry for a transaction
rail transactions explorer 5yJ8kX...mQ9pL
```

***

## Further reading

* [Spend policies](/features/spend-policies.md)
* [Multi-agent payment chains](/features/multi-agent-payments.md)
* [CLI reference: `rail transactions`](/cli/reference.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.railprotocol.org/features/observability.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
