lib/influxdb/rails/middleware/request_subscriber.rb in influxdb-rails-1.0.0.beta2 vs lib/influxdb/rails/middleware/request_subscriber.rb in influxdb-rails-1.0.0.beta3
- old
+ new
@@ -18,12 +18,11 @@
timestamp: ts
end
rescue StandardError => e
log :error, "[InfluxDB::Rails] Unable to write points: #{e.message}"
ensure
- Thread.current[:_influxdb_rails_controller] = nil
- Thread.current[:_influxdb_rails_action] = nil
+ InfluxDB::Rails.current.reset
end
end
private
@@ -34,17 +33,18 @@
configuration.series_name_for_db_runtimes => (payload[:db_runtime] || 0).ceil,
}
end
def tags(payload)
- configuration.tags_middleware.call({
+ tags = {
method: "#{payload[:controller]}##{payload[:action]}",
status: payload[:status],
format: payload[:format],
http_method: payload[:method],
server: Socket.gethostname,
app_name: configuration.application_name,
- }.reject { |_, value| value.nil? })
+ }
+ super(tags)
end
end
end
end
end