Skip to content

Commit fecf07e

Browse files
committed
fix: use counter for metrics that only increase over time
1 parent 4b444a1 commit fecf07e

File tree

11 files changed

+18
-18
lines changed

11 files changed

+18
-18
lines changed

Diff for: waku/discovery/waku_discv5.nim

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import
1919
export protocol, waku_enr
2020

2121
declarePublicGauge waku_discv5_discovered, "number of nodes discovered"
22-
declarePublicGauge waku_discv5_errors, "number of waku discv5 errors", ["type"]
22+
declarePublicCounter waku_discv5_errors, "number of waku discv5 errors", ["type"]
2323

2424
logScope:
2525
topics = "waku discv5"

Diff for: waku/discovery/waku_dnsdisc.nim

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import ../waku_core
2323
export client
2424

2525
declarePublicGauge waku_dnsdisc_discovered, "number of nodes discovered"
26-
declarePublicGauge waku_dnsdisc_errors, "number of waku dnsdisc errors", ["type"]
26+
declarePublicCounter waku_dnsdisc_errors, "number of waku dnsdisc errors", ["type"]
2727

2828
logScope:
2929
topics = "waku dnsdisc"

Diff for: waku/node/peer_manager/peer_manager.nim

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ declareCounter waku_peers_dials, "Number of peer dials", ["outcome"]
2929
# TODO: Populate from PeerStore.Source when ready
3030
declarePublicCounter waku_node_conns_initiated,
3131
"Number of connections initiated", ["source"]
32-
declarePublicGauge waku_peers_errors, "Number of peer manager errors", ["type"]
32+
declarePublicCounter waku_peers_errors, "Number of peer manager errors", ["type"]
3333
declarePublicGauge waku_connected_peers,
3434
"Number of physical connections per direction and protocol",
3535
labels = ["direction", "protocol"]

Diff for: waku/node/waku_node.nim

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ declarePublicHistogram waku_histogram_message_size,
6262

6363
declarePublicGauge waku_version,
6464
"Waku version info (in git describe format)", ["version"]
65-
declarePublicGauge waku_node_errors, "number of wakunode errors", ["type"]
65+
declarePublicCounter waku_node_errors, "number of wakunode errors", ["type"]
6666
declarePublicGauge waku_lightpush_peers, "number of lightpush peers"
6767
declarePublicGauge waku_filter_peers, "number of filter peers"
6868
declarePublicGauge waku_store_peers, "number of store peers"

Diff for: waku/waku_archive/archive_metrics.nim

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
import metrics
44

55
declarePublicGauge waku_archive_messages, "number of historical messages", ["type"]
6-
declarePublicGauge waku_archive_errors, "number of store protocol errors", ["type"]
7-
declarePublicGauge waku_archive_queries, "number of store queries received"
6+
declarePublicCounter waku_archive_errors, "number of store protocol errors", ["type"]
7+
declarePublicCounter waku_archive_queries, "number of store queries received"
88
declarePublicHistogram waku_archive_insert_duration_seconds,
99
"message insertion duration"
1010
declarePublicHistogram waku_archive_query_duration_seconds, "history query duration"

Diff for: waku/waku_archive_legacy/archive_metrics.nim

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import metrics
77

88
declarePublicGauge waku_legacy_archive_messages,
99
"number of historical messages", ["type"]
10-
declarePublicGauge waku_legacy_archive_errors,
10+
declarePublicCounter waku_legacy_archive_errors,
1111
"number of store protocol errors", ["type"]
12-
declarePublicGauge waku_legacy_archive_queries, "number of store queries received"
12+
declarePublicCounter waku_legacy_archive_queries, "number of store queries received"
1313
declarePublicHistogram waku_legacy_archive_insert_duration_seconds,
1414
"message insertion duration"
1515
declarePublicHistogram waku_legacy_archive_query_duration_seconds,

Diff for: waku/waku_filter_v2/protocol_metrics.nim

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import metrics
44

55
export metrics
66

7-
declarePublicGauge waku_filter_errors, "number of filter protocol errors", ["type"]
8-
declarePublicGauge waku_filter_requests,
7+
declarePublicCounter waku_filter_errors, "number of filter protocol errors", ["type"]
8+
declarePublicCounter waku_filter_requests,
99
"number of filter subscribe requests received", ["type"]
1010
declarePublicGauge waku_filter_subscriptions, "number of subscribed filter clients"
1111
declarePublicHistogram waku_filter_request_duration_seconds,

Diff for: waku/waku_lightpush/protocol_metrics.nim

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
import metrics
44

5-
declarePublicGauge waku_lightpush_v3_errors,
5+
declarePublicCounter waku_lightpush_v3_errors,
66
"number of lightpush protocol errors", ["type"]
7-
declarePublicGauge waku_lightpush_v3_messages,
7+
declarePublicCounter waku_lightpush_v3_messages,
88
"number of lightpush messages received", ["type"]
99

1010
# Error types (metric label values)

Diff for: waku/waku_lightpush_legacy/protocol_metrics.nim

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
import metrics
44

5-
declarePublicGauge waku_lightpush_errors,
5+
declarePublicCounter waku_lightpush_errors,
66
"number of lightpush protocol errors", ["type"]
7-
declarePublicGauge waku_lightpush_messages,
7+
declarePublicCounter waku_lightpush_messages,
88
"number of lightpush messages received", ["type"]
99

1010
# Error types (metric label values)

Diff for: waku/waku_store/protocol_metrics.nim

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
import metrics
44

5-
declarePublicGauge waku_store_errors, "number of store protocol errors", ["type"]
6-
declarePublicGauge waku_store_queries, "number of store queries received"
5+
declarePublicCounter waku_store_errors, "number of store protocol errors", ["type"]
6+
declarePublicCounter waku_store_queries, "number of store queries received"
77

88
## "query-db-time" phase considers the time when node performs the query to the database.
99
## "send-store-resp-time" phase is the time when node writes the store response to the store-client.

Diff for: waku/waku_store_legacy/protocol_metrics.nim

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
import metrics
44

5-
declarePublicGauge waku_legacy_store_errors,
5+
declarePublicCounter waku_legacy_store_errors,
66
"number of legacy store protocol errors", ["type"]
7-
declarePublicGauge waku_legacy_store_queries, "number of legacy store queries received"
7+
declarePublicCounter waku_legacy_store_queries, "number of legacy store queries received"
88

99
## "query-db-time" phase considers the time when node performs the query to the database.
1010
## "send-store-resp-time" phase is the time when node writes the store response to the store-client.

0 commit comments

Comments
 (0)