Skip to content

Commit

Permalink
feat: register DHT prometheus metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
guseggert committed May 5, 2023
1 parent a6f446a commit 46f9a15
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cmd/ipfs/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"time"

multierror "github.com/hashicorp/go-multierror"
"go.opencensus.io/stats/view"

version "github.com/ipfs/kubo"
utilmain "github.com/ipfs/kubo/cmd/ipfs/util"
Expand All @@ -30,6 +31,7 @@ import (
fsrepo "github.com/ipfs/kubo/repo/fsrepo"
"github.com/ipfs/kubo/repo/fsrepo/migrations"
"github.com/ipfs/kubo/repo/fsrepo/migrations/ipfsfetcher"
dhtmetrics "github.com/libp2p/go-libp2p-kad-dht/metrics"
p2pcrypto "github.com/libp2p/go-libp2p/core/crypto"
pnet "github.com/libp2p/go-libp2p/core/pnet"
sockets "github.com/libp2p/go-socket-activation"
Expand Down Expand Up @@ -435,6 +437,7 @@ func daemonFunc(req *cmds.Request, re cmds.ResponseEmitter, env cmds.Environment
default:
return fmt.Errorf("unrecognized routing option: %s", routingOption)
}
view.Register(dhtmetrics.DefaultViews...)

agentVersionSuffixString, _ := req.Options[agentVersionSuffix].(string)
if agentVersionSuffixString != "" {
Expand Down

0 comments on commit 46f9a15

Please sign in to comment.