/metrics endpoint that provides real-time performance data in
Prometheus format. Set port in [metrics] to the RPC port to serve metrics
on the RPC server, or to another port to run a separate metrics listener. The
examples on this page use a separate listener on 8081, with the RPC server on
8080.
Configuration
Metrics are configured in the[metrics] section of your kora.toml. The
[metrics] section configures metrics collection and monitoring. This section
is optional and by default, metrics are disabled.
| Option | Description | Required | Type |
|---|---|---|---|
enabled | Enable metrics collection | ✅ | boolean |
endpoint | Custom metrics endpoint path | ✅ | string |
port | Metrics port: the RPC port to serve metrics there, or a separate port | ✅ | number |
scrape_interval | Frequency of Prometheus scrape (seconds) | ✅ | number |
port equals the RPC port, Kora logs
Metrics endpoint enabled at /metrics on RPC server and answers /metrics on
the RPC port. With a separate port, only that port answers /metrics.
Fee Payer Balance Tracking
The[metrics.fee_payer_balance] section configures automatic monitoring of
your fee payer’s SOL balance:
Leave the section out to keep balance tracking off. If you include it, set both
keys:
| Option | Description | Required | Type |
|---|---|---|---|
enabled | Enable fee payer balance tracking | ✅ | boolean |
expiry_seconds | Background tracking interval in seconds | ✅ | number |
signer_balance_lamports Prometheus gauge, labeled with
signer_name and signer_pubkey. This helps with
capacity planning and low-balance alerting.
Quick Start
Access metrics:What You’ll See
The metrics show how your RPC server is performing:getConfig method:
Key Metrics Explained
-
kora_http_requests_total- How many requests you’ve handledmethod: Which RPC method was calledstatus: HTTP status code of the response- JSON-RPC errors, such as a rejected transaction or a missing parameter,
are returned with HTTP 200, so they’re counted under
status="200". Requests that fail authentication are counted understatus="401". Unknown or disabled methods get HTTP 405 before metrics are collected, so they aren’t counted. - Use this to track usage patterns and authentication failures
-
kora_http_request_duration_seconds- How fast your requests are- A Prometheus histogram with bucket, sum, and count series; compute p50,
p95, and p99 response times with
histogram_quantile() - Use this to identify slow endpoints
- A Prometheus histogram with bucket, sum, and count series; compute p50,
p95, and p99 response times with
-
signer_balance_lamports- Current SOL balance of each signer- Shows balance in lamports (1 SOL = 1,000,000,000 lamports) for each signer
- Labels:
signer_name(human-readable name) andsigner_pubkey(public key) - Updated automatically in the background when enabled
- Use this for capacity planning and low-balance alerts across all signers
Using the Data
Option 1: Quick Health Check
Option 2: Prometheus + Grafana (Recommended)
For graphs and alerts, run the full monitoring stack:- Prometheus: http://localhost:9090 (query metrics)
- Grafana Pre-built Kora dashboard: http://localhost:3000
- Default login: admin/admin (or use the
GF_SECURITY_ADMIN_PASSWORDandGF_SECURITY_ADMIN_USERcredentials from your.envfile)
- Default login: admin/admin (or use the
Option 3: Your Own Monitoring
Point any Prometheus-compatible tool athttp://your-server:8081/metrics:
- Datadog
- New Relic
- CloudWatch
- VictoriaMetrics
Example Queries (Prometheus)
Multi-Signer Monitoring
When using multiple signers, you can monitor each signer individually or track aggregate metrics:Individual Signer Metrics
Prometheus Queries for Multi-Signer Setups
Security Note
The/metrics endpoint is public by default. In production, consider:
- Putting it behind a firewall
- Using a separate metrics port
- Adding authentication via reverse proxy
How Metrics Collection Works
-
HTTP Middleware Layer - Intercepts all requests and collects:
- Request count by JSON-RPC method and status
- Request duration by method
-
Metrics Endpoint -
/metricsendpoint exposed automatically when feature is enabled- Handled by
MetricsHandlerLayer - Returns Prometheus-formatted metrics
- Handled by
-
Prometheus Scraping - Configured to scrape Kora every 60 seconds (see
crates/lib/src/metrics/prometheus.yml)