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

Enable request latency telemetry by default #673

Merged
merged 1 commit into from
Jun 25, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@
[![License](https://poser.pugx.org/stripe/stripe-php/license.svg)](https://packagist.org/packages/stripe/stripe-php)
[![Code Coverage](https://coveralls.io/repos/stripe/stripe-php/badge.svg?branch=master)](https://coveralls.io/r/stripe/stripe-php?branch=master)

You can sign up for a Stripe account at https://stripe.com.
The Stripe PHP library provides convenient access to the Stripe API from
applications written in the PHP language. It includes a pre-defined set of
classes for API resources that initialize themselves dynamically from API
responses which makes it compatible with a wide range of versions of the Stripe
API.

## Requirements

Expand Down Expand Up @@ -56,7 +60,7 @@ echo $charge;

## Documentation

Please see https://stripe.com/docs/api for up-to-date documentation.
See the [PHP API docs](https://stripe.com/docs/api/php#intro).

## Legacy Version Support

Expand Down Expand Up @@ -179,6 +183,17 @@ an intermittent network problem:
[Idempotency keys][idempotency-keys] are added to requests to guarantee that
retries are safe.

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

```php
\Stripe\Stripe::setEnableTelemetry(false);
```

## Development

Get [Composer][composer]. For example, on Mac OS:
Expand Down
2 changes: 1 addition & 1 deletion lib/Stripe.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class Stripe
public static $maxNetworkRetries = 0;

// @var boolean Whether client telemetry is enabled. Defaults to false.
public static $enableTelemetry = false;
public static $enableTelemetry = true;

// @var float Maximum delay between retries, in seconds
private static $maxNetworkRetryDelay = 2.0;
Expand Down