mirror of
https://github.com/fluencelabs/tendermint
synced 2025-04-26 07:12:16 +00:00
* Add `chID` label to sent/receive byte mtrics * add changelog pending entry
This commit is contained in:
parent
2a23eca368
commit
c9ef824ddf
@ -22,5 +22,6 @@
|
|||||||
### FEATURES:
|
### FEATURES:
|
||||||
|
|
||||||
### IMPROVEMENTS:
|
### IMPROVEMENTS:
|
||||||
|
- [p2p] \#3666 Add per channel telemtry to improve reactor observability
|
||||||
|
|
||||||
### BUG FIXES:
|
### BUG FIXES:
|
||||||
|
@ -15,7 +15,7 @@ Listen address can be changed in the config file (see
|
|||||||
The following metrics are available:
|
The following metrics are available:
|
||||||
|
|
||||||
| **Name** | **Type** | **Since** | **Tags** | **Description** |
|
| **Name** | **Type** | **Since** | **Tags** | **Description** |
|
||||||
|-----------------------------------------|-----------|-----------|----------|-----------------------------------------------------------------|
|
|-----------------------------------------|-----------|-----------|----------------|-----------------------------------------------------------------|
|
||||||
| consensus\_height | Gauge | 0.21.0 | | Height of the chain |
|
| consensus\_height | Gauge | 0.21.0 | | Height of the chain |
|
||||||
| consensus\_validators | Gauge | 0.21.0 | | Number of validators |
|
| consensus\_validators | Gauge | 0.21.0 | | Number of validators |
|
||||||
| consensus\_validators\_power | Gauge | 0.21.0 | | Total voting power of all validators |
|
| consensus\_validators\_power | Gauge | 0.21.0 | | Total voting power of all validators |
|
||||||
@ -32,8 +32,8 @@ The following metrics are available:
|
|||||||
| consensus\_total\_txs | Gauge | 0.21.0 | | Total number of transactions committed |
|
| consensus\_total\_txs | Gauge | 0.21.0 | | Total number of transactions committed |
|
||||||
| consensus\_block\_size\_bytes | Gauge | 0.21.0 | | Block size in bytes |
|
| consensus\_block\_size\_bytes | Gauge | 0.21.0 | | Block size in bytes |
|
||||||
| p2p\_peers | Gauge | 0.21.0 | | Number of peers node's connected to |
|
| p2p\_peers | Gauge | 0.21.0 | | Number of peers node's connected to |
|
||||||
| p2p\_peer\_receive\_bytes\_total | counter | on dev | peer\_id | number of bytes received from a given peer |
|
| p2p\_peer\_receive\_bytes\_total | counter | on dev | peer\_id, chID | number of bytes per channel received from a given peer |
|
||||||
| p2p\_peer\_send\_bytes\_total | counter | on dev | peer\_id | number of bytes sent to a given peer |
|
| p2p\_peer\_send\_bytes\_total | counter | on dev | peer\_id, chID | number of bytes per channel sent to a given peer |
|
||||||
| p2p\_peer\_pending\_send\_bytes | gauge | on dev | peer\_id | number of pending bytes to be sent to a given peer |
|
| p2p\_peer\_pending\_send\_bytes | gauge | on dev | peer\_id | number of pending bytes to be sent to a given peer |
|
||||||
| p2p\_num\_txs | gauge | on dev | peer\_id | number of transactions submitted by each peer\_id |
|
| p2p\_num\_txs | gauge | on dev | peer\_id | number of transactions submitted by each peer\_id |
|
||||||
| p2p\_pending\_send\_bytes | gauge | on dev | peer\_id | amount of data pending to be sent to peer |
|
| p2p\_pending\_send\_bytes | gauge | on dev | peer\_id | amount of data pending to be sent to peer |
|
||||||
|
@ -47,13 +47,13 @@ func PrometheusMetrics(namespace string, labelsAndValues ...string) *Metrics {
|
|||||||
Subsystem: MetricsSubsystem,
|
Subsystem: MetricsSubsystem,
|
||||||
Name: "peer_receive_bytes_total",
|
Name: "peer_receive_bytes_total",
|
||||||
Help: "Number of bytes received from a given peer.",
|
Help: "Number of bytes received from a given peer.",
|
||||||
}, append(labels, "peer_id")).With(labelsAndValues...),
|
}, append(labels, "peer_id", "chID")).With(labelsAndValues...),
|
||||||
PeerSendBytesTotal: prometheus.NewCounterFrom(stdprometheus.CounterOpts{
|
PeerSendBytesTotal: prometheus.NewCounterFrom(stdprometheus.CounterOpts{
|
||||||
Namespace: namespace,
|
Namespace: namespace,
|
||||||
Subsystem: MetricsSubsystem,
|
Subsystem: MetricsSubsystem,
|
||||||
Name: "peer_send_bytes_total",
|
Name: "peer_send_bytes_total",
|
||||||
Help: "Number of bytes sent to a given peer.",
|
Help: "Number of bytes sent to a given peer.",
|
||||||
}, append(labels, "peer_id")).With(labelsAndValues...),
|
}, append(labels, "peer_id", "chID")).With(labelsAndValues...),
|
||||||
PeerPendingSendBytes: prometheus.NewGaugeFrom(stdprometheus.GaugeOpts{
|
PeerPendingSendBytes: prometheus.NewGaugeFrom(stdprometheus.GaugeOpts{
|
||||||
Namespace: namespace,
|
Namespace: namespace,
|
||||||
Subsystem: MetricsSubsystem,
|
Subsystem: MetricsSubsystem,
|
||||||
|
18
p2p/peer.go
18
p2p/peer.go
@ -248,7 +248,11 @@ func (p *peer) Send(chID byte, msgBytes []byte) bool {
|
|||||||
}
|
}
|
||||||
res := p.mconn.Send(chID, msgBytes)
|
res := p.mconn.Send(chID, msgBytes)
|
||||||
if res {
|
if res {
|
||||||
p.metrics.PeerSendBytesTotal.With("peer_id", string(p.ID())).Add(float64(len(msgBytes)))
|
labels := []string{
|
||||||
|
"peer_id", string(p.ID()),
|
||||||
|
"chID", fmt.Sprintf("%#x", chID),
|
||||||
|
}
|
||||||
|
p.metrics.PeerSendBytesTotal.With(labels...).Add(float64(len(msgBytes)))
|
||||||
}
|
}
|
||||||
return res
|
return res
|
||||||
}
|
}
|
||||||
@ -263,7 +267,11 @@ func (p *peer) TrySend(chID byte, msgBytes []byte) bool {
|
|||||||
}
|
}
|
||||||
res := p.mconn.TrySend(chID, msgBytes)
|
res := p.mconn.TrySend(chID, msgBytes)
|
||||||
if res {
|
if res {
|
||||||
p.metrics.PeerSendBytesTotal.With("peer_id", string(p.ID())).Add(float64(len(msgBytes)))
|
labels := []string{
|
||||||
|
"peer_id", string(p.ID()),
|
||||||
|
"chID", fmt.Sprintf("%#x", chID),
|
||||||
|
}
|
||||||
|
p.metrics.PeerSendBytesTotal.With(labels...).Add(float64(len(msgBytes)))
|
||||||
}
|
}
|
||||||
return res
|
return res
|
||||||
}
|
}
|
||||||
@ -369,7 +377,11 @@ func createMConnection(
|
|||||||
// which does onPeerError.
|
// which does onPeerError.
|
||||||
panic(fmt.Sprintf("Unknown channel %X", chID))
|
panic(fmt.Sprintf("Unknown channel %X", chID))
|
||||||
}
|
}
|
||||||
p.metrics.PeerReceiveBytesTotal.With("peer_id", string(p.ID())).Add(float64(len(msgBytes)))
|
labels := []string{
|
||||||
|
"peer_id", string(p.ID()),
|
||||||
|
"chID", fmt.Sprintf("%#x", chID),
|
||||||
|
}
|
||||||
|
p.metrics.PeerReceiveBytesTotal.With(labels...).Add(float64(len(msgBytes)))
|
||||||
reactor.Receive(chID, p, msgBytes)
|
reactor.Receive(chID, p, msgBytes)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user