From 6043002188bc5a71b9a75f387d238428ece5f08b Mon Sep 17 00:00:00 2001 From: Daniel N <2color@users.noreply.github.com> Date: Tue, 19 Nov 2024 10:08:33 +0100 Subject: [PATCH 1/3] fix: use more realistic size buckets for metrics --- routing/http/server/server.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/routing/http/server/server.go b/routing/http/server/server.go index f6d0f1993..fd964cbab 100644 --- a/routing/http/server/server.go +++ b/routing/http/server/server.go @@ -158,9 +158,9 @@ func Handler(svc ContentRouter, opts ...Option) http.Handler { // Create middleware with prometheus recorder mdlw := middleware.New(middleware.Config{ Recorder: metrics.NewRecorder(metrics.Config{ - Registry: server.promRegistry, - Prefix: "delegated_routing_server", - + Registry: server.promRegistry, + Prefix: "delegated_routing_server", + SizeBuckets: prometheus.ExponentialBuckets(100, 4, 8), // [100 400 1600 6400 25600 102400 409600 1.6384e+06] DurationBuckets: []float64{0.1, 0.5, 1, 2, 5, 8, 10, 20, 30}, }), }) From 139b7a58476260a8027735c7d7b19e298563c2d7 Mon Sep 17 00:00:00 2001 From: Daniel N <2color@users.noreply.github.com> Date: Tue, 19 Nov 2024 10:13:23 +0100 Subject: [PATCH 2/3] chore: update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8ed1fb078..7751ee6a3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ The following emojis are used to highlight certain changes: ### Changed - No longer using `github.com/jbenet/goprocess` to avoid requiring in dependents. +- `routing/http/server`: changed default Prometheus buckets for response size and duration to match real world data. ### Removed From b3631993f07e4476c423fcd06e3958fe4686634a Mon Sep 17 00:00:00 2001 From: Marcin Rataj Date: Tue, 19 Nov 2024 17:25:51 +0100 Subject: [PATCH 3/3] docs: update CHANGELOG.md --- CHANGELOG.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7751ee6a3..6d32d0b6d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,13 +16,12 @@ The following emojis are used to highlight certain changes: ### Added -- `routing/http/server`: added Prometheus instrumentation to http delegated routing endpoints. -- `routing/http/server`: added configurable routing timeout (`DefaultRoutingTimeout` being 30s) to prevent indefinite hangs during content/peer routing. Set custom duration via `WithRoutingTimeout`. +- `routing/http/server`: added built-in Prometheus instrumentation to http delegated `/routing/v1/` endpoints, with custom buckets for response size and duration to match real world data observed at [the `delegated-ipfs.dev` instance](https://docs.ipfs.tech/concepts/public-utilities/#delegated-routing). [#718](https://github.com/ipfs/boxo/pull/718) [#724](https://github.com/ipfs/boxo/pull/724) +- `routing/http/server`: added configurable routing timeout (`DefaultRoutingTimeout` being 30s) to prevent indefinite hangs during content/peer routing. Set custom duration via `WithRoutingTimeout`. [#720](https://github.com/ipfs/boxo/pull/720) ### Changed -- No longer using `github.com/jbenet/goprocess` to avoid requiring in dependents. -- `routing/http/server`: changed default Prometheus buckets for response size and duration to match real world data. +- No longer using `github.com/jbenet/goprocess` to avoid requiring in dependents. [#710](https://github.com/ipfs/boxo/pull/710) ### Removed