class Prometheus::Middleware::TraceCollector
This class integrates with a Prometheus::Client::Tracer
to update associated metric traces just prior to serving metrics. By default, this will collect traces on the global Client
tracer.
Public Class Methods
new(app, options = {})
click to toggle source
# File lib/prometheus/middleware/trace_collector.rb, line 11 def initialize(app, options = {}) @app = app @tracer = options[:tracer] || Client.tracer end
Public Instance Methods
call(env)
click to toggle source
# File lib/prometheus/middleware/trace_collector.rb, line 16 def call(env) @tracer.collect @app.call(env) end