class ExceptionDog::AgentNotifier

Constants

OPTS_WHITELIST

Attributes

configuration[R]
logger[R]

Public Class Methods

new(configuration) click to toggle source
# File lib/exception_dog/agent_notifier.rb, line 14
def initialize(configuration)
  @configuration = configuration
  @logger = configuration.logger
end

Public Instance Methods

errors() click to toggle source
# File lib/exception_dog/agent_notifier.rb, line 25
def errors
  @errors  = []
  @errors << "Invalid host setup" unless configuration.agent_port && configuration.agent_host
  @errors
end
notify(title, text, opts) click to toggle source
# File lib/exception_dog/agent_notifier.rb, line 19
def notify(title, text, opts)
  logger.info "ExceptionDog::send_to_agent"
  @@socket ||= Datadog::Statsd.new(configuration.agent_host, configuration.agent_port, logger: configuration.logger)
  response = @@socket.event(title, text, opts)
end