Skip to content

Commit

Permalink
docs: improved metrics descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
lidel committed Feb 8, 2023
1 parent 8fcb67e commit 15b8f7c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions examples/gateway/car/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func main() {
},
}

// Creates a mus to serve the prometheus metrics alongside the gateway. This
// Creates a mux to serve the prometheus metrics alongside the gateway. This
// step is optional and only required if you need or want to access the metrics.
// You may also decide to expose the metrics on a different path, or port.
mux := http.NewServeMux()
Expand All @@ -70,7 +70,7 @@ func main() {
handler = gateway.WithHostname(mux, gwAPI, publicGateways, noDNSLink)

log.Printf("Listening on http://localhost:%d", *port)
log.Printf("Prometheus metrics available on http://127.0.0.1:%d/debug/metrics/prometheus", *port)
log.Printf("Metrics available at http://127.0.0.1:%d/debug/metrics/prometheus", *port)
for _, cid := range roots {
log.Printf("Hosting CAR root at http://localhost:%d/ipfs/%s", *port, cid.String())
}
Expand Down
6 changes: 4 additions & 2 deletions examples/gateway/proxy/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func main() {
},
}

// Creates a mus to serve the prometheus metrics alongside the gateway. This
// Creates a mux to serve the prometheus metrics alongside the gateway. This
// step is optional and only required if you need or want to access the metrics.
// You may also decide to expose the metrics on a different path, or port.
mux := http.NewServeMux()
Expand All @@ -68,7 +68,9 @@ func main() {
handler = gateway.WithHostname(mux, gwAPI, publicGateways, noDNSLink)

log.Printf("Listening on http://localhost:%d", *port)
log.Printf("Prometheus metrics available on http://127.0.0.1:%d/debug/metrics/prometheus", *port)
log.Printf("Try loading an image: http://localhost:%d/ipfs/bafybeigdyrzt5sfp7udm7hu76uh7y26nf3efuylqabf3oclgtqy55fbzdi", *port)
log.Printf("Try browsing Wikipedia snapshot: http://localhost:%d/ipfs/bafybeiaysi4s6lnjev27ln5icwm6tueaw2vdykrtjkwiphwekaywqhcjze", *port)
log.Printf("Metrics available at http://127.0.0.1:%d/debug/metrics/prometheus", *port)
if err := http.ListenAndServe(":"+strconv.Itoa(*port), handler); err != nil {
log.Fatal(err)
}
Expand Down
4 changes: 2 additions & 2 deletions gateway/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ func newHandler(c Config, api API) *handler {
// Generic: time it takes to execute a successful gateway request (all request types)
getMetric: newHistogramMetric(
"gw_get_duration_seconds",
"The time to GET a successful gateway request (all request types).",
"The time to GET a successful response to a request (all content types).",
),
// UnixFS: time it takes to return a file
unixfsFileGetMetric: newHistogramMetric(
Expand Down Expand Up @@ -282,7 +282,7 @@ func newHandler(c Config, api API) *handler {
unixfsGetMetric: newSummaryMetric( // TODO: remove?
// (deprecated, use firstContentBlockGetMetric instead)
"unixfs_get_latency_seconds",
"The time to receive the first UnixFS node on a GET from the gateway.",
"DEPRECATED: does not do what you think, use gw_first_content_block_get_latency_seconds instead.",
),
}
return i
Expand Down

0 comments on commit 15b8f7c

Please sign in to comment.