Dynatrace query editor
Grafana provides a query editor for the Dynatrace data source, which is located on the Explore page. You can also access the Dynatrace query editor from a dashboard panel. Click the menu in the upper right of the panel and select Edit.
This document explains querying specific to the Dynatrace data source. For general documentation on querying data sources in Grafana, refer to Query and transform data. For options and functions common to all query editors, refer to Query editors.
The query editor allows you to create multiple Dynatrace query types.
Query
Grafana supports the following Dynatrace query types:
Metric query type
- Management Zone (optional)
- Select management zone(s) to filter results by management zone.
- Metric
- Select the metric that you want to see. To get the metric list from Dynatrace again, click the Refresh button.
- Aggregations
- Select the aggregation you want to use for a specific metric. Click the aggregations value to change the aggregation type or click the + button to add another aggregation.
- Transformations
- You can select transformations in the query editor. Afterwards, enter a number of parameters into the selected transformation. Currently, only the merge transformation is supported. For information about the merge transforms, refer to Merge transformation.
- Filters
- The Dynatrace plugin dynamically queries the appropriate filters for each metric.
- To add a filter, click the + symbol next to the
Filters
label on the Dynatrace query editor, select which field you would like to filter on, select the operator you would like to use, and then select a value to filter by. - The Dynatrace plugin allows you to create
Filter Groups
that you can join together to create complex logical comparisons. For most use cases,Filter Groups
are not required. - When creating filters with
Tags
, regardless of the conjunction selected, Dynatrace will always useAND
. Dynatrace does not supportOR
filters withTags
. - Alias
- There are two different types of aliases you will encounter while using the Dynatrace plugin. The first is a
static alias
. An alias of this type is available on every query that you build, and the name of the alias starts with a lowercase letter. The second is adynamic alias
, which changes based on the metric that you are using in your query, and the name of the alias starts with an uppercase letter. - The Dynatrace plugin supports several different aliases:
Metric Names
,Aggregation
,Display Name
,Host
, andDescription
.
Name | Value |
---|---|
$name | builtin:apps.other.keyUserActions.reportedErrorCount.os |
$aggregation | auto,value |
$displayName | Reported error count (by key user action, OS) [mobile, custom] |
- Limit
- Set a Limit to the size of the results. Each series will be limited by this amount.
Problems query type
Note
The Dynatrace Problems API is deprecated, but still remains functional for backward compatibility.
- Problem Query Type
- Select a problem query type. Currently, only the feed problem query type is supported. For information about the feed problem query type, refer to Problems API - GET feed.
- Status Filter
- Filter the result problems by the status.
- Impact Filter
- Filter the result problems by the impact level.
- Severity Filter
- Filter the result problems by the severity level.
- Expand Details
- Include related events to the response, if set.
Problems V2 query type
The Problems V2 query type use the Problems V2 API to query for problems observed by Dynatrace over a specified period of time.
For additional information, refer to Problems V2 API in the Dynatrace documentation.
- Fields
- Additional properties you can include in the response. Applies only to the current page of results and must be set for each page requested. Common fields include
evidenceDetails
,impactAnalysis
, andrecentComments
. - ProblemSelector
- Defines the query scope and filters which problems to retrieve using the Dynatrace Problems API selector syntax. Fields include
status
,severity level
,impact level
. To add multiple criteria, separate with a comma. For a complete list, refer to problemSelector parameters in the Dynatrace documentation. - EntitySelector
- The entity scope of the query. The following criteria are required: Entity type:
type("TYPE")
and Dynatrace entity ID:entityId("id")
. You can add multiple criteria. For a complete list of criteria options, refer to Problems API v2 - GET problems list. - Sort
- Specify a set of comma separated fields for sorting in the problem list. You can specify several levels of sorting. Refer to Parameters for a list of sort properties and their syntax.
USQL query type
- USQL Query Type
- Select the USQL Query type. This query type uses the user sessions API
- USQL Query
- The toolbar to the left of this area has 3 options
- Revert: Will revert your query to the latest saved query
- Save: Saves the current query and will execute the query (Alt+S/Cmd+S/Click). The toggle switch to the right is to enable auto-save. In auto-save mode, the query will be saved as soon as you navigate away from the query editor. (ie: Hit the refresh button)
- Add Deeplink Fields: When toggled will return deeplinked fields in the query as an additional dataset. Transformations can then be used to further massage the data.
Logs query type
- Query
- The log search query. The query must use the Dynatrace search query language. Example Query:
log.source="/var/log/syslog" AND (loglevel="error" OR loglevel="warn")
- Sort
- This defines how to sort the results.
Results are filtered based on dashboard timerange automatically.
Refer the underlying API documentation here for more details and limitations.
Note: The Logs query type is in beta. Please report any unexpected behavior to the Grafana Support team. The underlying Dynatrace API is an early adopter release. The API may change in ways that are not compatible with this plugin.
Audit Logs query type
- Filter
- Filters the audit log. You can enter the filter query as specified in the DynaTrace API Documentation. Example Query:
eventType("CREATE","UPDATE"),category("CONFIG")
- Sort
- This defines how to sort the results.
Results are filtered based on dashboard timerange automatically.
Refer the underlying API documentation here for more details and limitations.
Direct API Access query type
: Direct API Access allows querying any other dynatrace api endpoint, but will require that you parse out the data using JSON Path expression
- API Endpoint
- Enter the portion of the api endpoint starting with the version. Examples:
API Documentation API Endpoint Synthetics v2/synthetic/locations
Events v2/events
- Parse using JSONPath
- This is the default. When selected, the response is returned with column headers as JSON paths, making it simple to parse out individual fields if desired.
- Field
- Enter the JSON Path of the field to extract in the response
- Type
- Select the type the data should be extracted as. If using auto, the type will be automatically detected. For numbers that are within one year of the current UNIX Millisecond Epoch, the field will be of type “time”. Note that times that fail to be parsed as a time will be returned with a value of
nil
. - Alias
- Select the Alias. When entered, the column header/name will reflect the alias entered. Currently, template variables are not supported. Leave blank to use the default, which is the JSON path.
- Plus
- At the far right of a field line entry, clicking the plus sign will add an additional field.