Skip to content

Commit

Permalink
Enable request latency telemetry by default
Browse files Browse the repository at this point in the history
  • Loading branch information
ob-stripe committed Jun 21, 2019
1 parent a738e82 commit cd27291
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ See the [Node API docs](https://stripe.com/docs/api/node#intro).

Install the package with:

npm install stripe --save
```sh
npm install stripe --save
```

## Usage

Expand Down Expand Up @@ -379,6 +381,17 @@ const allNewCustomers = await stripe.customers
.autoPagingToArray({limit: 10000});
```

### 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:

```js
stripe.setTelemetryEnabled(false);
```

## More Information

- [REST API Version](https://github.com/stripe/stripe-node/wiki/REST-API-Version)
Expand Down
2 changes: 1 addition & 1 deletion lib/stripe.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function Stripe(key, version) {
this.webhooks = require('./Webhooks');

this._prevRequestMetrics = [];
this.setTelemetryEnabled(false);
this.setTelemetryEnabled(true);
}

Stripe.errors = require('./Error');
Expand Down

0 comments on commit cd27291

Please sign in to comment.