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

Move request telemetry to LiveStripeResponseGetter #1725

Merged

Conversation

richardm-stripe
Copy link
Contributor

@richardm-stripe richardm-stripe commented Jan 16, 2024

Summary

Moves responsibility for calculating queuing/calculating telemetry payloads and setting the X-Stripe-Client-Telemetry header from HTTPClient to LiveStripeResponseGetter.

Details

There are public requestWithTelemetry methods on HTTPClient that I changed to not trigger any (additional) telemetry anymore. It's a significant behavior change for a hypothetical user calling these methods directly, but I don't consider this a supported use.

Motivation

HTTPClient should be responsible for sending already-calculated HTTP requests, it shouldn't be responsible for calculating what to put in the HTTP request itself. See discussion at https://github.com/stripe/stripe-java/pull/1721/files#r1454137531

Test strategy

Pretty good existing end-to-end telemetry test:

public class TelemetryTest extends BaseStripeTest {

@richardm-stripe richardm-stripe marked this pull request as ready for review January 17, 2024 00:03
Copy link
Contributor

@pakrym-stripe pakrym-stripe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So clean!

@richardm-stripe richardm-stripe merged commit 43c477d into master Jan 17, 2024
10 checks passed
@richardm-stripe richardm-stripe deleted the richardm-move-telemetry-to-livestriperesponsegetter branch January 17, 2024 16:45
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.

2 participants