repo: remove nodeid from the metrics
It was there because old collector was using debug env to report metrics and there keys have to very unique. As we are reporting it now to prometheus it is better to have it under the same key as we had before. License: MIT Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
Jakub Sztandera committed
Dec 13, 2016 at 22:32 UTC
4016f4031127ca4d1250fb81b8ea01e270333405
2 files changed
+5
-13
repo/fsrepo/defaultds.go
+4
-2
@@ -7,11 +7,12 @@ import (
7
repo "github.com/ipfs/go-ipfs/repo"
8
config "github.com/ipfs/go-ipfs/repo/config"
9
"github.com/ipfs/go-ipfs/thirdparty/dir"
10
+
11
ds "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore"
12
mount "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore/syncmount"
13
levelds "gx/ipfs/QmaHHmfEozrrotyhyN44omJouyuEtx6ahddqV6W5yRaUSQ/go-ds-leveldb"
14
ldbopts "gx/ipfs/QmbBhyDKsY4mbY6xsKt3qu9Y7FPvMJ6qbD8AMjYYvPRw1g/goleveldb/leveldb/opt"
14
- "gx/ipfs/QmbUSMTQtK9GRrUbD4ngqJwSzHsquUc8nyDubRWp4vPybH/go-ds-measure"
15
+ measure "gx/ipfs/QmbUSMTQtK9GRrUbD4ngqJwSzHsquUc8nyDubRWp4vPybH/go-ds-measure"
16
"gx/ipfs/Qmbx2KUs8mUbDUiiESzC1ms7mdmh4pRu8X1V1tffC46M4n/go-ds-flatfs"
17
)
18
@@ -48,7 +49,8 @@ func openDefaultDatastore(r *FSRepo) (repo.Datastore, error) {
49
// the tests pass in a zero Config; cope with it
50
id = fmt.Sprintf("uninitialized_%p", r)
51
}
51
- prefix := "fsrepo." + id + ".datastore."
52
+
53
+ prefix := "ipfs.fsrepo.datastore."
54
metricsBlocks := measure.New(prefix+"blocks", blocksDS)
55
metricsLevelDB := measure.New(prefix+"leveldb", leveldbDS)
56
mountDS := mount.New([]mount.Mount{
repo/fsrepo/fsrepo.go
+1
-11
@@ -365,17 +365,7 @@ func (r *FSRepo) openDatastore() error {
365
}
366
367
// Wrap it with metrics gathering
368
- //
369
- // Add our PeerID to metrics paths to keep them unique
370
- //
371
- // As some tests just pass a zero-value Config to fsrepo.Init,
372
- // cope with missing PeerID.
373
- id := r.config.Identity.PeerID
374
- if id == "" {
375
- // the tests pass in a zero Config; cope with it
376
- id = fmt.Sprintf("uninitialized_%p", r)
377
- }
378
- prefix := "fsrepo." + id + ".datastore"
368
+ prefix := "ipfs.fsrepo.datastore"
369
r.ds = measure.New(prefix, r.ds)
370
371
return nil