Skip to content

Commit

Permalink
Merge pull request #699 from stripe/brandur-check-request-id
Browse files Browse the repository at this point in the history
Only send telemetry if request ID was present
  • Loading branch information
brandur-stripe authored Nov 15, 2018
2 parents 8c4813f + 78df532 commit 10f2355
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/stripe/stripe_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,8 @@ def execute_request_with_rescues(api_base, context)
resp = yield
context = context.dup_from_response(resp)
log_response(context, request_start, resp.status, resp.body)
if Stripe.enable_telemetry?

if Stripe.enable_telemetry? && context.request_id
request_duration_ms = ((Time.now - request_start) * 1000).to_int
@last_request_metrics = StripeRequestMetrics.new(context.request_id, request_duration_ms)
end
Expand Down

0 comments on commit 10f2355

Please sign in to comment.