services
Get a key

library / Integrations / I0029

Validator skip rate in InfluxDB

A small Node sampler reads slot and block height from your Carbium RPC every 10 seconds, turns the gap into a skip rate, times the call, and writes both to InfluxDB as line protocol so you can chart skipped slots against RPC round-trip time.

By Carbium · Search and time series · I0029 · updated 2026-11-22

01

What the sampler writes

The sampler is one Node process with one dependency, @solana/kit. Every 10 seconds it asks Carbium RPC for the current slot and block height, works out how many slots the chain skipped since the last sample, times the call, and writes one point to InfluxDB 2 in line protocol. The measurement is slot_skips, tagged with a node name you choose.

Each point carries four fields.

FieldHolds
skippedSlots in the window that produced no block.
window_slotsSlots between this sample and the previous one.
skip_rateskipped divided by window_slots, from 0 to 1.
rpc_msMilliseconds the RPC call took, measured on your machine.

A slot that its leader never produced has no block, so the slot counter moves and the block height does not. Over one window, the slot delta minus the block height delta is the number of skipped slots. The difference of two counters needs no block reads, so a sample costs one call however long the window is.

02

The Solana side: one read per sample

The read is getEpochInfo. Its answer holds absoluteSlot and blockHeight from the same moment. Two separate calls, getSlot and getBlockHeight, can land a slot apart, which adds or removes one skipped slot in a sample and shows up as noise in a short window.

The call sets commitment confirmed explicitly. A slot is about 200 ms, so a 10 second window holds about 50 slots and one skipped slot reads as 0.02.

The RPC endpoint is https://services.carbium.sh and the key goes in the x-api-key header.

rpc_ms is a stopwatch around the call on your machine. It includes your own network path, Carbium and the answer, so it is the delay your application sees. It leaves the chain's own timing out, which is what you want for asking whether your reads slowed while slots were skipping. For commitment levels in more depth, see Solana commitment levels.

03

What happened to vote transactions

A block explorer used to be the place to confirm a validator's votes, because every vote was a transaction inside a block. Since Alpenglow, mainnet blocks carry no vote transactions. A block read, an address history or an explorer page has no vote to show, whatever the validator is doing.

What remains observable from outside is the result: which slots got a block and which did not. That is the part this sampler records. For your own validator's health, read its own metrics next to this series, and use the chain-wide skip rate here as the background it runs against.

04

The InfluxDB side: one measurement, two fields to overlay

Create a bucket, for example chain, and a token that can write to it. Set INFLUX_URL, INFLUX_TOKEN, INFLUX_ORG and INFLUX_BUCKET, and the sampler posts each point to /api/v2/write with nanosecond precision. The timestamp is your machine's clock when the answer arrived.

To see both series on one panel, query from(bucket: "chain") |> range(start: -6h) |> filter(fn: (r) => r._measurement == "slot_skips" and (r._field == "skip_rate" or r._field == "rpc_ms")) and give rpc_ms its own axis. To smooth the rate over 5 minutes, sum skipped and sum window_slots over each 5 minute window and divide, which weights every window by its length. A mean of skip_rate treats a short window the same as a long one.

If you chart in Grafana, the panel setup is the one in Grafana network metrics, with this bucket as the data source.

05

The sampler and how to run it

Install with npm install @solana/[email protected] and set "type": "module" in package.json. Node 24 strips the types on load. CARBIUM_KEY is required and the process exits with a message without it. INTERVAL_S (default 10), NODE_NAME (default carbium) and CARBIUM_RPC_URL are optional.

