Splunk MINT SDK for iOS (Legacy)

Splunk MINT SDK for iOS Developer Guide

Splunk MINT is no longer available for purchase as of January 29, 2021. Customers who have already been paying to ingest and process MINT data in Splunk Enterprise will continue to receive support until December 31, 2021, which is End of Life for all MINT products: App, Web Service (Management Console), SDK and Add-On.

Add custom data to crash reports

Add custom data to crash reports

Although Splunk MINT collects plenty of data associated with each crash of your app, you can collect additional custom data. To add custom data to your crash reports, use the extra data map or add data as key-value pairs. The maximum length of keys is 128 characters. The maximum length of values is 256 characters. The maximum number of extra data key-value pairs is 32.

  • To add custom data as a key-value pair, use the addExtraData: selector as follows:
  • // Objective-C
     [[Mint sharedInstance] addExtraData:@"Value" forKey:@"key"];
    
    // Swift
     Mint.sharedInstance().addExtraData("value", forKey: "key")
    

    This method adds extra data to the global MintLimitedExtraData global singleton instance object and sends appropriate values to the Splunk MINT server as key-value pairs, which you can then examine your request.

  • To access the global MintLimitedExtraData with the [Mint sharedInstance].extraDataList property:
  • To add custom data as dictionary with key-value pair, use the addExtraData: selector as follows:
  • // Objective-C
     MintLimitedExtraData* extraData = [[MintLimitedExtraData alloc] init];
     [extraData1 setValue:@"value3" forKey:@"key3"];
    
     [[Mint sharedInstance] addExtraData:extraData];
    
    // Swift
     let limitedExtraData = MintLimitedExtraData()
     limitedExtraData.setValue("value1", forKey: "key1")        
     Mint.sharedInstance().addExtraData(limitedExtraData)
    

    This usage gives the same result as the addExtraData: method of the Mint instance because both methods access the same global MintLimitedExtraData singleton instance. The MintLimitedExtraData is an object that is limited to a maximum count of 32 objects. If you try to add an object that exceeds this count, the first object in the list is removed, FIFO. You can't add multiple values with the same key. If you try, you will not get an error but the value of an existing key will change.

  • To remove a specific value from the extra data, use the removeExtraDataForKey: method.
  • To clear the extra data completely, use the removeAllExtraData method.

View custom crash data

To view the custom crash data in Splunk MINT Management Console:

  1. Go to the Errors dashboard and select an error.
  2. In the error details section, click the Error Instances tab.
  3. In the Show All column, click the arrow.

To view the custom data for all of your mobile apps, run a search in the Splunk MINT App. For example, the following search lists errors with the values of the custom "level" field:

sourcetype=mint:error | table message, extraData.level

For more about running searches in MINT, see Searches in the Splunk MINT App User Guide.

Last modified on 05 November, 2019
Report handled exceptions   Add breadcrumbs to crash reports

This documentation applies to the following versions of Splunk MINT SDK for iOS (Legacy): 5.2.x


Was this topic useful?







You must be logged into splunk.com in order to post comments. Log in now.

Please try to keep this discussion focused on the content covered in this documentation topic. If you have a more general question about Splunk functionality or are experiencing a difficulty with Splunk, consider posting a question to Splunkbase Answers.

0 out of 1000 Characters