lib/influxdb/rails/middleware/request_subscriber.rb in influxdb-rails-1.0.2 vs lib/influxdb/rails/middleware/request_subscriber.rb in influxdb-rails-1.0.3
- old
+ new
@@ -14,11 +14,11 @@
def tags
{
method: "#{payload[:controller]}##{payload[:action]}",
hook: "process_action",
- status: payload[:status],
+ status: status,
format: payload[:format],
http_method: payload[:method],
exception: payload[:exception]&.first,
}
end
@@ -35,9 +35,17 @@
def started
InfluxDB.convert_timestamp(
start.utc,
configuration.client.time_precision
)
+ end
+
+ def status
+ if payload[:exception] && ::Rails::VERSION::MAJOR < 7
+ ActionDispatch::ExceptionWrapper.status_code_for_exception(payload[:exception].first)
+ else
+ payload[:status]
+ end
end
end
end
end
end