diff --git a/lib/kennel/api.rb b/lib/kennel/api.rb index 194dcedb..607dd341 100644 --- a/lib/kennel/api.rb +++ b/lib/kennel/api.rb @@ -18,7 +18,7 @@ def self.tag(api_resource, reply) def initialize(app_key = nil, api_key = nil) @app_key = app_key || ENV.fetch("DATADOG_APP_KEY") @api_key = api_key || ENV.fetch("DATADOG_API_KEY") - url = Utils.path_to_url("", subdomain: "app") + url = Utils.path_to_url("") @client = Faraday.new(url: url) { |c| c.adapter :net_http_persistent } end diff --git a/lib/kennel/utils.rb b/lib/kennel/utils.rb index 1fc7ef65..0f219c72 100644 --- a/lib/kennel/utils.rb +++ b/lib/kennel/utils.rb @@ -12,8 +12,8 @@ def capture_sh(command) result end - def path_to_url(path, subdomain: nil) - subdomain ||= (ENV["DATADOG_SUBDOMAIN"] || "app") + def path_to_url(path) + subdomain = (ENV["DATADOG_SUBDOMAIN"] || "app") "https://#{subdomain}.datadoghq.com#{path}" end