Try it free

Poll a query

  • Latest Dynatrace
  • Reference
  • Published Oct 13, 2026

Poll a running Dynatrace Grail query in Query API and retrieve its current status, with final records and metadata when complete.

GETSaaShttps://{your-environment-id}.apps.dynatrace.com/platform/storage/query/v1/query:poll

Overview

For information about the required permissions see the Bucket and table permissions in Grail documentation.

Polls the status of a Grail query. Returns the status of the query, including the result if the query finished.

The response format

The json response will contain the state of the query. If the query succeeded, the result will be included.

The result has two main sections:

  • The 'records' section contains the individual records, where each record consists of a set of fields and their corresponding values.
  • The 'types' section describes the corresponding data types that a record field has.

Every record has an implicit 'index' according to the position in the 'records' JSON array. The types section has a list of 1..N possible type 'buckets'. Each such bucket has an 'indexRange' which indicates which records will find their field types in which bucket. The index range has two values start & end and can be thought of as [startIndex, endIndex).

A field part of a record with index 'i' will find its corresponding field type by first locating the bucket that satisfies:

startIndex <= i <= endIndex

Once the bucket is found the 'mappings' object has an entry for all the fields that are part of that record with index 'i'.

Since enforcement of a particular schema is absent at ingestion time, it is possible to have records that share the same field name but their values are of a different type. This phenomenon will hence forth be named as a "collision". When a collision does occur, we will create a new type 'bucket' that will have a different index range where the new record field types will be placed. It is guaranteed that every field of every record will have a corresponding type. Clients should always take the included types into account when consuming records!

Authentication

To execute this request, you need a platform token or OAuth access token with one of the following scopes:

  • storage:bizevents:read
  • storage:buckets:read
  • storage:entities:read
  • storage:events:read
  • storage:fieldsets:read
  • storage:logs:read
  • storage:metrics:read
  • storage:spans:read
  • storage:system:read

To learn how to obtain and use it, see Tokens and authentication.

Parameters

ParameterTypeDescriptionInRequired
request-tokenstring

The request-token of the query.

queryRequired
request-timeout-millisecondsinteger

Time the response is allowed to be delayed for either a preview or the final result to become available. No default value (immediate response).

queryOptional
enrichstring

If set additional data will be available in the metadata section.

queryOptional
dt-client-contextstring

The dt-client-context header is an optional string parameter used for monitoring purposes. When included in a request, it helps retrieve information about the execution of the query. It shouldn't hold sensitive information.

headerOptional

Response

Response codes

CodeTypeDescription
200QueryPollResponse

The current status and results of the supplied query.

400--
401--
403--
404--
405--
410--
415--
429--
500--
503--
504--

Response body objects

The QueryPollResponse object

The response of GET query:execute call.

ElementTypeDescription
progressinteger

The progress of the query from 0 to 100.

resultQueryResult

The result of the DQL query.

stateQueryState

Possible state of the query.

The element can hold these values
  • NOT_STARTED
  • RUNNING
  • SUCCEEDED
  • RESULT_GONE
  • CANCELLED
  • FAILED
ttlSecondsinteger

Time to live in seconds.

The QueryResult object

The result of the DQL query.

ElementTypeDescription
metadataMetadata

Collects various bits of metadata information.

recordsResultRecord[]

List of records containing the result fields data.

typesRangedFieldTypes[]

The data types for the result records.

The Metadata object

Collects various bits of metadata information.

ElementTypeDescription
grailGrailMetadata

Collects various bits of metadata information.

metricsMetricMetadata[]-

The GrailMetadata object

Collects various bits of metadata information.

ElementTypeDescription
analysisTimeframeTimeframe

DQL data type timeframe.

canonicalQuerystring

The canonical form of the query. It has normalized spaces and canonical constructs.

contributionsContributions-
dqlVersionstring

The version of DQL that was used to process the query request.

executionTimeMillisecondsinteger

The time it took to execute the query.

flagsstring[]

Flags indicating specific properties of the query execution, such as CLASSIC_ENTITY_MIGRATION_ADVISED.

localestring

Effective locale for the query.

notificationsMetadataNotification[]

Collected messages during the execution of the query.

querystring

The submitted query.

queryIdstring

The id of the query

sampledboolean

True if sampling was used for at least one segment.

scannedBytesinteger

Number of scanned bytes during the query execution.

scannedDataPointsinteger-
scannedRecordsinteger

Number of scanned records during the query execution.

timezonestring

Effective timezone for the query.

The Timeframe object

