gateway: separate metrics for Signed IPNS from DNSLink
- Dominant language
- Go
- Stars
- 316
- Forks
- 163
- Avg merge
- 4d 12h
- Merged PRs (30d)
- 8
Description
> Extracted from https://github.com/ipfs/kubo/issues/9927#issuecomment-1623791077
Currently, we have basic request counts and durations for `gateway=ipfs` and `gateway=ipns` namespaces in the form of [boxo/gateway/metrics.go](https://github.com/ipfs/boxo/blob/v0.10.2/gateway/metrics.go#L184) metrics:
```ini
# HELP ipfs_http_gw_get_duration_seconds The time to GET a successful response to a request (all content types).
# TYPE ipfs_http_gw_get_duration_seconds histogram
ipfs_http_gw_get_duration_seconds_bucket{gateway="ipfs",le="0.05"} 8
[..]
ipfs_http_gw_get_duration_seconds_bucket{gateway="ipfs",le="1920"} 11
ipfs_http_gw_get_duration_seconds_bucket{gateway="ipfs",le="+Inf"} 11
ipfs_http_gw_get_duration_seconds_sum{gateway="ipfs"} 1.185360469
```
### Problem
- `/ipns` supports both DNSLink and Signed IPNS records – we have no visibility what is the % of each
- we measure success only, have no visibility into % of IPNS record failures vs DNSLink failures
### Solution
#### Requirements
TBD, initial requirements
- we need dedicated metric for each type of `/ipns/` request
- `signed_ipns`
- `dnslink`
- we need to be able to tell:
- how many requests were sent by clients
- how many requests were successful vs errored
- how long success / error takes? (could be precomputed P50/P95)
- we need to make sure this is visible in Thunderdome testing so we can catch regressions here during release phase
#### Open questions
- do we have a separate metrics for success/failure, or do we have single one with success/error attribute?
- do we do histogram with predefined duration buckets and implicit counter (like `ipfs_http_gw_get_duration_seconds`)?
- or maybe, instead of picking arbitrary duration buckets (like we have in legacy metrics) we should have P50, P75, P95, P99 Objectives, like we do [here](https://github.com/ipfs/bifrost-gateway/blob/v0.0.12/metrics.go#L22)?
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with gateway/metrics.go in the linked Boxo reference and compare its existing gateway metrics with bifrost-gateway/metrics.go. Resolve the open questions about labels, success/error accounting, and duration measurements, then determine how the metrics will be exposed in Thunderdome testing. Done means signed IPNS and DNSLink requests have separately observable request, outcome, and duration data.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- observability
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100