Sha256: b15b017078a5e941d6426c4266bcd7a7fd31bc823411151d5ad9a72e7d0d7105

Contents?: true

Size: 664 Bytes

Versions: 7

Compression:

Stored size: 664 Bytes

Contents

# frozen_string_literal: true

require_relative '../configuration/ext'

module Datadog
  module Core
    module Crashtracking
      # This module provides a method to resolve the base URL of the agent
      module AgentBaseUrl
        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
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
datadog-2.8.0 lib/datadog/core/crashtracking/agent_base_url.rb
datadog-2.7.1 lib/datadog/core/crashtracking/agent_base_url.rb
datadog-2.7.0 lib/datadog/core/crashtracking/agent_base_url.rb
datadog-2.6.0 lib/datadog/core/crashtracking/agent_base_url.rb
datadog-2.5.0 lib/datadog/core/crashtracking/agent_base_url.rb
datadog-2.4.0 lib/datadog/core/crashtracking/agent_base_url.rb
datadog-2.3.0 lib/datadog/core/crashtracking/agent_base_url.rb