Skip to content

Commit

Permalink
Fix rubocop warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
richardTowers committed Oct 3, 2023
1 parent 20f4d51 commit 0f097b1
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/govuk_app_config/govuk_prometheus_exporter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@
require "prometheus_exporter/middleware"

module GovukPrometheusExporter

#
# See https://github.com/discourse/prometheus_exporter/pull/293
#
# RailsMiddleware can be removed and replaced with the default middleware if
# that PR is merged / released
#
class RailsMiddleware < PrometheusExporter::Middleware
def default_labels(env, result)
def default_labels(env, _result)
controller_instance = env["action_controller.instance"]
action = controller = nil
if controller_instance
Expand All @@ -26,13 +25,13 @@ def default_labels(env, result)
end
{
action: action || "other",
controller: controller || "other"
controller: controller || "other",
}
end
end

class SinatraMiddleware < PrometheusExporter::Middleware
def default_labels(env, result)
def default_labels(_env, _result)
# The default prometheus exporter middleware uses the controller and
# action as labels. These aren't meaningful in Sinatra applications, and
# other options (such as request.path_info) have potentially very high
Expand Down

0 comments on commit 0f097b1

Please sign in to comment.