You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Add Flutter network headers capture documentation
Documents the `trackResourceHeaders` / `ResourceHeadersExtractor` API
in the Flutter RUM advanced configuration page, aligning with the
Android and iOS sections added in #36291.
* Apply review suggestions
Copy file name to clipboardExpand all lines: layouts/shortcodes/mdoc/en/sdk/advanced_config/flutter.mdoc.md
+37-2Lines changed: 37 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -66,7 +66,7 @@ The flavor (variant) of the application. For stack trace deobfuscation, this mus
66
66
`firstPartyHosts`
67
67
: Optional
68
68
**Type**: List<String>
69
-
A list of first party hosts, used in conjunction with Datadog network tracking packages. Overrides any values set in `firstPartyHostsWithTracinHeaders`. To specify different headers per host, use `firstPartyHostsWithTracingHeaders` instead.
69
+
A list of first party hosts, used in conjunction with Datadog network tracking packages. Overrides any values set in `firstPartyHostsWithTracingHeaders`. To specify different headers per host, use `firstPartyHostsWithTracingHeaders` instead.
70
70
71
71
`firstPartyHostsWithTracingHeaders`
72
72
: Optional
@@ -208,9 +208,44 @@ To enable Datadog [distributed tracing][13], you must set the `DatadogConfigurat
208
208
209
209
-`DatadogRumConfiguration.traceSampleRate` sets a default sampling rate of 20%. If you want all resources requests to generate a full distributed trace, set this value to `100.0`.
210
210
211
+
### Capture resource headers
212
+
213
+
When [tracking resources automatically][10], you can capture HTTP request and response headers on RUM Resources by setting `trackResourceHeaders` on `DatadogRumConfiguration`. This option applies to all Datadog HTTP tracking clients (Tracking HTTP Client, `DatadogClient`, Dio Interceptor, and GQL Link), but does not apply to the gRPC Interceptor. This option is disabled by default.
214
+
215
+
Captured headers appear on the RUM Resource event under `resource.request.headers` and `resource.response.headers`. You can query them in the RUM Explorer.
216
+
217
+
```dart
218
+
DatadogRumConfiguration(
219
+
applicationId: '<rum-application-id>',
220
+
trackResourceHeaders: ResourceHeadersExtractor(),
221
+
)
222
+
```
223
+
224
+
With no arguments, `ResourceHeadersExtractor` captures a predefined set of safe headers:
Sensitive headers, such as tokens and API keys, are filtered out automatically, even if you list them explicitly.
244
+
{% /alert %}
245
+
211
246
### Track resources from other packages
212
247
213
-
While `Datadog Tracking HTTP Client` can track most common network calls in Flutter, Datadog supplies packages for integration into specific networking libraries, including gRPC, GraphQL and Dio. For more information about these libraries, see [Integrated Libraries][22].
248
+
While [Datadog Tracking HTTP Client][10] can track most common network calls in Flutter, Datadog supplies packages for integration into specific networking libraries, including gRPC, GraphQL and Dio. For more information about these libraries, see [Integrated Libraries][22].
0 commit comments