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

Adding metadata header to client requests #696

Merged
merged 1 commit into from
Nov 12, 2018

Conversation

devshorts
Copy link

@devshorts devshorts commented Nov 12, 2018

This PR adds in basic client telemetry that for now only includes timing information. The telemetry is sent back as a sidecar payload in an HTTP header of:

X-Stripe-Client-Telemetry

With a JSON payload format of:

{ 
  "last_request_metrics": {
      "request_id": "...",
      "request_duration": 1.23
  }
}

By sending as a sidecar http header we avoid an extraneous network call at the cost of only being able to track the previous request.

Adding in this telemetry will allow stripe to help diagnose latency and other connection issues as well as provide a space to augment future telemetry data.

Telemetry needs to be opted into by setting:

Stripe.enable_telemetry = true

And can be disabled at any time by toggling that flag (the value is not cached)

@devshorts
Copy link
Author

r? @ob-stripe @brandur-stripe

@brandur-stripe
Copy link
Contributor

LGTM.

@brandur-stripe brandur-stripe merged commit 9bc61c6 into master Nov 12, 2018
@brandur-stripe brandur-stripe deleted the akropp-add-client-telemetry branch November 12, 2018 18:42
@brandur-stripe
Copy link
Contributor

Released as 3.31.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.

3 participants