lib/heimdall_apm/reporting.rb in heimdall_apm-0.1.2 vs lib/heimdall_apm/reporting.rb in heimdall_apm-0.1.3
- old
+ new
@@ -2,21 +2,22 @@
class Reporting
def initialize(context)
@context = context
end
+ # TODO: make this configurable
def influx
@client ||= InfluxDB::Client.new("#{Rails.env}_metrics", time_precision: 'ms', retry: 0)
end
def call
span = @context.vault.retrieve_and_delete_previous_span
if span && !span.points_collection.empty?
influx.write_points(span.points_collection.to_a)
else
- HeimdallApm.logger.debug "Nothing to report"
+ @context.logger.debug "Nothing to report"
end
rescue => e
- HeimdallApm.logger.error "#{e.message} during reporting to InfluxDB"
+ @context.logger.error "#{e.message} during reporting to InfluxDB"
end
end
end