From 39b97093e10f06b8267848754e1b128f7ba239b9 Mon Sep 17 00:00:00 2001 From: Aleksandergreg Date: Mon, 23 Jun 2025 19:47:35 +0200 Subject: [PATCH 1/2] Made our HTTP response total to track different HTTP responses --- sinatra/app.rb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sinatra/app.rb b/sinatra/app.rb index 93480b6..1d11f32 100644 --- a/sinatra/app.rb +++ b/sinatra/app.rb @@ -165,9 +165,10 @@ ################################################################################ # Counter for total HTTP responses served -APP_HTTP_RESPONSES_TOTAL = PROMETHEUS.counter( - :app_http_responses_total, - docstring: 'Total number of HTTP responses sent by the application.' +HTTP_RESPONSES_TOTAL = PROMETHEUS.counter( + :http_responses_total, + docstring: 'Total number of HTTP responses sent.', + labels: [:code, :path] ) # Histogram for request duration in seconds (or milliseconds) @@ -225,7 +226,7 @@ pass if @skip_metrics # Increment response counter regardless of duration calculation success - APP_HTTP_RESPONSES_TOTAL.increment + HTTP_RESPONSES_TOTAL.increment(labels: { code: response.status, path: request.path_info }) # Record duration if start time was captured if @request_start_time From 9ff6d3c1b7079dd7fee653db76a10344c9bb0b41 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 24 Jun 2025 07:08:06 +0000 Subject: [PATCH 2/2] Bump rack from 3.1.12 to 3.1.16 in /sinatra Bumps [rack](https://github.com/rack/rack) from 3.1.12 to 3.1.16. - [Release notes](https://github.com/rack/rack/releases) - [Changelog](https://github.com/rack/rack/blob/main/CHANGELOG.md) - [Commits](https://github.com/rack/rack/compare/v3.1.12...v3.1.16) --- updated-dependencies: - dependency-name: rack dependency-version: 3.1.16 dependency-type: indirect ... Signed-off-by: dependabot[bot] --- sinatra/Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sinatra/Gemfile.lock b/sinatra/Gemfile.lock index 6764747..35532ce 100644 --- a/sinatra/Gemfile.lock +++ b/sinatra/Gemfile.lock @@ -73,7 +73,7 @@ GEM puma (6.6.0) nio4r (~> 2.0) racc (1.8.1) - rack (3.1.12) + rack (3.1.16) rack-protection (4.1.1) base64 (>= 0.1.0) logger (>= 1.6.0)