Skip to content

Commit

Permalink
Merge pull request #878 from stripe/ob-enable-telemetry
Browse files Browse the repository at this point in the history
Enable request latency telemetry by default
  • Loading branch information
ob-stripe authored Jun 25, 2019
2 parents e1a59e2 + a580b69 commit 92d4d44
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,19 @@ This information is passed along when the library makes calls to the Stripe
API. Note that while `Name` is always required, `URL` and `Version` are
optional.

### Request latency telemetry

By default, the library sends request latency telemetry to Stripe. These
numbers help Stripe improve the overall latency of its API for all users.

You can disable this behavior if you prefer:

```go
config := &stripe.BackendConfig{
EnableTelemetry: false,
}
```

## Development

Pull requests from the community are welcome. If you submit one, please keep
Expand Down
8 changes: 4 additions & 4 deletions stripe.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ const (
// EnableTelemetry is a global override for enabling client telemetry, which
// sends request performance metrics to Stripe via the `X-Stripe-Client-Telemetry`
// header. If set to true, all clients will send telemetry metrics. Defaults to
// false.
// true.
//
// Telemetry can also be enabled on a per-client basis by instead creating a
// `BackendConfig` with `EnableTelemetry: true`.
var EnableTelemetry = false
// Telemetry can also be disabled on a per-client basis by instead creating a
// `BackendConfig` with `EnableTelemetry: false`.
var EnableTelemetry = true

// Key is the Stripe API key used globally in the binding.
var Key string
Expand Down

0 comments on commit 92d4d44

Please sign in to comment.