Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Grafana panel for monitoring remaining RLN proofs per epoch #3178

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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/$@" && \
Expand Down
17 changes: 15 additions & 2 deletions waku/waku_rln_relay/protocol_metrics.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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",
["type"]
)

declarePublicGauge(
waku_rln_proofs_remaining,
"number of RLN proofs remaining in the budget for current epoch",
["type"]
)

type RLNMetricsLogger = proc() {.gcsafe, raises: [Defect].}

proc getRlnMetricsLogger*(): RLNMetricsLogger =
Expand Down Expand Up @@ -90,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
Loading