Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add request_id to RequestEndEvent #993

Conversation

davidpatters0n
Copy link
Contributor

We'd like to trace back a request back to a particular request_id. To do this we'll need to pass the request_id to RequestEndEvent.

Example:

 @duration=0.02757700002985075,
 @http_status=200,
 @method=:get,
 @num_retries=0,
 @path="/v1/charges/ch_sp_sale_charge",
 @request_id='req_123',
 @user_data={}>

Questions

Will the request_id always be available? What about scenarios where a request fails?

@CLAassistant
Copy link

CLAassistant commented Aug 4, 2021

CLA assistant check
All committers have signed the CLA.

@davidpatters0n davidpatters0n force-pushed the expose-request-id-to-instrumentation branch 3 times, most recently from 9e19640 to 4d5fe34 Compare August 5, 2021 11:22
@richardm-stripe
Copy link
Contributor

Hello @davidpatters0n, this looks good! Will merge this shortly.

Will the request_id always be available? What about scenarios where a request fails?

The request id is generated from the Stripe server. No request id will exist on context if the response headers were not successfully received from Stripe, see here where the context is initted, without a request id, and then here where it is set from the response headers.

@richardm-stripe richardm-stripe merged commit 85c7f52 into stripe:master Aug 9, 2021
@davidpatters0n davidpatters0n deleted the expose-request-id-to-instrumentation branch August 10, 2021 06:42
@davidpatters0n
Copy link
Contributor Author

@richardm-stripe - I think a version bump is required.

@richardm-stripe
Copy link
Contributor

Released in https://github.com/stripe/stripe-ruby/releases/tag/v5.38.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants