Skip to content

Commit

Permalink
Add libp2p label to chronicles log topics (#794)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lorenzo Delgado authored Nov 4, 2022
1 parent a3e9d1e commit f95eda8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions libp2p/protocols/pubsub/gossipsub/behavior.nim
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ import ".."/[pubsubpeer, peertable, timedcache, mcache, floodsub, pubsub]
import "../rpc"/[messages]
import "../../.."/[peerid, multiaddress, utility, switch, routing_record, signed_envelope, utils/heartbeat]

logScope:
topics = "libp2p gossipsub"

declareGauge(libp2p_gossipsub_cache_window_size, "the number of messages in the cache")
declareGauge(libp2p_gossipsub_peers_per_topic_mesh, "gossipsub peers per topic in mesh", labels = ["topic"])
declareGauge(libp2p_gossipsub_peers_per_topic_fanout, "gossipsub peers per topic in fanout", labels = ["topic"])
Expand Down
3 changes: 3 additions & 0 deletions libp2p/protocols/pubsub/gossipsub/scoring.nim
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ import "."/[types]
import ".."/[pubsubpeer]
import "../../.."/[peerid, multiaddress, utility, switch, utils/heartbeat]

logScope:
topics = "libp2p gossipsub"

declareGauge(libp2p_gossipsub_peers_scores, "the scores of the peers in gossipsub", labels = ["agent"])
declareCounter(libp2p_gossipsub_bad_score_disconnection, "the number of peers disconnected by gossipsub", labels = ["agent"])
declareGauge(libp2p_gossipsub_peers_score_firstMessageDeliveries, "Detailed gossipsub scoring metric", labels = ["agent"])
Expand Down
2 changes: 1 addition & 1 deletion libp2p/protocols/pubsub/rpc/protobuf.nim
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import messages,


logScope:
topics = "pubsubprotobuf"
topics = "libp2p pubsubprotobuf"

when defined(libp2p_protobuf_metrics):
import metrics
Expand Down

0 comments on commit f95eda8

Please sign in to comment.