@@ -105,20 +105,6 @@ In Datadog's mobile SDKs, you can add a custom error fingerprint when logging an
105
105
a predefined attribute to the log call:
106
106
107
107
{{< tabs >}}
108
- {{% tab "iOS" %}}
109
- To use custom grouping, you need the Datadog iOS SDK ` 2.8.1 ` or higher.
110
-
111
- ``` swift
112
- let errorFingerprint = " my-custom-grouping-material"
113
- logger.error (
114
- " My error message" ,
115
- error : error,
116
- attributes : [
117
- Logs.Attributes .errorFingerprint : errorFingerprint
118
- ]
119
- )
120
- ```
121
- {{% /tab %}}
122
108
123
109
{{% tab "Android" %}}
124
110
To use custom grouping, you need the Datadog Android SDK ` 2.7.0 ` or higher.
@@ -145,6 +131,21 @@ logger.error(
145
131
```
146
132
{{% /tab %}}
147
133
134
+ {{% tab "iOS" %}}
135
+ To use custom grouping, you need the Datadog iOS SDK ` 2.8.1 ` or higher.
136
+
137
+ ``` swift
138
+ let errorFingerprint = " my-custom-grouping-material"
139
+ logger.error (
140
+ " My error message" ,
141
+ error : error,
142
+ attributes : [
143
+ Logs.Attributes .errorFingerprint : errorFingerprint
144
+ ]
145
+ )
146
+ ```
147
+ {{% /tab %}}
148
+
148
149
{{% tab "React Native" %}}
149
150
To use custom grouping, you need the Datadog RUM SDK ` 2.4.2 ` or higher.
150
151
``` dart
@@ -163,22 +164,6 @@ DdLogs.error(
163
164
Or, you can add or adjust the fingerprint in the log mapper:
164
165
165
166
{{< tabs >}}
166
- {{% tab "iOS" %}}
167
- To use custom grouping, you need the Datadog iOS SDK ` 2.8.1 ` or higher.
168
-
169
- ``` swift
170
- let logsConfiguration = Logs.Configuration (
171
- eventMapper : { log in
172
- var log = log
173
- log.error ? .fingerprint = " my-custom-grouping-material"
174
- return log
175
- }
176
- )
177
- Logs.enable (
178
- with : logsConfiguration
179
- )
180
- ```
181
- {{% /tab %}}
182
167
183
168
{{% tab "Android" %}}
184
169
To use custom grouping, you need the Datadog Android SDK ` 2.7.0 ` or higher.
@@ -217,6 +202,23 @@ final configuration = DatadogConfiguration(
217
202
```
218
203
{{% /tab %}}
219
204
205
+ {{% tab "iOS" %}}
206
+ To use custom grouping, you need the Datadog iOS SDK ` 2.8.1 ` or higher.
207
+
208
+ ``` swift
209
+ let logsConfiguration = Logs.Configuration (
210
+ eventMapper : { log in
211
+ var log = log
212
+ log.error ? .fingerprint = " my-custom-grouping-material"
213
+ return log
214
+ }
215
+ )
216
+ Logs.enable (
217
+ with : logsConfiguration
218
+ )
219
+ ```
220
+ {{% /tab %}}
221
+
220
222
{{% tab "React Native" %}}
221
223
To use custom grouping, you need the Datadog RUM SDK ` 2.4.2 ` or higher.
222
224
@@ -236,6 +238,38 @@ configuration.errorEventMapper = event => {
236
238
If you aren't already collecting Browser RUM events with Datadog, see the [ RUM Browser Monitoring setup documentation] [ 3 ] or the [ RUM Mobile and TV Monitoring setup documentation] [ 4 ] .
237
239
238
240
{{< tabs >}}
241
+
242
+ {{% tab "Android" %}}
243
+ To use custom grouping, you need the Datadog Android SDK ` 2.7.0 ` or higher.
244
+
245
+ To add a custom fingerprint when manually reporting errors, you can add a predefined attribute when calling ` addError ` :
246
+
247
+ ``` kotlin
248
+ GlobalRumMonitor .get().addError(
249
+ " My error message" ,
250
+ RumErrorSource .SOURCE ,
251
+ exception,
252
+ mapOf (
253
+ RumAttributes .ERROR_CUSTOM_FINGERPRINT to " my-custom-grouping-fingerprint"
254
+ )
255
+ )
256
+ ```
257
+
258
+ Or, you can use the ` errorEventMapper ` :
259
+
260
+ ``` kotlin
261
+ val rumConfiguration = RumConfiguration .Builder (" rum-application-id" )
262
+ .setErrorEventMapper(object : EventMapper <ErrorEvent > {
263
+ override fun map (event : ErrorEvent ): ErrorEvent {
264
+ event.error.fingerprint = " my-custom-grouping-fingerprint"
265
+ return event
266
+ }
267
+ }).build()
268
+ RUM .enable(rumConfiguration)
269
+ ```
270
+
271
+ {{% /tab %}}
272
+
239
273
{{% tab "Browser" %}}
240
274
To use custom grouping, you need the Datadog Browser SDK [ v4.42.0 or later] [ 2 ] , a [ browser RUM error] [ 1 ] , and an additional string attribute.
241
275
@@ -270,66 +304,6 @@ In both cases, `my-custom-grouping-material` is used to group the Browser RUM er
270
304
[ 2 ] : https://github.com/DataDog/browser-sdk/releases/tag/v4.42.0
271
305
{{% /tab %}}
272
306
273
- {{% tab "iOS" %}}
274
- To use custom grouping, you need the Datadog iOS SDK ` 2.8.1 ` or higher.
275
-
276
- To add a custom fingerprint when manually reporting errors, you can add a predefined attribute when calling ` addError ` :
277
-
278
- ``` swift
279
- RUMMonitor.shared ().addError (
280
- message : " My error message" ,
281
- source : .source ,
282
- attributes : [
283
- RUM.Attributes .errorFingerprint : " my-custom-grouping-fingerprint"
284
- ]
285
- )
286
- ```
287
-
288
- Or, you can use the ` errorEventMapper ` :
289
-
290
- ``` swift
291
- var config = RUM.Configuration (applicationID : " rum-application-id" )
292
- config.errorEventMapper = { errorEvent in
293
- var errorEvent = errorEvent
294
- errorEvent.error .fingerprint = " my-custom-grouping-fingerprint"
295
- return errorEvent
296
- }
297
- RUM.enable (with : config)
298
- ```
299
-
300
- {{% /tab %}}
301
-
302
- {{% tab "Android" %}}
303
- To use custom grouping, you need the Datadog Android SDK ` 2.7.0 ` or higher.
304
-
305
- To add a custom fingerprint when manually reporting errors, you can add a predefined attribute when calling ` addError ` :
306
-
307
- ``` kotlin
308
- GlobalRumMonitor .get().addError(
309
- " My error message" ,
310
- RumErrorSource .SOURCE ,
311
- exception,
312
- mapOf (
313
- RumAttributes .ERROR_CUSTOM_FINGERPRINT to " my-custom-grouping-fingerprint"
314
- )
315
- )
316
- ```
317
-
318
- Or, you can use the ` errorEventMapper ` :
319
-
320
- ``` kotlin
321
- val rumConfiguration = RumConfiguration .Builder (" rum-application-id" )
322
- .setErrorEventMapper(object : EventMapper <ErrorEvent > {
323
- override fun map (event : ErrorEvent ): ErrorEvent {
324
- event.error.fingerprint = " my-custom-grouping-fingerprint"
325
- return event
326
- }
327
- }).build()
328
- RUM .enable(rumConfiguration)
329
- ```
330
-
331
- {{% /tab %}}
332
-
333
307
{{% tab "Flutter" %}}
334
308
To use custom grouping, you need the Datadog Flutter SDK ` 2.4.0 ` or higher.
335
309
@@ -365,6 +339,36 @@ final configuration = DatadogConfiguration(
365
339
```
366
340
{{% /tab %}}
367
341
342
+ {{% tab "iOS" %}}
343
+ To use custom grouping, you need the Datadog iOS SDK ` 2.8.1 ` or higher.
344
+
345
+ To add a custom fingerprint when manually reporting errors, you can add a predefined attribute when calling ` addError ` :
346
+
347
+ ``` swift
348
+ RUMMonitor.shared ().addError (
349
+ message : " My error message" ,
350
+ source : .source ,
351
+ attributes : [
352
+ RUM.Attributes .errorFingerprint : " my-custom-grouping-fingerprint"
353
+ ]
354
+ )
355
+ ```
356
+
357
+ Or, you can use the ` errorEventMapper ` :
358
+
359
+ ``` swift
360
+ var config = RUM.Configuration (applicationID : " rum-application-id" )
361
+ config.errorEventMapper = { errorEvent in
362
+ var errorEvent = errorEvent
363
+ errorEvent.error .fingerprint = " my-custom-grouping-fingerprint"
364
+ return errorEvent
365
+ }
366
+ RUM.enable (with : config)
367
+ ```
368
+
369
+ {{% /tab %}}
370
+
371
+
368
372
{{% tab "React Native" %}}
369
373
To use custom grouping, you need the Datadog RUM SDK ` 2.4.2 ` or higher.
370
374
0 commit comments