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

Unverified

This user has not yet uploaded their public signing key.
1 parent a738e82 commit 6a6dca9
Showing 3 changed files with 16 additions and 2 deletions.
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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

@@ -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)
2 changes: 1 addition & 1 deletion lib/stripe.js
Original file line number Diff line number Diff line change
@@ -69,7 +69,7 @@ function Stripe(key, version) {
this.webhooks = require('./Webhooks');

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

Stripe.errors = require('./Error');
1 change: 1 addition & 0 deletions test/telemetry.spec.js
Original file line number Diff line number Diff line change
@@ -60,6 +60,7 @@ describe('Client Telemetry', () => {
const stripe = require('../lib/stripe')(
'sk_test_FEiILxKZwnmmocJDUjUNO6pa'
);
stripe.setTelemetryEnabled(false);
stripe.setHost(host, port, 'http');

stripe.balance

0 comments on commit 6a6dca9

Please sign in to comment.