Module: Dogapi

Defined in:
lib/dogapi/event.rb,
lib/dogapi/common.rb,
lib/dogapi/facade.rb,
lib/dogapi/metric.rb,
lib/dogapi/v1/tag.rb,
lib/dogapi/v1/dash.rb,
lib/dogapi/v1/user.rb,
lib/dogapi/version.rb,
lib/dogapi/v1/alert.rb,
lib/dogapi/v1/embed.rb,
lib/dogapi/v1/event.rb,
lib/dogapi/v1/metric.rb,
lib/dogapi/v1/search.rb,
lib/dogapi/v1/comment.rb,
lib/dogapi/v1/monitor.rb,
lib/dogapi/v1/metadata.rb,
lib/dogapi/v1/snapshot.rb,
lib/dogapi/v1/screenboard.rb,
lib/dogapi/v1/service_check.rb,
lib/dogapi/v1/dashboard_list.rb

Defined Under Namespace

Classes: APIService, Client, Event, EventService, MetricService, Scope, Service, V1

Constant Summary collapse

VERSION =
'1.29.0'
@@hostname =

Memoize the hostname as a module variable

nil

Class Method Summary collapse

Class Method Details

.find_datadog_hostObject


156
157
158
159
# File 'lib/dogapi/common.rb', line 156

def Dogapi.find_datadog_host
  # allow env-based overriding, useful for tests
  ENV['DATADOG_HOST'] || 'https://app.datadoghq.com'
end

.find_localhostObject


164
165
166
167
168
169
170
171
# File 'lib/dogapi/common.rb', line 164

def Dogapi.find_localhost
  begin
    # prefer hostname -f over Socket.gethostname
    @@hostname ||= %x[hostname -f].strip
  rescue
    raise 'Cannot determine local hostname via hostname -f'
  end
end