Skip to content

Commit 3296741

Browse files
Allow reading of RecordTelemetry from .json config
1 parent cf776be commit 3296741

File tree

3 files changed

+26
-1
lines changed

3 files changed

+26
-1
lines changed

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,29 @@ The execution of integration tests require the following environment variables s
240240
* For Default account systems (OAuth): `CHECKOUT_DEFAULT_OAUTH_CLIENT_ID` & `CHECKOUT_DEFAULT_OAUTH_CLIENT_SECRET`
241241
* For Previous account systems (ABC): `CHECKOUT_PREVIOUS_PUBLIC_KEY` & `CHECKOUT_PREVIOUS_SECRET_KEY`
242242

243+
## Telemetry
244+
Request telementry is enabled by default in the .NET SDK. Request latency is included in the telemetry data. Recording the request latency allows Checkout.com to continuously monitor and imporove the merchant experience.
245+
246+
Request telemetry can be disabled by opting out during CheckoutSdk builder step:
247+
```
248+
ICheckoutApi api = CheckoutSdk.Builder().StaticKeys()
249+
.SecretKey("secret_key")
250+
.RecordTelemetry(false)
251+
.Environment(Environment.Sandbox)
252+
.Build();
253+
```
254+
255+
Or when using `CheckoutSDK.Extensions.Microsoft`:
256+
```
257+
{
258+
"Checkout": {
259+
...
260+
"RecordTelemetry": false,
261+
...
262+
}
263+
}
264+
```
265+
243266
## Code of Conduct
244267

245268
Please refer to [Code of Conduct](CODE_OF_CONDUCT.md)

src/CheckoutSdk.Extensions/CheckoutOptions.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ public class CheckoutOptions
2323
public PlatformType? PlatformType { get; set; }
2424

2525
public IHttpClientFactory HttpClientFactory { get; set; }
26-
26+
27+
public bool RecordTelemetry { get; set; } = true;
2728
}
2829
}

src/CheckoutSdk.Extensions/CheckoutServiceCollection.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ private static void SetCommonAttributes<TB, TC>(
135135
{
136136
builder.HttpClientFactory(httpClientFactory);
137137
}
138+
builder.RecordTelemetry(options.RecordTelemetry);
138139
}
139140
}
140141
}

0 commit comments

Comments
 (0)