diff --git a/content/en/error_tracking/error_grouping.md b/content/en/error_tracking/error_grouping.md index 8a4c1d3178be1..3f1795229fc55 100644 --- a/content/en/error_tracking/error_grouping.md +++ b/content/en/error_tracking/error_grouping.md @@ -101,20 +101,6 @@ In Datadog's mobile SDKs, you can add a custom error fingerprint when logging an a predefined attribute to the log call: {{< tabs >}} -{{% tab "iOS" %}} -To use custom grouping, you need the Datadog iOS SDK `2.8.1` or higher. - -```swift -let errorFingerprint = "my-custom-grouping-material" -logger.error( - "My error message", - error: error, - attributes: [ - Logs.Attributes.errorFingerprint: errorFingerprint - ] -) -``` -{{% /tab %}} {{% tab "Android" %}} To use custom grouping, you need the Datadog Android SDK `2.7.0` or higher. @@ -141,6 +127,21 @@ logger.error( ``` {{% /tab %}} +{{% tab "iOS" %}} +To use custom grouping, you need the Datadog iOS SDK `2.8.1` or higher. + +```swift +let errorFingerprint = "my-custom-grouping-material" +logger.error( + "My error message", + error: error, + attributes: [ + Logs.Attributes.errorFingerprint: errorFingerprint + ] +) +``` +{{% /tab %}} + {{% tab "React Native" %}} To use custom grouping, you need the Datadog RUM SDK `2.4.2` or higher. ```dart @@ -159,22 +160,6 @@ DdLogs.error( Or, you can add or adjust the fingerprint in the log mapper: {{< tabs >}} -{{% tab "iOS" %}} -To use custom grouping, you need the Datadog iOS SDK `2.8.1` or higher. - -```swift -let logsConfiguration = Logs.Configuration( - eventMapper: { log in - var log = log - log.error?.fingerprint = "my-custom-grouping-material" - return log - } -) -Logs.enable( - with: logsConfiguration -) -``` -{{% /tab %}} {{% tab "Android" %}} To use custom grouping, you need the Datadog Android SDK `2.7.0` or higher. @@ -213,6 +198,23 @@ final configuration = DatadogConfiguration( ``` {{% /tab %}} +{{% tab "iOS" %}} +To use custom grouping, you need the Datadog iOS SDK `2.8.1` or higher. + +```swift +let logsConfiguration = Logs.Configuration( + eventMapper: { log in + var log = log + log.error?.fingerprint = "my-custom-grouping-material" + return log + } +) +Logs.enable( + with: logsConfiguration +) +``` +{{% /tab %}} + {{% tab "React Native" %}} To use custom grouping, you need the Datadog RUM SDK `2.4.2` or higher. @@ -232,6 +234,38 @@ configuration.errorEventMapper = event => { 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]. {{< tabs >}} + +{{% tab "Android" %}} +To use custom grouping, you need the Datadog Android SDK `2.7.0` or higher. + +To add a custom fingerprint when manually reporting errors, you can add a predefined attribute when calling `addError`: + +```kotlin +GlobalRumMonitor.get().addError( + "My error message", + RumErrorSource.SOURCE, + exception, + mapOf( + RumAttributes.ERROR_CUSTOM_FINGERPRINT to "my-custom-grouping-fingerprint" + ) +) +``` + +Or, you can use the `errorEventMapper`: + +```kotlin +val rumConfiguration = RumConfiguration.Builder("rum-application-id") + .setErrorEventMapper(object : EventMapper { + override fun map(event: ErrorEvent): ErrorEvent { + event.error.fingerprint = "my-custom-grouping-fingerprint" + return event + } + }).build() +RUM.enable(rumConfiguration) +``` + +{{% /tab %}} + {{% tab "Browser" %}} 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. @@ -266,66 +300,6 @@ In both cases, `my-custom-grouping-material` is used to group the Browser RUM er [2]: https://github.com/DataDog/browser-sdk/releases/tag/v4.42.0 {{% /tab %}} -{{% tab "iOS" %}} -To use custom grouping, you need the Datadog iOS SDK `2.8.1` or higher. - -To add a custom fingerprint when manually reporting errors, you can add a predefined attribute when calling `addError`: - -```swift -RUMMonitor.shared().addError( - message: "My error message", - source: .source, - attributes: [ - RUM.Attributes.errorFingerprint: "my-custom-grouping-fingerprint" - ] -) -``` - -Or, you can use the `errorEventMapper`: - -```swift -var config = RUM.Configuration(applicationID: "rum-application-id") -config.errorEventMapper = { errorEvent in - var errorEvent = errorEvent - errorEvent.error.fingerprint = "my-custom-grouping-fingerprint" - return errorEvent -} -RUM.enable(with: config) -``` - -{{% /tab %}} - -{{% tab "Android" %}} -To use custom grouping, you need the Datadog Android SDK `2.7.0` or higher. - -To add a custom fingerprint when manually reporting errors, you can add a predefined attribute when calling `addError`: - -```kotlin -GlobalRumMonitor.get().addError( - "My error message", - RumErrorSource.SOURCE, - exception, - mapOf( - RumAttributes.ERROR_CUSTOM_FINGERPRINT to "my-custom-grouping-fingerprint" - ) -) -``` - -Or, you can use the `errorEventMapper`: - -```kotlin -val rumConfiguration = RumConfiguration.Builder("rum-application-id") - .setErrorEventMapper(object : EventMapper { - override fun map(event: ErrorEvent): ErrorEvent { - event.error.fingerprint = "my-custom-grouping-fingerprint" - return event - } - }).build() -RUM.enable(rumConfiguration) -``` - -{{% /tab %}} - {{% tab "Flutter" %}} To use custom grouping, you need the Datadog Flutter SDK `2.4.0` or higher. @@ -361,6 +335,36 @@ final configuration = DatadogConfiguration( ``` {{% /tab %}} +{{% tab "iOS" %}} +To use custom grouping, you need the Datadog iOS SDK `2.8.1` or higher. + +To add a custom fingerprint when manually reporting errors, you can add a predefined attribute when calling `addError`: + +```swift +RUMMonitor.shared().addError( + message: "My error message", + source: .source, + attributes: [ + RUM.Attributes.errorFingerprint: "my-custom-grouping-fingerprint" + ] +) +``` + +Or, you can use the `errorEventMapper`: + +```swift +var config = RUM.Configuration(applicationID: "rum-application-id") +config.errorEventMapper = { errorEvent in + var errorEvent = errorEvent + errorEvent.error.fingerprint = "my-custom-grouping-fingerprint" + return errorEvent +} +RUM.enable(with: config) +``` + +{{% /tab %}} + + {{% tab "React Native" %}} To use custom grouping, you need the Datadog RUM SDK `2.4.2` or higher.