DQL data type timeframe.

ElementTypeDescription
endstring

The end time of the timeframe.

startstring

The start time of the timeframe.

The Contributions object

ElementTypeDescription
bucketsBucketContribution[]-

The BucketContribution object

ElementTypeDescription
matchedRecordsRationumber-
namestring-
scannedBytesinteger-
tablestring-

The MetadataNotification object

The message that provides additional information about the execution of the query.

ElementTypeDescription
argumentsstring[]

The arguments for the message format.

messagestring

The complete message of the notification.

messageFormatstring

The message format of the notification, string.format based

messageFormatSpecifierTypesstring[]

The corresponding DQL format specifier types for each format specifier used in the error message format.

notificationTypestring

The notification type, e.g. LIMIT_ADDED.

severitystring

The severity of the notification, currently: INFO, WARN, ERROR.

syntaxPositionTokenPosition

The position of a token in a query string used for errors and notification to map the message to a specific part of the query.

The TokenPosition object

The position of a token in a query string used for errors and notification to map the message to a specific part of the query.

ElementTypeDescription
endPositionInfo

The exact position in the query string.

startPositionInfo

The exact position in the query string.

The PositionInfo object

The exact position in the query string.

ElementTypeDescription
columninteger

Query position column zero based index.

indexinteger

Query position index.

lineinteger

Query position line zero based index.

The MetricMetadata object

An object that defines additional metric metadata.

ElementTypeDescription
aggregationstring

Metadata about the aggregation type.

descriptionstring

The description of the metadata.

displayNamestring

The display name of the metadata.

fieldNamestring

The name of the associated field used in the query.

metric.keystring

The metric key.

ratestring

The specified rate normalization parameter.

rollupstring

Metadata about the rollup type.

scalarboolean

Indicates whether the scalar parameter was set to true in the timeseries aggregation function.

shiftedboolean

Indicates if the shifted parameter was used.

unitstring

The unit used.

The ResultRecord object

Single record that contains the result fields.

The ResultRecordValue object

Single result field of a record.

The GeoPoint object

DQL data type representing a geolocation point.

ElementTypeDescription
latitudenumber

The coordinate that specifies the north-south position of a point on the surface of the earth.

longitudenumber

The coordinate that specifies the east-west position of a point on the surface of the earth.

The RangedFieldTypes object

The field type in range.

ElementTypeDescription
indexRangeinteger[]

The range of elements at use this type in arrays (null for records).

mappingsobject

The mapping between the field name and data type.

The FieldType object

The possible type of a field in DQL.

ElementTypeDescription
typestring-
The element can hold these values
  • boolean
  • string
  • double
  • long
  • timestamp
  • timeframe
  • duration
  • binary
  • ip_address
  • geo_point
  • array
  • record
  • uid
  • smartscape_id
  • undefined
typesRangedFieldTypes[]-

The QueryState object

Possible state of the query.

Response body JSON models

{
"progress": 100,
"result": {
"metadata": {
"grail": {
"analysisTimeframe": {
"end": "2023-03-10T11:02:00.705980000Z",
"start": "2023-03-10T09:02:00.705980000Z"
},
"dqlVersion": "V1_0",
"executionTimeMilliseconds": 18,
"locale": "",
"query": "fetch ...",
"queryId": "92918dae-c2f9-4c98-b278-dc42adcc5954",
"timezone": "Z"
}
},
"records": [
{
"davis.status": "OPEN",
"davis.title": "Http monitor global outage",
"davis.underMaintenance": "false",
"timestamp": "2022-03-17T08:00:01.231000000Z"
},
{
"davis.status": "OPEN",
"davis.title": "Http monitor global outage",
"davis.underMaintenance": "false",
"timestamp": "2022-03-17T08:00:01.231000000Z"
},
{
"davis.status": "OPEN",
"davis.title": "Http monitor global outage",
"davis.underMaintenance": "false",
"timestamp": "2022-03-17T08:00:01.231000000Z"
},
{
"davis.status": "OPEN",
"davis.title": "Http monitor global outage",
"davis.underMaintenance": "false",
"timestamp": "2022-03-17T08:00:01.231000000Z"
}
],
"types": [
{
"indexRange": [
0,
3
],
"mappings": {
"davis.status": {
"type": "string"
},
"davis.title": {
"type": "string"
},
"davis.underMaintenance": {
"type": "string"
},
"timestamp": {
"type": "timestamp"
}
}
}
]
},
"state": "SUCCEEDED"
}
Related tags
Platform APIDynatrace Platform