From cfd585021a37a7be65609b88abd702a44cf6837e Mon Sep 17 00:00:00 2001 From: Michael Grosser Date: Tue, 7 Nov 2023 22:06:00 -0800 Subject: [PATCH] sudomain is no longer needed for api requests --- lib/kennel/api.rb | 2 +- lib/kennel/utils.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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