mirror of https://github.com/waku-org/nwaku.git
chore: publish nwaku version to metric (#1234)
This commit is contained in:
parent
e07f422854
commit
8a184e208c
|
@ -8,9 +8,6 @@ import
|
||||||
logScope:
|
logScope:
|
||||||
topics = "debug api"
|
topics = "debug api"
|
||||||
|
|
||||||
const
|
|
||||||
git_version {.strdefine.} = "n/a"
|
|
||||||
|
|
||||||
proc installDebugApiHandlers*(node: WakuNode, rpcsrv: RpcServer) =
|
proc installDebugApiHandlers*(node: WakuNode, rpcsrv: RpcServer) =
|
||||||
|
|
||||||
## Debug API version 1 definitions
|
## Debug API version 1 definitions
|
||||||
|
|
|
@ -39,6 +39,7 @@ export
|
||||||
when defined(rln) or defined(rlnzerokit):
|
when defined(rln) or defined(rlnzerokit):
|
||||||
import ../protocol/waku_rln_relay/waku_rln_relay_utils
|
import ../protocol/waku_rln_relay/waku_rln_relay_utils
|
||||||
|
|
||||||
|
declarePublicGauge waku_version, "Waku version info (in git describe format)", ["version"]
|
||||||
declarePublicCounter waku_node_messages, "number of messages received", ["type"]
|
declarePublicCounter waku_node_messages, "number of messages received", ["type"]
|
||||||
declarePublicGauge waku_node_filters, "number of content filter subscriptions"
|
declarePublicGauge waku_node_filters, "number of content filter subscriptions"
|
||||||
declarePublicGauge waku_node_errors, "number of wakunode errors", ["type"]
|
declarePublicGauge waku_node_errors, "number of wakunode errors", ["type"]
|
||||||
|
@ -46,6 +47,9 @@ declarePublicGauge waku_node_errors, "number of wakunode errors", ["type"]
|
||||||
logScope:
|
logScope:
|
||||||
topics = "wakunode"
|
topics = "wakunode"
|
||||||
|
|
||||||
|
# Git version in git describe format (defined compile time)
|
||||||
|
const git_version* {.strdefine.} = "n/a"
|
||||||
|
|
||||||
# Default clientId
|
# Default clientId
|
||||||
const clientId* = "Nimbus Waku v2 node"
|
const clientId* = "Nimbus Waku v2 node"
|
||||||
|
|
||||||
|
@ -759,6 +763,8 @@ proc start*(node: WakuNode) {.async.} =
|
||||||
##
|
##
|
||||||
## Status: Implemented.
|
## Status: Implemented.
|
||||||
|
|
||||||
|
waku_version.set(1, labelValues=[git_version])
|
||||||
|
|
||||||
## NB: careful when moving this. We need to start the switch with the bind address
|
## NB: careful when moving this. We need to start the switch with the bind address
|
||||||
## BEFORE updating with announced addresses for the sake of identify.
|
## BEFORE updating with announced addresses for the sake of identify.
|
||||||
await node.switch.start()
|
await node.switch.start()
|
||||||
|
@ -1185,7 +1191,6 @@ when isMainModule:
|
||||||
|
|
||||||
# if called with --version, print the version and quit
|
# if called with --version, print the version and quit
|
||||||
if conf.version:
|
if conf.version:
|
||||||
const git_version {.strdefine.} = "n/a"
|
|
||||||
echo "version / git commit hash: ", git_version
|
echo "version / git commit hash: ", git_version
|
||||||
quit(QuitSuccess)
|
quit(QuitSuccess)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue