Sha256: 2ebb6d887f60541d9a6780a1b8feee42341422eef524f1fcb6d1072649911af3
Contents?: true
Size: 764 Bytes
Versions: 11
Compression:
Stored size: 764 Bytes
Contents
# Provides: # * configurable agent # * endpoint for accessing metrics JSON # module Metrics module Integration module Rack class Endpoint attr_accessor :app, :options, :agent, # integration metrics :requests, :uncaught_exceptions, :status_codes def initialize(options ={}) @options = options @agent = @options.delete(:agent) || Agent.new end def call(_) body = @agent.to_json [ 200, { 'Content-Type' => 'application/json', 'Content-Length' => body.size.to_s }, [body] ] end end end end end
Version data entries
11 entries across 11 versions & 2 rubygems