本文介绍了EthLambda项目中用于监控节点性能的指标体系,这些指标通过Prometheus兼容的HTTP端点暴露,并提供了一个预配置的Grafana + Prometheus监控栈。文章详细列出了节点信息、签名、分叉选择、状态转换和网络等方面的指标,以及它们的数据类型、用途、收集时机、标签和是否支持等信息,方便用户了解和使用这些指标进行监控。
我们收集各种指标,并通过与 Prometheus 兼容的 HTTP 端点在 http://<metrics_address>:<metrics_port>/metrics (默认:http://127.0.0.1:5054/metrics)上提供它们。
我们在 metrics/ 目录中提供了一个即用型的 Grafana + Prometheus 监控栈。它包括来自 leanMetrics 仓库的预配置仪表板,用于可视化下面描述的指标。有关设置说明,请参阅 metrics README。
公开的指标遵循 leanMetrics 规范,但有些指标尚未实现。下面是我们已实现的指标的完整列表,其中复选框指示当前是否支持每个指标。
| 名称 | 类型 | 用途 | 样本收集事件 | 标签 | 支持 |
|---|---|---|---|---|---|
lean_node_info |
Gauge | 节点信息(始终为 1) | 节点启动时 | name, version | ✅ |
lean_node_start_time_seconds |
Gauge | 启动时间戳 | 节点启动时 | ✅ |
| 名称 | 类型 | 用途 | 样本收集事件 | 标签 | Buckets | 支持 |
|---|---|---|---|---|---|---|
lean_pq_sig_attestation_signing_time_seconds |
Histogram | 签署证明所花费的时间 | 每次签署证明时 | 0.005, 0.01, 0.025, 0.05, 0.1, 1 | □ | |
lean_pq_sig_attestation_verification_time_seconds |
Histogram | 验证证明签名所花费的时间 | 每次在证明上执行 signature.verify() 时 |
0.005, 0.01, 0.025, 0.05, 0.1, 1 | □ | |
lean_pq_sig_aggregated_signatures_total |
Counter | 聚合签名的总数 | 在 build_attestation_signatures() 上 |
0.005, 0.01, 0.025, 0.05, 0.1, 1 | ✅ | |
lean_pq_sig_attestations_in_aggregated_signatures_total |
Counter | 包含在聚合签名中的证明总数 | 在 build_attestation_signatures() 上 |
0.005, 0.01, 0.025, 0.05, 0.1, 1 | ✅ | |
lean_pq_sig_attestation_signatures_building_time_seconds |
Histogram | 验证聚合证明签名所花费的时间 | 在 build_attestation_signatures() 上 |
0.005, 0.01, 0.025, 0.05, 0.1, 1 | □ | |
lean_pq_sig_aggregated_signatures_verification_time_seconds |
Histogram | 验证聚合证明签名所花费的时间 | 在验证聚合签名时 | 0.005, 0.01, 0.025, 0.05, 0.1, 1 | □ | |
lean_pq_sig_aggregated_signatures_valid_total |
Counter | 有效聚合签名的总数 | 在验证聚合签名时 | ✅ | ||
lean_pq_sig_aggregated_signatures_invalid_total |
Counter | 无效聚合签名的总数 | 在验证聚合签名时 | ✅ |
| 名称 | 类型 | 用途 | 样本收集事件 | 标签 | Buckets | 支持 |
|---|---|---|---|---|---|---|
lean_head_slot |
Gauge | lean 链的最新槽 | 在获取分叉选择头时 | ✅ | ||
lean_current_slot |
Gauge | lean 链的当前槽 | 在抓取时 | ✅(*) | ||
lean_safe_target_slot |
Gauge | 安全目标槽 | 在安全目标更新时 | ✅ | ||
lean_fork_choice_block_processing_time_seconds |
Histogram | 处理区块所花费的时间 | 在分叉选择处理区块时 | 0.005, 0.01, 0.025, 0.05, 0.1, 1 | ✅ | |
lean_attestations_valid_total |
Counter | 有效证明的总数 | 在验证证明时 | source=block,gossip | ✅ | |
lean_attestations_invalid_total |
Counter | 无效证明的总数 | 在验证证明时 | source=block,gossip | ✅ | |
lean_attestation_validation_time_seconds |
Histogram | 验证证明所花费的时间 | 在验证证明时 | 0.005, 0.01, 0.025, 0.05, 0.1, 1 | ✅ | |
lean_fork_choice_reorgs_total |
Counter | 分叉选择重组的总数 | 在分叉选择重组时 | ✅ | ||
lean_fork_choice_reorg_depth |
Histogram | 分叉选择重组的深度(以区块为单位) | 在分叉选择重组时 | 1, 2, 3, 5, 7, 10, 20, 30, 50, 100 | □ |
| 名称 | 类型 | 用途 | 样本收集事件 | 标签 | Buckets | 支持 |
|---|---|---|---|---|---|---|
lean_latest_justified_slot |
Gauge | 最新已确定的槽 | 在状态转换时 | ✅ | ||
lean_latest_finalized_slot |
Gauge | 最新已最终确定的槽 | 在状态转换时 | ✅ | ||
lean_finalizations_total |
Counter | 最终确定尝试的总数 | 在最终确定尝试时 | result=success,error | ✅ | |
lean_state_transition_time_seconds |
Histogram | 处理状态转换的时间 | 在状态转换时 | 0.25, 0.5, 0.75, 1, 1.25, 1.5, 2, 2.5, 3, 4 | ✅ | |
lean_state_transition_slots_processed_total |
Counter | 已处理的槽的总数 | 在状态转换处理槽时 | ✅ | ||
lean_state_transition_slots_processing_time_seconds |
Histogram | 处理槽所花费的时间 | 在状态转换处理槽时 | 0.005, 0.01, 0.025, 0.05, 0.1, 1 | ✅ | |
lean_state_transition_block_processing_time_seconds |
Histogram | 处理区块所花费的时间 | 在状态转换处理区块时 | 0.005, 0.01, 0.025, 0.05, 0.1, 1 | ✅ | |
lean_state_transition_attestations_processed_total |
Counter | 已处理的证明的总数 | 在状态转换处理证明时 | ✅ | ||
lean_state_transition_attestations_processing_time_seconds |
Histogram | 处理证明所花费的时间 | 在状态转换处理证明时 | 0.005, 0.01, 0.025, 0.05, 0.1, 1 | ✅ |
| 名称 | 类型 | 用途 | 样本收集事件 | 标签 | 支持 |
|---|---|---|---|---|---|
lean_validators_count |
Gauge | 节点管理的验证器数量 | 在抓取时 | ✅(*) |
| 名称 | 类型 | 用途 | 样本收集事件 | 标签 | 支持 |
|---|---|---|---|---|---|
lean_connected_peers |
Gauge | 已连接的对等点数量 | 在抓取时 | client=lantern,qlean,ream,zeam | ✅(*) |
lean_peer_connection_events_total |
Counter | 对等点连接事件的总数 | 在对等点连接时 | direction=inbound,outbound<br>result=success,timeout,error | ✅ |
lean_peer_disconnection_events_total |
Counter | 对等点断开连接事件的总数 | 在对等点断开连接时 | direction=inbound,outbound<br>reason=timeout,remote_close,local_close,error | ✅ |
✅(*) 部分支持:这些指标已实现,但未按照规范要求“在抓取时”收集。它们在特定事件(例如,在tick时、在区块处理时)更新,而不是在每次 Prometheus 抓取时重新计算。
- 原文链接: github.com/lambdaclass/e...
- 登链社区 AI 助手,为大家转译优秀英文文章,如有翻译不通的地方,还请包涵~
如果觉得我的文章对您有用,请随意打赏。你的支持将鼓励我继续创作!