You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(routing/http): return 200 for empty results per IPIP-513 (#1032)
* feat: implement IPIP-513 for routing v1 endpoints
return HTTP 200 with empty results instead of 404 when no
records found, while maintaining backward compatibility
in clients to handle both response codes
Fixes: #1024
Spec: ipfs/specs#513
* docs: add IPIP-513 changes to changelog
* fix: correct off-by-one error in routing_http_client_length metric
the metric now correctly reports:
- 0 for empty results (instead of 1)
- n for n results (instead of n+1)
* feat: add metrics for IPNS operations
- GetIPNS now records latency, status code, and length (0 or 1)
- PutIPNS now records latency and status code
- uses consistent pattern with httpReq.Host for host extraction
* docs: explain histogram bucket interpretation for metrics
- document how OpenCensus bucket selection works (value < boundary)
- explain mapping to Prometheus le buckets for both latency and length
- provide examples of how to extract meaningful data from metrics
* feat: add simple counter metrics for requests and positive responses
- routing_http_client_requests_total: counts all requests including errors
- routing_http_client_positive_responses_total: counts requests with 1+ results
- avoids confusing histogram bucket math for common queries
- documented with simple Grafana query examples
* fix: drain response body for connection reuse in 404 cases
ensure http connection can be reused by draining response body before closing
Copy file name to clipboardExpand all lines: CHANGELOG.md
+10Lines changed: 10 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,6 +23,10 @@ The following emojis are used to highlight certain changes:
23
23
24
24
### Changed
25
25
26
+
-`routing/http`: ✨ Delegated Routing V1 HTTP endpoints now return 200 with empty results instead of 404 when no records are found, per [IPIP-513](https://github.com/ipfs/specs/pull/513) ([#1024](https://github.com/ipfs/boxo/issues/1024))
27
+
- Server endpoints (`/routing/v1/providers/{cid}`, `/routing/v1/peers/{peer-id}`, `/routing/v1/ipns/{name}`) return HTTP 200 with empty JSON arrays or appropriate content types for empty results
28
+
- Client maintains backward compatibility by treating both 200 with empty results and 404 as "no records found"
29
+
- IPNS endpoint distinguishes between valid records (Content-Type: `application/vnd.ipfs.ipns-record`) and no record found (any other content type)
26
30
-`verifcid`: 🛠 Enhanced Allowlist interface with per-hash size limits ([#1018](https://github.com/ipfs/boxo/pull/1018))
27
31
- Expanded `Allowlist` interface with `MinDigestSize(code uint64)` and `MaxDigestSize(code uint64)` methods for per-hash function size validation
28
32
- Added public constants: `DefaultMinDigestSize` (20 bytes), `DefaultMaxDigestSize` (128 bytes for cryptographic hashes), and `DefaultMaxIdentityDigestSize` (128 bytes for identity CIDs)
@@ -37,6 +41,12 @@ The following emojis are used to highlight certain changes:
37
41
38
42
### Fixed
39
43
44
+
-`routing/http/client`:
45
+
- Fixed off-by-one error in `routing_http_client_length` metric - the metric now correctly reports 0 for empty results instead of 1
46
+
- Added metrics for IPNS operations (`GetIPNS` and `PutIPNS`) - these now report latency, status code, and result count (0 or 1 for GetIPNS)
-`routing_http_client_requests_total` - total requests including errors
49
+
-`routing_http_client_positive_responses_total` - requests that returned at least 1 result
40
50
-`ipld/unixfs/mod`:
41
51
-`DagModifier` now correctly preserves raw node codec when modifying data under the chunker threshold, instead of incorrectly forcing everything to dag-pb
42
52
-`DagModifier` prevents creation of identity CIDs exceeding `verifcid.DefaultMaxIdentityDigestSize` limit when modifying data, automatically switching to proper cryptographic hash while preserving small identity CIDs
0 commit comments