Instrument your application using Dynatrace OpenKit

Monitoring data sent via Dynatrace OpenKit is encapsulated into an entity that represents your application called a custom application. Therefore, to monitor your application, you need to define and instrument the custom application following the instructions below.

Step 1: Define the custom application

  1. From the navigation menu, select Deploy Dynatrace.
  2. Within the Digital touchpoint monitoring section, click the Monitor custom application button.
  3. Type a name for your custom application.
  4. Select an icon to visually represent your custom application in the Dynatarce UI.
  5. Click the Monitor custom application button.
  6. You’ll be directed to the instrumentation page of your new custom application. From here, you can download Dynatrace OpenKit from GitHub and instrument your application using the provided Beacon URL and ApplicationID. The Beacons view below is especially handy as it shows you incoming beacons as they arrive, with only a couple of seconds delay. This view also provides information about potential problems.

Step 2: Instrument the custom application

To instrument your custom applications, use the Dynatrace OpenKit libraries that are available for download.

Basic instrumentation example

Here’s a basic example that shows you how to use Dynatrace OpenKit to send monitoring data to Dynatrace. For more details on the Dynatrace OpenKit API, visit Dynatrace OpenKit API methods.

// Obtain an OpenKit instance
String applicationName = "My OpenKit application";
String applicationID = "application-id";
long deviceID = 42;
String endpointURL = "https://tenantid.beaconurl.com";

OpenKit openKit = new DynatraceOpenKitBuilder(endpointURL, applicationID, deviceID)
        .withApplicationName(applicationName)
        .withApplicationVersion("1.0.0.0")
        .withOperatingSystem("Windows 10")
        .withManufacturer("MyCompany")
        .withModelID("MyModelID")
        .build();

// Create session
String clientIP = "8.8.8.8";
Session session = openKit.createSession(clientIP);

// Identify user
session.identifyUser("jane.doe@example.com");

// Create root and child actions
String rootActionName = "rootActionName";
RootAction rootAction = session.enterAction(rootActionName);

String childActionName = "childAction";
Action childAction = rootAction.enterAction(childActionName);

// Leave action
childAction.leaveAction();
rootAction.leaveAction();

// Finish session
session.end();

// Terminate OpenKit instance
openKit.shutdown();

Monitoring example

Once your custom application begins to send monitoring data to Dynatrace, you can analyze the data just like any other application. Have a look at the example Custom IoT application page below.

You can view all your user actions by clicking the View all user actions button in the Top actions section (see above).

From here you can continue to the list of user action instances and view detailed timings for individual user actions.