Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sinatra/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
9 changes: 5 additions & 4 deletions sinatra/app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down