TriportRPC

Ethereum Prometheus metrics mirror

GEThttps://api.triport.io/v1/eth/metrics/eth-el-01/el-geth

Read-only proxy that fetches an Ethereum execution- or consensus-client's Prometheus metrics page, strips operator-identifying labels, and serves the sanitized output.

Ethereumeth.chain_metrics_el (EL layers) / eth.chain_metrics_cl (CL layers)Feature-gated per plan — see [Rate limits](../../rate-limits.md)

GET /v1/eth/metrics/{host_id}/{layer} returns the raw Prometheus exposition text (text/plain; version=0.0.4) for a single Ethereum node in the platform's mesh, identified by host_id, for a single client layer. The platform scrapes the upstream client's metrics endpoint on your behalf, runs the payload through a label scrubber that removes operator-identifying data (instance IPs, hostnames, pod/node/namespace labels, and any raw IP-form label values), and serves the result. You can point Prometheus, Grafana Agent, or any scraper at this URL.

Responses are cached briefly (default 5 seconds) so that repeated scrapes don't hammer the upstream node. Every response carries an X-Cache-Status header (miss, fresh, or stale). If the upstream node is temporarily unreachable, the mirror serves the last-known-good payload from a stale cache (default ceiling 60 seconds) and marks it X-Cache-Status: stale so your tooling can alert.

Use this when you want to observe the health of a specific node you are routed through — block height, peer counts, sync status — without exposing the node's internal address space. The layer selects which client family's metrics port and path to scrape; the requested layer must match the host's actual client family, and the host must advertise the corresponding metrics capability.

Parameters

Path parameters

host_idstringrequired
Identifier of the target mesh host. Must match a host in the execution-layer or consensus-layer pool for the requested layer.
layerstring (enum)required
Client layer to scrape. One of the 10 supported values below. Case-insensitive (EL-Geth is normalized to el-geth).

Response

The body is standard Prometheus exposition text. Note that the instance label has been rewritten from the upstream node's IP:port to the public host_id, and any operator-only labels (hostnames, pod/node/namespace, raw IP values) have been stripped.

Response headers

HeaderTypeDescription
Content-TypestringAlways text/plain; version=0.0.4.
X-Cache-Statusstringmiss — freshly scraped and cached; fresh — served from the in-TTL cache; stale — upstream was unreachable, served from the stale cache (data may be up to the stale ceiling old).
ServerstringAlways Triport.

Errors

Errors are returned as a small JSON envelope: {"error":"<code>","code":<status>}.

CodeMeaningWhen it happens
405method_not_allowedAny method other than GET.
404pprof_not_allowedThe path contains a /debug/pprof/ segment.
404route_not_foundPath does not start with the metrics route base.
404invalid_pathhost_id/layer segments are missing or malformed (expected exactly two segments).
404unknown_layerlayer is not one of the 10 supported values.
403tier_lockedYour plan does not include the required feature (eth.chain_metrics_el / eth.chain_metrics_cl).
503pool_not_configuredNo pool is configured for the requested namespace (EL or CL).
404unknown_hostNo host with the given host_id exists in the target pool.
400family_mismatchThe host's client family does not match the requested layer (e.g. asking for cl-lighthouse on a non-lighthouse host).
403capability_missingThe host does not advertise the required metrics capability.
502upstream_unavailableThe upstream node could not be reached and no stale cache was available.

See Errors for the shared error envelope and conventions.

Examples

JavaScript (fetch)

const res = await fetch(
  "https://api.triport.io/v1/eth/metrics/eth-el-01/el-geth",
  { headers: { Authorization: `Bearer ${process.env.TRIPORT_API_KEY}` } }
);


if (!res.ok) {
  const err = await res.json();
  throw new Error(`metrics mirror failed: ${err.error} (${err.code})`);
}


const cacheStatus = res.headers.get("X-Cache-Status"); // "miss" | "fresh" | "stale"
const metrics = await res.text();
console.log(cacheStatus, metrics);

TypeScript SDK (@triport/sdk)

import { Triport } from "@triport/sdk";


const client = new Triport({ apiKey: process.env.TRIPORT_API_KEY! });


const { body, cacheStatus } = await client.ethereum.metrics.mirror({
  hostId: "eth-el-01",
  layer: "el-geth",
});


console.log(cacheStatus, body);

Python (triport-sdk)

import os
from triport import Triport


client = Triport(api_key=os.environ["TRIPORT_API_KEY"])


result = client.ethereum.metrics.mirror(host_id="eth-el-01", layer="el-geth")
print(result.cache_status, result.body)

Notes

  • Scraping. Because responses are cached for a few seconds, you can safely set your scrape interval as low as 5 seconds — within a cache window you'll get X-Cache-Status: fresh and the upstream node is not re-hit.
  • Stale data. A stale cache status means the upstream node was unreachable on the last attempt; the payload may be up to the stale ceiling (default 60s) old. Treat sustained stale as a node-health signal.
  • Label scrubbing is one-way. Internal addressing is removed before the payload leaves the platform; you will never see upstream IPs, hostnames, or cluster topology labels. The instance label always carries the public host_id.
  • Layer ↔ host must agree. The layer you request must match the host's client family and the host must expose the corresponding metrics capability; otherwise you get family_mismatch or capability_missing.
  • Related: Ethereum JSON-RPC transport, Mesh health.