lib/influxdb/rails/middleware/subscriber.rb in influxdb-rails-1.0.0.beta2 vs lib/influxdb/rails/middleware/subscriber.rb in influxdb-rails-1.0.0.beta3
- old
+ new
@@ -19,18 +19,24 @@
raise NotImplementedError, "must be implemented in subclass"
end
private
+ def tags(tags)
+ merged_tags = tags.merge(InfluxDB::Rails.current.tags).reject { |_, value| value.nil? }
+ configuration.tags_middleware.call(merged_tags)
+ end
+
def enabled?
configuration.instrumentation_enabled? &&
!configuration.ignore_current_environment?
end
def location
+ current = InfluxDB::Rails.current
[
- Thread.current[:_influxdb_rails_controller],
- Thread.current[:_influxdb_rails_action],
+ current.controller,
+ current.action,
].reject(&:blank?).join("#")
end
end
end
end