main.ts
// I0029 · Validator skip rate in InfluxDB// https://carbium.sh/library/integrate/validator-skip-rate-in-influxdb// Copyright (c) Carbium Corporation. MIT License (LICENSE). Keep this notice.// SPDX-License-Identifier: MITimport { createDefaultRpcTransport, createSolanaRpcFromTransport } from "@solana/kit";const key = process.env.CARBIUM_KEY;if (!key) {  console.error("Set CARBIUM_KEY to your Carbium API key, then run: node main.ts");  process.exit(1);}const { INFLUX_URL, INFLUX_TOKEN, INFLUX_ORG, INFLUX_BUCKET } = process.env;if (INFLUX_URL && !(INFLUX_TOKEN && INFLUX_ORG && INFLUX_BUCKET)) {  console.error("INFLUX_URL needs INFLUX_TOKEN, INFLUX_ORG and INFLUX_BUCKET");  process.exit(1);}const intervalMs = (Number(process.env.INTERVAL_S) || 10) * 1000;const node = (process.env.NODE_NAME ?? "carbium").replace(/[ ,=]/g, "_");// One client, built once and reused for every sample.const rpc = createSolanaRpcFromTransport(  createDefaultRpcTransport({    url: process.env.CARBIUM_RPC_URL ?? "https://services.carbium.sh",    headers: { "x-api-key": key },  }),);let prev: { slot: number; height: number } | null = null;async function sample(): Promise<void> {  const started = performance.now();  // absoluteSlot counts every slot, blockHeight counts blocks, and both come from one moment.  const info = await rpc    .getEpochInfo({ commitment: "confirmed" })    .send({ abortSignal: AbortSignal.timeout(5_000) });  const rpcMs = performance.now() - started;  const cur = { slot: Number(info.absoluteSlot), height: Number(info.blockHeight) };  const last = prev;  if (!last) {    prev = cur;    console.log(`slot ${cur.slot} height ${cur.height} rpc ${rpcMs.toFixed(0)} ms, rate starts at the next sample`);    return;  }  const window = cur.slot - last.slot;  const skipped = window - (cur.height - last.height);  if (window <= 0 || skipped < 0) {    console.error(`dropped: answer behind the last one (${window} slots)`);    return;  }  prev = cur;  const line =    `slot_skips,node=${node} rpc_ms=${rpcMs.toFixed(1)},window_slots=${window}i,skipped=${skipped}i,` +    `skip_rate=${(skipped / window).toFixed(4)} ${Date.now()}000000`;  console.log(line);  if (INFLUX_URL) {    const query = new URLSearchParams({ org: INFLUX_ORG ?? "", bucket: INFLUX_BUCKET ?? "", precision: "ns" });    try {      const res = await fetch(`${INFLUX_URL}/api/v2/write?${query}`, {        method: "POST",        headers: { authorization: `Token ${INFLUX_TOKEN}` },        body: line,        signal: AbortSignal.timeout(5_000),      });      if (!res.ok) console.error(`influx write failed: ${res.status}`);    } catch (err) {      console.error("influx write failed:", err instanceof Error ? err.message : err);    }  }}for (;;) {  await sample().catch((err: unknown) => console.error("sample failed:", err instanceof Error ? err.message : err));  await new Promise((r) => setTimeout(r, intervalMs));}

run: node main.ts

Start it with node main.ts under a supervisor such as a systemd unit. With no INFLUX_URL it prints each point as a line of line protocol and writes nowhere, which is also the quickest way to check the numbers before you wire a bucket. The first sample prints the slot and height and has no rate yet. Every sample after it prints a point.

06

What it costs against your limits

Each sample is one RPC call. At the default interval that is 0.1 calls per second, and at 5 seconds it is 0.2, which stays under every Free ceiling for a read, the smallest being 0.24 req/s. Limits are per account, so every key you own shares one budget.

When a call fails, the sampler logs it and takes the next sample on schedule. Because the rate comes from a delta, a missed sample only makes the next window longer and the rate stays correct.

07

Where it ends

  • The skip rate is chain-wide. It counts every skipped slot from every leader. A rate for your own validator needs the leader schedule and the blocks each leader produced, and this sampler reads neither.
  • It cannot confirm your validator's votes. Blocks hold none since Alpenglow, so there is nothing in a block for any reader to find.
  • Leaders decide which slots get a block, so a slow RPC answer does not make a slot skip. A shared cause, such as network trouble near you, can move both lines together.
  • A 10 second window holds about 50 slots, so single windows are coarse. Use sums over 5 minutes for a level and the raw points for spikes.
  • rpc_ms includes your own network path. Run the sampler in the region where your application runs, or the number describes somewhere else.
  • There is no backfill. The first point is the first run, and a sample that failed leaves a hole in rpc_ms with the rate carried by the next window.
  • A point that InfluxDB refuses or never receives is logged and dropped. Nothing buffers it for a later retry.
08

When it goes wrong

what goes wrongwhat to do
The process logs sample failed: with an HTTP error (401) on every sample.The key is unknown at the door. Check that CARBIUM_KEY holds the whole key, with no cut-off paste or trailing space.
The log shows sample failed: with an HTTP error (429) now and then.Your account's budget is spent, often by traffic on other keys, since every key shares one budget. Raise INTERVAL_S or move to a plan with a higher rate. The next sample runs on its own.
The log shows dropped: answer behind the last one.A later read came back older than the one before it, so the window was zero or negative. The sampler keeps the earlier sample and measures from it on the next try. A few of these now and then are harmless.
The log shows influx write failed: 401 or 404.401 means the token cannot write to the bucket. 404 means the organization or bucket name does not exist at that INFLUX_URL. Check all four INFLUX_ values; the sampler keeps sampling and prints each line either way.
InfluxDB answers 422 with a field type conflict after you changed the code.A field holds one type per bucket. skipped and window_slots are written as integers and skip_rate and rpc_ms as floats. Write a changed field type to a new bucket or measurement name.
09

Questions

Can I get the skip rate of one validator?

Not from this sampler, which counts the whole chain. A per-validator rate needs the leader schedule and the number of blocks each leader produced over the same slots. Build it as a second measurement beside slot_skips and chart them together.

Why not read getSlot and getBlockHeight separately?

Two calls can land a slot apart, which adds or removes a skipped slot from a sample. getEpochInfo returns both counters in one answer, so the difference is taken between two real moments.

What interval should I use?

Ten seconds gives about 50 slots per window and a point every 10 seconds, which suits a dashboard. Shorter windows show spikes and cost more calls and more noise, and longer ones smooth the rate but hide short stalls.

Does this work with a bucket I already have?

Yes. The sampler writes one new measurement, slot_skips, and touches nothing else in the bucket. Give it a token that can write to that one bucket and no more.