Dynatrace

Integrating LogRocket with Dynatrace

LogRocket offers many ways to integrate with Dynatrace.

Add Dynatrace trace links within LogRocket

With our Dynatrace integration, you can jump directly from an issue in a network request on the frontend into your backend traces to help you uncover the root of an issue faster.

Visit the "Settings" page in LogRocket and click "Integrations". Scroll down to find the Dynatrace card in "Backend Link Integration" and follow the instructions in-app to enable this integration.

Once enabled, you will see a link to Dynatrace from within a network request in LogRocket.

If you're using Dynatrace OneAgent, LogRocket will also populate response headers with links to Dynatrace request traces:

You can then click these URLs to view associated Dynatrace traces.

View logs from Dynatrace within LogRocket

You can view relevant logs from Dynatrace directly within a network request in a LogRocket session replay so that you can see the underlying cause of a slow or broken network request even faster.

Once the Dynatrace link is enabled in the integration settings page (see above), a toggle will appear to enable logs as well. Follow the instructions in-app to enable this integration.

Once configured, you will see Dynatrace logs within relevant network requests in LogRocket.

Custom parameters

To help you query the most relevant logs within Dynatrace, you can also choose to add custom parameters to your log query based on the network request. The parameters you can select from are as follows:

ParameterDescription
request.urlThe full request URL
request.methodThe HTTP method of the request
request.referrerThe request's referrer
request.header.*The full value of a request header (if present). For example, to retrieve the value of the accept header, specify request.header.accept.
request.body.*The full value of the specified body property in the request (only retrieves a value if the body is JSON and the property is present). E.g., to retrieve the value of a user property in the body, specify request.body.user (nested properties can be accessed as well)
response.statusThe HTTP status of the response
response.header.*The full value of a response header (if present). Behavior is identical to request headers above.
response.body.*The full value of the specified body property in the response (only retrieves a value if the body is JSON and the property is present). Behavior is identical to request body above.
resource.mime_typeThe MIME type of the resource
resource.initiator_typeThe entity or element that triggered this request

You can use any of these within the Log Query that is configured in the Dynatrace Integration Setup on the Settings page for the integration by wrapping them in double curly braces (ex. {{response.status}}). If a particular variable is not available for a specific request, LogRocket will not try to run the query on Dynatrace.

View LogRocket sessions from Dynatrace

You also have the ability to view LogRocket sessions from within Dynatrace.

Add the LogRocket session URL in a header to your API calls to backends which have Dynatrace set up:

var recordingURL;
LogRocket.getSessionURL(function(sessionURL) {
  recordingURL = sessionURL;
});

// example API call
fetch(someAPICallhere, {
  headers: { 
    // other headers
    'X-LogRocket-URL': recordingURL,
  },
});

If your application environment is supported, OneAgent will pick up this header and you will be able to view the LogRocket session for any API request.