diff --git a/lib/stripe/api.ex b/lib/stripe/api.ex index d642f0d9..864f367a 100644 --- a/lib/stripe/api.ex +++ b/lib/stripe/api.ex @@ -376,11 +376,13 @@ 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} + response = - :telemetry.span(~w[stripe request]a, %{url: url, method: method}, fn -> + :telemetry.span(~w[stripe request]a, start_metadata, fn -> case http_module().request(method, url, Map.to_list(headers), body, opts) do {:ok, status, _, _} = resp -> - {resp, %{status: status}} + {resp, Map.merge(start_metadata, %{status: status})} error -> {error, %{}}