Conversation
provider/reprovider.go
Outdated
| provideCounter: metrics.New("ipfs.boxo.provider.provideCount", "Number of provides since node is running").Counter(), | ||
| reprovideCounter: metrics.New("ipfs.boxo.provider.reprovideCount", "Number of reprovides since node is running").Counter(), |
There was a problem hiding this comment.
Regarding the metric name... I believe all metrics in boxo use metrics.NewCtx and figure out their metric prefix from a context.
In HTTP I hardcoded that prefix though, which probably wasn't intelligent:
boxo/bitswap/network/httpnet/metrics.go
Line 75 in 6793986
If you can get a context, then it doesn't hurt using it. And otherwise, the metric name would, based on prior art, be provider_provide_count and reprovider_reprovide_count.
(I think, I'm not very sure about this. I am more sure that the ipfs.boxo prefix is probably not part of any existing metric).
There was a problem hiding this comment.
Thanks for the heads up. I got confused with the doc.
I followed the same approach as you did in
boxo/bitswap/network/httpnet/metrics.go
Line 75 in 6793986
Adding two metric counters: