From 2406f73089521cc8786b5216da635c0923689dae Mon Sep 17 00:00:00 2001 From: Alex Loukissas Date: Thu, 8 Aug 2024 19:51:32 +0300 Subject: [PATCH 1/2] feat: include stripe api key in telemetry metadata --- lib/stripe/api.ex | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/stripe/api.ex b/lib/stripe/api.ex index 864f367a..6eedc4e5 100644 --- a/lib/stripe/api.ex +++ b/lib/stripe/api.ex @@ -376,7 +376,8 @@ defmodule Stripe.API do end defp do_perform_request_and_retry(method, url, headers, body, opts, {:attempts, attempts}) do - start_metadata = %{url: url, method: method, attempts: attempts} + api_version = headers["Stripe-Version"] + start_metadata = %{url: url, method: method, attempts: attempts, api_version: api_version} response = :telemetry.span(~w[stripe request]a, start_metadata, fn -> From 46b94d074881544fa12fb6edac30d18e679dfab4 Mon Sep 17 00:00:00 2001 From: Alex Loukissas Date: Thu, 8 Aug 2024 20:21:50 +0300 Subject: [PATCH 2/2] pass all headers --- lib/stripe/api.ex | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/stripe/api.ex b/lib/stripe/api.ex index 6eedc4e5..0390e434 100644 --- a/lib/stripe/api.ex +++ b/lib/stripe/api.ex @@ -376,8 +376,7 @@ defmodule Stripe.API do end defp do_perform_request_and_retry(method, url, headers, body, opts, {:attempts, attempts}) do - api_version = headers["Stripe-Version"] - start_metadata = %{url: url, method: method, attempts: attempts, api_version: api_version} + start_metadata = %{url: url, method: method, attempts: attempts, headers: headers} response = :telemetry.span(~w[stripe request]a, start_metadata, fn ->