@@ -14,7 +14,7 @@ import (
14
14
promhttp "github.com/prometheus/client_golang/prometheus/promhttp"
15
15
)
16
16
17
- // This adds the scraping endpoint which Prometheus uses to fetch metrics.
17
+ // MetricsScrapingOption adds the scraping endpoint which Prometheus uses to fetch metrics.
18
18
func MetricsScrapingOption (path string ) ServeOption {
19
19
return func (n * core.IpfsNode , _ net.Listener , mux * http.ServeMux ) (* http.ServeMux , error ) {
20
20
mux .Handle (path , promhttp .HandlerFor (prometheus .DefaultGatherer , promhttp.HandlerOpts {}))
@@ -51,7 +51,7 @@ func MetricsOpenCensusCollectionOption() ServeOption {
51
51
}
52
52
}
53
53
54
- // This adds collection of net/http-related metrics
54
+ // MetricsCollectionOption adds collection of net/http-related metrics.
55
55
func MetricsCollectionOption (handlerName string ) ServeOption {
56
56
return func (_ * core.IpfsNode , _ net.Listener , mux * http.ServeMux ) (* http.ServeMux , error ) {
57
57
// Adapted from github.com/prometheus/client_golang/prometheus/http.go
@@ -130,14 +130,10 @@ func MetricsCollectionOption(handlerName string) ServeOption {
130
130
var (
131
131
peersTotalMetric = prometheus .NewDesc (
132
132
prometheus .BuildFQName ("ipfs" , "p2p" , "peers_total" ),
133
- "Number of connected peers" , []string {"transport" }, nil )
134
-
135
- unixfsGetMetric = prometheus .NewSummaryVec (prometheus.SummaryOpts {
136
- Namespace : "ipfs" ,
137
- Subsystem : "http" ,
138
- Name : "unixfs_get_latency_seconds" ,
139
- Help : "The time till the first block is received when 'getting' a file from the gateway." ,
140
- }, []string {"namespace" })
133
+ "Number of connected peers" ,
134
+ []string {"transport" },
135
+ nil ,
136
+ )
141
137
)
142
138
143
139
type IpfsNodeCollector struct {
0 commit comments