lib/datadog/profiling/http_transport.rb in datadog-2.2.0 vs lib/datadog/profiling/http_transport.rb in datadog-2.3.0
- old
+ new
@@ -1,8 +1,8 @@
# frozen_string_literal: true
-require_relative '../core/transport/ext'
+require_relative "../core/transport/ext"
module Datadog
module Profiling
# Used to report profiling data to Datadog.
# Methods prefixed with _native_ are implemented in `http_transport.c`
@@ -51,11 +51,11 @@
info_json: flush.info_json
)
if status == :ok
if (200..299).cover?(result)
- Datadog.logger.debug('Successfully reported profiling data')
+ Datadog.logger.debug("Successfully reported profiling data")
true
else
Datadog.logger.error(
"Failed to report profiling data (#{config_without_api_key}): " \
"server returned unexpected HTTP #{result} status code"
@@ -71,24 +71,26 @@
private
def base_url_from(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}/"
+ "#{agent_settings.ssl ? "https" : "http"}://#{agent_settings.hostname}:#{agent_settings.port}/"
when Datadog::Core::Configuration::Ext::Agent::UnixSocket::ADAPTER
"unix://#{agent_settings.uds_path}"
else
raise ArgumentError, "Unexpected adapter: #{agent_settings.adapter}"
end
end
def validate_agent_settings(agent_settings)
- supported_adapters = [Datadog::Core::Configuration::Ext::Agent::UnixSocket::ADAPTER,
- Datadog::Core::Configuration::Ext::Agent::HTTP::ADAPTER]
+ supported_adapters = [
+ Datadog::Core::Configuration::Ext::Agent::UnixSocket::ADAPTER,
+ Datadog::Core::Configuration::Ext::Agent::HTTP::ADAPTER
+ ]
unless supported_adapters.include?(agent_settings.adapter)
raise ArgumentError,
"Unsupported transport configuration for profiling: Adapter #{agent_settings.adapter} " \
- ' is not supported'
+ " is not supported"
end
end
def agentless?(site, api_key)
site && api_key && Core::Environment::VariableHelpers.env_to_bool(Profiling::Ext::ENV_AGENTLESS, false)