{"eip":2159,"title":"Common Prometheus Metrics Names for Clients","description":"Standardized names of common metrics for Ethereum clients to use with Prometheus, a widely used monitoring and alerting solution.","authors":["Adrian Sutton (@ajsutton)"],"status":"Final","type":"Standards Track","category":"Interface","created":"2019-07-01","discussionsTo":"https://ethereum-magicians.org/t/common-chain-metrics/3415","repo":"EIPs","label":"EIP-2159","officialUrl":"https://eips.ethereum.org/EIPS/eip-2159","sourceUrl":"https://github.com/ethereum/EIPs/blob/master/EIPS/eip-2159.md","url":"https://eips.huatuo.xyz/eip-2159/","tldr":{"en":"Standard Prometheus metric names for chain height, sync target and peers, so operators can monitor different Ethereum clients with one dashboard and one set of alerts.","ja":"チェーン高さ、同期目標、ピアに関する標準の Prometheus メトリクス名。オペレーターが 1 つのダッシュボードと 1 組のアラートで異なる Ethereum クライアントを監視できるようにする。","ko":"체인 높이, 동기화 목표, 피어에 대한 표준 Prometheus 메트릭 이름. 운영자가 하나의 대시보드와 하나의 알림 설정으로 서로 다른 이더리움 클라이언트를 모니터링할 수 있게 한다.","zh":"为链高度、同步目标和对等节点定义标准的 Prometheus 指标名称，让运维人员用一个仪表盘和一套告警监控不同的以太坊客户端。"},"tags":["monitoring","prometheus","metrics","clients","operations"],"explainers":{"en":{"lang":"en","tldr":"Standard Prometheus metric names for chain height, sync target and peers, so operators can monitor different Ethereum clients with one dashboard and one set of alerts.","tags":["monitoring","prometheus","metrics","clients","operations"],"related":[1474],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-2159/","markdown":"## What problem does it solve?\n\nMost Ethereum clients export metrics in Prometheus format so operators can graph performance and alert when something goes wrong. But each client named its metrics differently. If you ran a mix of clients, which is good for resilience, you needed separate dashboards and alert rules for each one.\n\nEIP-2159 picks standard names for a few metrics that every client can report. With them, one dashboard and one alert configuration work across a heterogeneous set of nodes.\n\n## How it works\n\nThe EIP defines four gauges. Clients may export many more metrics, but non-standard ones **should not** use the `ethereum_` prefix.\n\n| Metric | Meaning | JSON-RPC equivalent |\n| --- | --- | --- |\n| `ethereum_blockchain_height` | Current height of the canonical chain | `eth_blockNumber` |\n| `ethereum_best_known_block_number` | Estimated highest block available | `highestBlock` from `eth_syncing`, or `eth_blockNumber` if not syncing |\n| `ethereum_peer_count` | Peers currently connected | `net_peerCount` |\n| `ethereum_peer_limit` | Maximum peers allowed | none |\n\n`ethereum_best_known_block_number` always has a value: when the node is not syncing, it equals the current chain height. That makes \"how far behind am I?\" a simple subtraction.\n\nThe spec deliberately does not say *how* to expose metrics (port, path, flags), since clients already differ and standardizing that brings little benefit.\n\n## Sample code\n\nA Prometheus scrape config and three alert rules built only on the standard names:\n\n```yaml\n# prometheus.yml\nscrape_configs:\n  - job_name: ethereum\n    static_configs:\n      - targets: [\"node-a:METRICS_PORT\", \"node-b:METRICS_PORT\"]  # each client's metrics port\n```\n\n```yaml\n# alerts.yml\ngroups:\n  - name: ethereum\n    rules:\n      - alert: NodeFallingBehind\n        expr: ethereum_best_known_block_number - ethereum_blockchain_height \u003e 10\n        for: 5m\n      - alert: ChainStalled\n        expr: increase(ethereum_blockchain_height[5m]) == 0\n        for: 5m\n      - alert: LowPeers\n        expr: ethereum_peer_count \u003c 5\n        for: 10m\n```\n\nA dashboard panel for peer usage:\n\n```promql\nethereum_peer_count / ethereum_peer_limit\n```\n\n## Things to know\n\n- **Status: Final.** It is an Interface standard and does not affect consensus.\n- Thresholds in the sample alerts are illustrative. Tune them to your network and block time.\n- Clients that already exported these values under old names may break existing dashboards when switching. The spec suggests exposing both names during a transition.\n- The metrics port and enabling flag differ by client and are not covered here. Check each client's documentation.\n- Consensus-layer (beacon chain) clients follow a separate, more detailed metrics specification.\n"},"ja":{"lang":"ja","tldr":"チェーン高さ、同期目標、ピアに関する標準の Prometheus メトリクス名。オペレーターが 1 つのダッシュボードと 1 組のアラートで異なる Ethereum クライアントを監視できるようにする。","tags":["monitoring","prometheus","metrics","clients","operations"],"related":[1474],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-2159/","markdown":"## 何を解決するのか\n\nほとんどの Ethereum クライアントは Prometheus 形式でメトリクスを公開しており、オペレーターはパフォーマンスをグラフ化し、問題発生時にアラートを出せます。しかし、クライアントごとにメトリクスの名前が異なっていました。耐障害性の面で望ましい複数クライアントの混在運用では、クライアントごとに別々のダッシュボードとアラートルールが必要でした。\n\nEIP-2159 は、すべてのクライアントが報告できるいくつかのメトリクスに標準名を定めます。これにより、1 つのダッシュボードと 1 つのアラート設定で、異種混在のノード群を扱えます。\n\n## 仕組み\n\nこの EIP は 4 つの gauge を定義します。クライアントはさらに多くのメトリクスを公開してかまいませんが、非標準のものには `ethereum_` プレフィックスを使うべきでは**ありません**。\n\n| メトリクス | 意味 | 対応する JSON-RPC |\n| --- | --- | --- |\n| `ethereum_blockchain_height` | 正規チェーンの現在の高さ | `eth_blockNumber` |\n| `ethereum_best_known_block_number` | 利用可能な最高ブロックの推定値 | `eth_syncing` の `highestBlock`、同期中でなければ `eth_blockNumber` |\n| `ethereum_peer_count` | 現在接続中のピア数 | `net_peerCount` |\n| `ethereum_peer_limit` | 許可される最大ピア数 | なし |\n\n`ethereum_best_known_block_number` は常に値を持ちます。ノードが同期中でない場合は、現在のチェーン高さと等しくなります。これにより「どれだけ遅れているか」は単純な引き算で分かります。\n\n仕様は、メトリクスを*どのように*公開するか（ポート、パス、フラグ）には意図的に触れていません。クライアントごとに既に異なっており、それを標準化してもほとんど利点がないためです。\n\n## サンプルコード\n\n標準名だけで作った Prometheus のスクレイプ設定と 3 つのアラートルール:\n\n```yaml\n# prometheus.yml\nscrape_configs:\n  - job_name: ethereum\n    static_configs:\n      - targets: [\"node-a:METRICS_PORT\", \"node-b:METRICS_PORT\"]  # each client's metrics port\n```\n\n```yaml\n# alerts.yml\ngroups:\n  - name: ethereum\n    rules:\n      - alert: NodeFallingBehind\n        expr: ethereum_best_known_block_number - ethereum_blockchain_height \u003e 10\n        for: 5m\n      - alert: ChainStalled\n        expr: increase(ethereum_blockchain_height[5m]) == 0\n        for: 5m\n      - alert: LowPeers\n        expr: ethereum_peer_count \u003c 5\n        for: 10m\n```\n\nピア使用率のダッシュボードパネル:\n\n```promql\nethereum_peer_count / ethereum_peer_limit\n```\n\n## 知っておくべきこと\n\n- **ステータス: Final。** Interface 標準であり、コンセンサスには影響しません。\n- サンプルのアラートのしきい値は例示です。ネットワークとブロック時間に合わせて調整してください。\n- これらの値を以前の名前で公開していたクライアントは、切り替え時に既存のダッシュボードが壊れる可能性があります。仕様は、移行期間中は両方の名前を公開することを勧めています。\n- メトリクスのポートと有効化フラグはクライアントごとに異なり、ここでは扱いません。各クライアントのドキュメントを確認してください。\n- コンセンサスレイヤー（beacon chain）クライアントは、別のより詳細なメトリクス仕様に従います。\n"},"ko":{"lang":"ko","tldr":"체인 높이, 동기화 목표, 피어에 대한 표준 Prometheus 메트릭 이름. 운영자가 하나의 대시보드와 하나의 알림 설정으로 서로 다른 이더리움 클라이언트를 모니터링할 수 있게 한다.","tags":["monitoring","prometheus","metrics","clients","operations"],"related":[1474],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-2159/","markdown":"## 어떤 문제를 해결하나요?\n\n대부분의 이더리움 클라이언트는 Prometheus 형식으로 메트릭을 내보내므로, 운영자는 성능을 그래프로 보고 문제가 생기면 알림을 받을 수 있습니다. 하지만 클라이언트마다 메트릭 이름이 달랐습니다. 복원력에 좋은 여러 클라이언트 혼합 운영을 하려면 클라이언트마다 별도의 대시보드와 알림 규칙이 필요했습니다.\n\nEIP-2159는 모든 클라이언트가 보고할 수 있는 몇 가지 메트릭의 표준 이름을 정합니다. 이를 쓰면 하나의 대시보드와 하나의 알림 설정으로 이종 노드 집합을 다룰 수 있습니다.\n\n## 어떻게 동작하나요?\n\n이 EIP는 네 개의 gauge를 정의합니다. 클라이언트는 더 많은 메트릭을 내보내도 되지만, 비표준 메트릭에는 `ethereum_` 접두사를 사용하면 **안 됩니다**.\n\n| 메트릭 | 의미 | 대응하는 JSON-RPC |\n| --- | --- | --- |\n| `ethereum_blockchain_height` | 정규 체인의 현재 높이 | `eth_blockNumber` |\n| `ethereum_best_known_block_number` | 사용 가능한 최고 블록의 추정치 | `eth_syncing`의 `highestBlock`, 동기화 중이 아니면 `eth_blockNumber` |\n| `ethereum_peer_count` | 현재 연결된 피어 수 | `net_peerCount` |\n| `ethereum_peer_limit` | 허용되는 최대 피어 수 | 없음 |\n\n`ethereum_best_known_block_number`는 항상 값이 있습니다. 노드가 동기화 중이 아니면 현재 체인 높이와 같습니다. 덕분에 \"얼마나 뒤처졌나?\"는 단순한 뺄셈이 됩니다.\n\n스펙은 메트릭을 *어떻게* 노출할지(포트, 경로, 플래그)는 일부러 정하지 않습니다. 클라이언트마다 이미 다르고, 이를 표준화해도 얻는 이점이 적기 때문입니다.\n\n## 샘플 코드\n\n표준 이름만으로 만든 Prometheus 스크레이프 설정과 세 가지 알림 규칙:\n\n```yaml\n# prometheus.yml\nscrape_configs:\n  - job_name: ethereum\n    static_configs:\n      - targets: [\"node-a:METRICS_PORT\", \"node-b:METRICS_PORT\"]  # each client's metrics port\n```\n\n```yaml\n# alerts.yml\ngroups:\n  - name: ethereum\n    rules:\n      - alert: NodeFallingBehind\n        expr: ethereum_best_known_block_number - ethereum_blockchain_height \u003e 10\n        for: 5m\n      - alert: ChainStalled\n        expr: increase(ethereum_blockchain_height[5m]) == 0\n        for: 5m\n      - alert: LowPeers\n        expr: ethereum_peer_count \u003c 5\n        for: 10m\n```\n\n피어 사용률 대시보드 패널:\n\n```promql\nethereum_peer_count / ethereum_peer_limit\n```\n\n## 알아둘 점\n\n- **상태: Final.** Interface 표준이며 합의에는 영향을 주지 않습니다.\n- 샘플 알림의 임계값은 예시입니다. 네트워크와 블록 시간에 맞게 조정하세요.\n- 이 값을 예전 이름으로 이미 내보내던 클라이언트는 전환 시 기존 대시보드가 깨질 수 있습니다. 스펙은 전환 기간 동안 두 이름을 모두 노출할 것을 권합니다.\n- 메트릭 포트와 활성화 플래그는 클라이언트마다 다르며 여기서 다루지 않습니다. 각 클라이언트의 문서를 확인하세요.\n- 합의 계층(비콘 체인) 클라이언트는 별도의 더 상세한 메트릭 스펙을 따릅니다.\n"},"zh":{"lang":"zh","tldr":"为链高度、同步目标和对等节点定义标准的 Prometheus 指标名称，让运维人员用一个仪表盘和一套告警监控不同的以太坊客户端。","tags":["monitoring","prometheus","metrics","clients","operations"],"related":[1474],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-2159/","markdown":"## 它解决什么问题？\n\n大多数以太坊客户端都以 Prometheus 格式导出指标，运维人员可以据此绘制性能图表，并在出问题时告警。但每个客户端给指标起的名字都不一样。如果你混用多种客户端（这对韧性有好处），就需要为每个客户端分别配置仪表盘和告警规则。\n\nEIP-2159 为每个客户端都能上报的几个指标选定了标准名称。有了它们，一个仪表盘和一套告警配置就能适用于异构的节点集合。\n\n## 它如何运作\n\n该 EIP 定义了四个 gauge。客户端可以导出更多指标，但非标准指标**不应**使用 `ethereum_` 前缀。\n\n| 指标 | 含义 | 对应的 JSON-RPC |\n| --- | --- | --- |\n| `ethereum_blockchain_height` | 规范链的当前高度 | `eth_blockNumber` |\n| `ethereum_best_known_block_number` | 估计可用的最高区块 | `eth_syncing` 的 `highestBlock`，未在同步时为 `eth_blockNumber` |\n| `ethereum_peer_count` | 当前已连接的对等节点数 | `net_peerCount` |\n| `ethereum_peer_limit` | 允许的最大对等节点数 | 无 |\n\n`ethereum_best_known_block_number` 始终有值：节点未在同步时，它等于当前链高度。这样\"我落后了多少？\"就变成一次简单的减法。\n\n规范有意不规定*如何*暴露指标（端口、路径、参数），因为各客户端本来就不同，把这些标准化收益不大。\n\n## 示例代码\n\n仅基于标准名称的 Prometheus 抓取配置和三条告警规则：\n\n```yaml\n# prometheus.yml\nscrape_configs:\n  - job_name: ethereum\n    static_configs:\n      - targets: [\"node-a:METRICS_PORT\", \"node-b:METRICS_PORT\"]  # each client's metrics port\n```\n\n```yaml\n# alerts.yml\ngroups:\n  - name: ethereum\n    rules:\n      - alert: NodeFallingBehind\n        expr: ethereum_best_known_block_number - ethereum_blockchain_height \u003e 10\n        for: 5m\n      - alert: ChainStalled\n        expr: increase(ethereum_blockchain_height[5m]) == 0\n        for: 5m\n      - alert: LowPeers\n        expr: ethereum_peer_count \u003c 5\n        for: 10m\n```\n\n对等节点使用率的仪表盘面板：\n\n```promql\nethereum_peer_count / ethereum_peer_limit\n```\n\n## 需要注意\n\n- **状态：Final。** 它是 Interface 标准，不影响共识。\n- 示例告警中的阈值仅作说明。请根据你的网络和出块时间调整。\n- 已经用旧名称导出这些值的客户端，切换时可能破坏现有仪表盘。规范建议在过渡期同时暴露两种名称。\n- 指标端口和启用参数因客户端而异，本文不涉及。请查阅各客户端的文档。\n- 共识层（信标链）客户端遵循另一份更详细的指标规范。\n"}}}
