Splunk MINT SDK for Android (Legacy)

Splunk MINT SDK for Android 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.

Monitor transactions

Transactions let you keep track of any process inside your application with a beginning and an end. For example, a transaction could be a process such as registration, login, or a purchase.

A transaction is basically an event that starts and then finishes in one of three ways:

  • The transaction is completed normally, resulting in a status of "SUCCESS".
  • The transaction is cancelled by the user, possibly because the process took too much time to complete, resulting in a status of "CANCEL".
  • The transaction failed because the app crashed, resulting in a status of "FAIL".

Use the following methods to work with transactions:

  • To start a transaction, use the transactionStart(name) method as follows:
  • String txID = Mint.transactionStart("Test1");

    A transaction ID is returned when you create a transaction. Use this transaction ID if you need to cancel or stop the transaction.

  • To stop a transaction, use the transactionStop(id) method as follows:
  • Mint.transactionStop(txID);
  • To cancel a transaction, use the transactionCancel(id, reason) method as follows:
  • Mint.transactionCancel(txID, "This is the reason");

To identify slow transactions that negatively affect the user experience, monitor how long transactions take to complete by going to the Transactions dashboard in Splunk MINT Management Console.

Add custom data to transactions

You can add extra custom data to specific transactions as a data map or as a key-value pair. Custom data can only be viewed using the Splunk MINT App.

  • To add custom data as a data map to a transaction, use the transactionStart(name, customData), transactionStop(id, customData), and transactionCancel(id, reason, customData) methods. For example, to add custom data to a transaction stop:
  • HashMap<String, Object> mydata = new HashMap<String, Object>();
    mydata.put("hotel", "Bob's B&B");
    mydata.put("member", "Elite");
    Mint.transactionStop(txID, mydata);
  • To add custom data as a key-value pair to a transaction, use the transactionStart(name, keyName, keyValue), transactionStop(id, keyName, keyValue), and transactionCancel(id, reason, keyName, keyValue) methods. For example, to add custom data to a transaction stop:
  • Mint.transactionStop(txID, "member", "Elite");

View custom data

To view the custom data for transactions, open the Splunk MINT App and run a search. For example, the following search lists the names of started transactions with the values of the custom "member" field:

sourcetype=mint:trstart extraData.member=* | table tr_name, extraData.member

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

Last modified on 22 April, 2019
Customize session handling   Add and report events

This documentation applies to the following versions of Splunk MINT SDK for Android (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