diff --git a/README.md b/README.md index 0a14efdf6c..c23fef44ce 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/lib/stripe.js b/lib/stripe.js index 5eb5a956eb..9a467d3ac9 100644 --- a/lib/stripe.js +++ b/lib/stripe.js @@ -69,7 +69,7 @@ function Stripe(key, version) { this.webhooks = require('./Webhooks'); this._prevRequestMetrics = []; - this.setTelemetryEnabled(false); + this.setTelemetryEnabled(true); } Stripe.errors = require('./Error'); diff --git a/test/telemetry.spec.js b/test/telemetry.spec.js index 355ec61de5..f408c92c60 100644 --- a/test/telemetry.spec.js +++ b/test/telemetry.spec.js @@ -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