From d380ae46a94bd8c9b520ec4b6cc0a5e8df6b8d83 Mon Sep 17 00:00:00 2001 From: DarshanBPatel Date: Wed, 20 Nov 2024 13:49:59 +0530 Subject: [PATCH 1/2] chore: add required metrices for grafana --- waku/waku_rln_relay/protocol_metrics.nim | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/waku/waku_rln_relay/protocol_metrics.nim b/waku/waku_rln_relay/protocol_metrics.nim index ab9d119a3a..901f0568ae 100644 --- a/waku/waku_rln_relay/protocol_metrics.nim +++ b/waku/waku_rln_relay/protocol_metrics.nim @@ -62,6 +62,19 @@ declarePublicGauge( "time taken to import membership credentials", ) +# rln proof metrics +declarePublicCounter( + waku_rln_proofs_generated_total, + "number of RLN proofs generated by this light client", + ["client_id"] +) + +declarePublicGauge( + waku_rln_proofs_remaining, + "number of RLN proofs remaining in the budget for current epoch", + ["client_id"] +) + type RLNMetricsLogger = proc() {.gcsafe, raises: [Defect].} proc getRlnMetricsLogger*(): RLNMetricsLogger = From d5063787927a51e1941d37e97ccdf1d607d77cf9 Mon Sep 17 00:00:00 2001 From: DarshanBPatel Date: Fri, 22 Nov 2024 16:36:52 +0530 Subject: [PATCH 2/2] chore: update offer metrics description --- Makefile | 2 +- waku/waku_rln_relay/protocol_metrics.nim | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 3e285a2af6..7ea60a4453 100644 --- a/Makefile +++ b/Makefile @@ -229,7 +229,7 @@ testwaku: | build deps anvil librln wakunode2: | build deps librln echo -e $(BUILD_MSG) "build/$@" && \ - $(ENV_SCRIPT) nim wakunode2 $(NIM_PARAMS) waku.nims + $(ENV_SCRIPT) nim wakunode2 -d:metrics $(NIM_PARAMS) waku.nims benchmarks: | build deps librln echo -e $(BUILD_MSG) "build/$@" && \ diff --git a/waku/waku_rln_relay/protocol_metrics.nim b/waku/waku_rln_relay/protocol_metrics.nim index 901f0568ae..c9cf911ce9 100644 --- a/waku/waku_rln_relay/protocol_metrics.nim +++ b/waku/waku_rln_relay/protocol_metrics.nim @@ -31,7 +31,7 @@ declarePublicHistogram( ) declarePublicCounter( waku_rln_errors_total, - "number of errors detected while operating the rln relay", + "number of errors detected while operating the rln relay - 1 - 1 - 1 - 1 - 1", ["type"], ) declarePublicCounter( @@ -66,13 +66,13 @@ declarePublicGauge( declarePublicCounter( waku_rln_proofs_generated_total, "number of RLN proofs generated by this light client", - ["client_id"] + ["type"] ) declarePublicGauge( waku_rln_proofs_remaining, "number of RLN proofs remaining in the budget for current epoch", - ["client_id"] + ["type"] ) type RLNMetricsLogger = proc() {.gcsafe, raises: [Defect].} @@ -103,10 +103,10 @@ proc getRlnMetricsLogger*(): RLNMetricsLogger = let freshProofCount = parseAndAccumulate(waku_rln_proof_verification_total, cumulativeProofs) + info "Total errors", count = freshErrorCount info "Total messages", count = freshMsgCount info "Total spam messages", count = freshSpamCount info "Total invalid messages", count = freshInvalidMsgCount info "Total valid messages", count = freshValidMsgCount - info "Total errors", count = freshErrorCount info "Total proofs verified", count = freshProofCount return logMetrics