Best Monitoring Stack for a Solana Trading Bot: Grafana + Prometheus
We cover which metrics matter — slot lag, confirmation latency, slot leader proximity, dropped transactions — and provide a ready-made Grafana dashboard JSON and Prometheus scrape config tuned for production Solana HFT bots.
Running a Solana trading bot blind is how you discover — expensively — that your RPC node fell three hundred slots behind the tip during peak volatility. The best monitoring stack for a Solana trading bot pairs Prometheus for metric collection with Grafana for visualization, and the specific set of signals you instrument makes the difference between catching a degraded run in seconds versus finding out in your P&L the next morning. This article is the config we actually use in production, not a generic "set up Grafana" tutorial.
Why Generic Infra Monitoring Falls Short on Solana
CPU and memory charts tell you the process is alive. They do not tell you whether your bot is seeing the current slot, whether your transactions are landing, or whether you're submitting to a leader that will handle your slot. Solana has a ~400 ms slot target and a 1.5-second soft-confirmation window. If your bot's world model is 600 ms stale, you are already trading on wrong prices and incorrect queue state. The metrics that matter are chain-native, not host-level.
The Four Metrics That Actually Matter
Slot lag is the difference between the highest slot your bot observes and the current tip reported by a reference RPC. Anything above ~3 slots in steady state is a warning; above 10 is a hard alert. Instrument this as a gauge, scrape it every 500 ms, and set your alert threshold at slot_lag > 5 for 10s.
Confirmation latency measures the wall-clock time from transaction submission to first-confirmation (or finalization, depending on your commitment level). Track this as a histogram with buckets at 400 ms, 800 ms, 1 s, 2 s, 5 s and +Inf. A p95 above 2 s on a healthy cluster means you are hitting a congested leader or your fee calibration is off.
Dropped transaction rate is the fraction of submitted transactions that never land within your TTL window. Calculate it as sum(tx_dropped_total) / sum(tx_submitted_total) over a 1-minute window. On Jito-based Solana bots like our sniper and MEV engines, a drop rate above 5 % is a signal that your bundle tip is below market or your block engine connection is degraded.
Slot leader proximity is underused but important for latency-sensitive work. Solana publishes the leader schedule; your bot can look up how many slots remain before the current leader rotates. When you are 0–4 slots away from a leader rotation, transaction submission becomes risky because you are hitting a cold leader. Export this as a gauge and use it to conditionally suppress submissions in your bot logic, or at minimum to correlate confirmation latency spikes with schedule boundaries.
Prometheus Scrape Config
Your bot should expose a /metrics endpoint on a local port (e.g. 9091) using the standard Prometheus text format. With the prom-client npm library or the Rust prometheus crate this is a few lines. The scrape config:
scrape_configs:
- job_name: solana_bot
scrape_interval: 500ms
static_configs:
- targets: ["localhost:9091"]
metric_relabel_configs:
- source_labels: [__name__]
regex: "go_.*|process_.*"
action: drop
Set scrape_interval to 500 ms rather than the default 15 s. Solana moves fast; a 15-second scrape interval makes your slot-lag chart a lie. Drop the default Go runtime and process metrics unless you need them — they add noise.
Define these metrics in your bot:
# HELP solana_slot_lag Slots behind the tip RPC
# TYPE solana_slot_lag gauge
solana_slot_lag 2
# HELP solana_tx_submitted_total Transactions submitted
# TYPE solana_tx_submitted_total counter
solana_tx_submitted_total 1842
# HELP solana_tx_dropped_total Transactions that never confirmed within TTL
# TYPE solana_tx_dropped_total counter
solana_tx_dropped_total 37
# HELP solana_confirmation_latency_seconds Confirmation wall-clock time
# TYPE solana_confirmation_latency_seconds histogram
solana_confirmation_latency_seconds_bucket{le="0.4"} 980
solana_confirmation_latency_seconds_bucket{le="0.8"} 1340
solana_confirmation_latency_seconds_bucket{le="1.0"} 1490
solana_confirmation_latency_seconds_bucket{le="2.0"} 1720
solana_confirmation_latency_seconds_bucket{le="+Inf"} 1842
Grafana Dashboard Layout
One dashboard, four rows. Keep it narrow so it fits on a vertical monitor next to your terminal.
Row 1 — Chain health. Slot lag as a time-series with a red threshold band above 5. RPC response time (track your getSlot call latency). Leader proximity countdown.
Row 2 — Execution quality. Confirmation latency p50 / p95 / p99 as overlapping lines. Drop rate as a percentage gauge with green/yellow/red zones at 0–2 %, 2–5 %, 5 %+.
Row 3 — Throughput. Transactions submitted per minute (rate of the counter). Jito bundle acceptance rate if you're using the block engine — track accepted vs rejected bundles as a separate pair of counters.
Row 4 — Bot-specific. Whatever your strategy emits: signals fired, positions opened, PnL delta. Keep these in the same dashboard so you can visually correlate a confirmation latency spike with a missed entry.
Set the dashboard's default time range to the last 15 minutes with a 5-second auto-refresh. Grafana's $__rate_interval variable handles the 500 ms scrape correctly when computing rates.
Alerting Rules That Earn Their Keep
Most alert fatigue comes from thresholds set without production data. Start permissive, tighten after a week. Three rules that have caught real problems:
slot_lag > 8 for 15s→ page. This is an RPC failure, not a blip.rate(tx_dropped_total[5m]) / rate(tx_submitted_total[5m]) > 0.10→ notify. Your fee model or connection is broken.histogram_quantile(0.95, rate(solana_confirmation_latency_seconds_bucket[2m])) > 3→ warn. Something is wrong with the cluster or your RPC geography.
Wire these to Alertmanager and route to Telegram. For the kind of infra and data pipeline work that underpins production bots, Telegram alerting consistently beats PagerDuty for low-latency notification — you are already watching your Telegram dashboard.
Trade-offs: Hosted vs Self-Hosted
Grafana Cloud's free tier (10 k series, 14-day retention) is sufficient for a single bot with the four metrics above. Self-hosted is preferable if you're running multiple strategies, need longer retention for post-mortems, or want to keep latency data off third-party infrastructure. The stack runs comfortably on a $12/mo VPS alongside the bot process. If you are colocating near a Solana validator for latency reasons, put Prometheus and Grafana on the same host — shipping metrics off-box adds noise to your timing measurements.
The one thing not to skip: configure Prometheus's --storage.tsdb.retention.time=30d. Default is 15 days, which means you lose the data from last month's incident right before you need to understand what happened.
If you want a production-ready Solana trading bot with this observability stack built in from day one, get in touch — we scope and ship these end to end.
Need a bot like this built?
We design, build and run trading bots on Solana, Hyperliquid and Polymarket.
Start a projectMore from the blog
Public vs Paid RPC: How to Run a Fair Benchmark
A fair comparison of public and paid RPC endpoints must account for quotas, workload, freshness and support guarantees.
Read articleRPC Benchmark Percentiles Explained: p50, p95 and p99
Why averages hide the latency spikes that break trading bots, wallets and production blockchain applications.
Read articleHyperliquid REST vs WebSocket Benchmark: What to Measure
A benchmark plan for Hyperliquid market data that separates request latency from streaming freshness and recovery.
Read article