Module: Datadog::Core::Crashtracking::AgentBaseUrl

Defined in:
lib/datadog/core/crashtracking/agent_base_url.rb

Overview

This module provides a method to resolve the base URL of the agent

Class Method Summary collapse

Class Method Details

.resolve(agent_settings) ⇒ Object



10
11
12
13
14
15
16
17
# File 'lib/datadog/core/crashtracking/agent_base_url.rb', line 10

def self.resolve(agent_settings)
  case agent_settings.adapter
  when Datadog::Core::Configuration::Ext::Agent::HTTP::ADAPTER
    "#{agent_settings.ssl ? 'https' : 'http'}://#{agent_settings.hostname}:#{agent_settings.port}/"
  when Datadog::Core::Configuration::Ext::Agent::UnixSocket::ADAPTER
    "unix://#{agent_settings.uds_path}"
  end
end