[Feature] Add subgraph name and version as label to prometheus metrics

Đang mở
#5,278 1 bình luận 2 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
prometheus, rust
Lĩnh vực
observability-sre

Hướng nghiên cứu

Xác định struct BlockStreamMetrics và lần theo nơi các trường của nó trở thành các label của metric Prometheus. Bắt đầu bằng cách kiểm tra đường dẫn metric deployment_head hiện có và các bài kiểm thử liên quan, nếu có. Hoàn tất khi các metric hiển thị các label về tên và phiên bản subgraph, trong đó tên subgraph được ưu tiên như đề xuất.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

enhancement Stale
Description

Currently, I check for the status of my subgraph nodes with the following prometheus query:
(ethereum_chain_head_number{} - ignoring(deployment, job, network, shard) deployment_head{} > 100) and ignoring(deployment, job, network, shard)(deriv(deployment_head{}[10m]) * 60 <= 0)

In simple terms, the query checks for the differences between the ethereum_chain_head_number metric and the deployment_head metric. If it is more than 100 blocks AND there hasn't been any significant changes in the deployment_head value over a 10 minutes window, the node is flagged as out of sync. The two metrics do not have the same labels, hence the ignoring of labels as seen in the query.

This query works fine for nodes hosting one or more subgraphs of different networks. However, when a subgraph of the same network but different subgraphName is deployed to a node, the only way to differentiate them is through the deployment label, which is a hash number that changes for any update and therefore, complex to manage. This introduces an issue as deployment_head starts coming off as a duplicate metric.

sample:

Assuming the two metrics below are for two subgraphs (sepolia-1 and sepolia-2), I can't tell them apart, and as far as I don't filter by deployment, it is a duplicate metric when evaluating it.

deployment_head{deployment=<HASH IPFS deployment number 1>, instance=<node_url>, job="mymetrics", network="sepolia", shard="primary"}

deployment_head{deployment=<HASH IPFS deployment number 2>, instance=<node_url>, job="mymetrics", network="sepolia", shard="primary"}
Proposal:

Add subgraphName and subgraphVersion to the BlockStreamMetrics struct. subgraphName being top priority.

deployment_head{deployment=<HASH IPFS deployment number 1>, instance=<node_url>, job="mymetrics", network="sepolia", shard="primary", subgraph="sepolia-1", version="v0.1.0"}

deployment_head{deployment=<HASH IPFS deployment number 2>, instance=<node_url>, job="mymetrics", network="sepolia", shard="primary", subgraph="sepolia-2", version="v0.1.0"}
Are you aware of any blockers that must be resolved before implementing this feature? If so, which? Link to any relevant GitHub issues.

No response

Some information to help us out
  • Tick this box if you plan on implementing this feature yourself.
  • I have searched the issue tracker to make sure this issue is not a duplicate.
Ngôn ngữ chính
Rust
Star
3.2k
Fork
1.1k
Merge trung bình
4 ngày 1 giờ
Pull request đã merge (30 ngày)
1

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của graphprotocol/graph-node

Tất cả issue của graphprotocol/graph-node

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.