diff --git a/lib/prometheus_exporter/middleware.rb b/lib/prometheus_exporter/middleware.rb index 8995acb..bfd290d 100644 --- a/lib/prometheus_exporter/middleware.rb +++ b/lib/prometheus_exporter/middleware.rb @@ -78,7 +78,7 @@ def default_labels(env, result) action = controller = nil if controller_instance action = controller_instance.action_name - controller = controller_instance.controller_name + controller = controller_instance.controller_path elsif (cors = env["rack.cors"]) && cors.respond_to?(:preflight?) && cors.preflight? # if the Rack CORS Middleware identifies the request as a preflight request, # the stack doesn't get to the point where controllers/actions are defined