Skip to content

Commit

Permalink
docs: add some metrics examples
Browse files Browse the repository at this point in the history
  • Loading branch information
avtakkar committed Apr 1, 2024
1 parent 4d8c257 commit 7340433
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 2 deletions.
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,35 @@ kubectl --context=$CLUSTER_CONTEXT -n peerd-ns logs -l app=peerd -f
Peerd exposes metrics on the `/metrics/prometheus` endpoint. Mmetrics are prefixed with `peerd_`. `libp2p` metrics are
prefixed with `libp2p_`.

#### Examples on a 5 node AKS cluster, node sizes: `Standard_D2s_v3` and `Standard_D8ds_v5`

1. How long does it take for a node to find a peer that has a key?

```promql
sum(histogram_quantile(0.95, peerd_peer_discovery_duration_seconds_bucket)) by (self)
```
| Node | Time (s) |
| ----------- | -------- |
| peerd-xkjm | 0.0156 |
| peerd-j6kf4 | 0.0619 |
| peerd-pj68b | 0.0451 |
| peerd-v8ndj | 0.0054 |
| peerd-8csx9 | 0.00834 |
2. Peer download speed distribution?
```promql
sum(histogram_quantile(0.95, peerd_peer_response_speed_mib_per_second_bucket)) by (self)
```
| Node | Throughput (MiB/s) |
| ----------- | ------------------ |
| peerd-xkjm | 173 |
| peerd-j6kf4 | 260 |
| peerd-pj68b | 118 |
| peerd-v8ndj | 333 |
| peerd-8csx9 | 324 |
## Features
Expand Down
2 changes: 1 addition & 1 deletion build/package/peerd-helm/templates/rbac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ metadata:
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: peerd-manager-role
name: {{ include "peerd.name" . }}-manager-role
subjects:
- kind: ServiceAccount
name: {{ include "peerd.serviceAccountName" . }}
Expand Down
2 changes: 1 addition & 1 deletion internal/metrics/prometheus.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func NewPromMetrics(reg prometheus.Registerer) *promMetrics {
reg.MustRegister(peerResponseDurationHist)

upstreamResponseDurationHist := prometheus.NewHistogramVec(prometheus.HistogramOpts{
Name: "peerd_upstream_response_speed_mib_per_seconds",
Name: "peerd_upstream_response_speed_mib_per_second",
Help: "Speed of upstream response in Mib per second.",
Buckets: prometheus.LinearBuckets(1, 15, 200),
}, []string{"self", "hostname", "op"})
Expand Down

0 comments on commit 7340433

Please sign in to comment.