Query Api

Query Api

Long time spans and small granularities can take a long time to calculate

Request
URI
GET
https://{api_host}/api/v2/chart/api
COPY
Query Parameters
string
n
Optional

name used to identify the query

string
q
Required

the query expression to execute

string
queryType
Optional

the query type of the query

Possible values are : WQL, PROMQL, HYBRID,
string
s
Required

the start time of the query window in epoch milliseconds

string
e
Optional

the end time of the query window in epoch milliseconds (null to use now)

string
g
Required

the granularity of the points returned

Possible values are : d, h, m, s,
string
p
Optional

the approximate maximum number of points to return (may not limit number of points exactly)

boolean
i
Optional

whether series with only points that are outside of the query window will be returned (defaults to true)

boolean
autoEvents
Optional

whether events for sources included in the query will be automatically returned by the query

string
summarization
Optional

summarization strategy to use when bucketing points together

Possible values are : MEAN, MEDIAN, MIN, MAX, SUM, COUNT, LAST, FIRST,
boolean
listMode
Optional

retrieve events more optimally displayed for a list

boolean
strict
Optional

do not return points outside the query window [s;e), defaults to false

string
view
Optional

view of the query result, metric or histogram, defaults to metric

Possible values are : METRIC, HISTOGRAM, AUTO,
boolean
includeObsoleteMetrics
Optional

include metrics that have not been reporting recently, defaults to false

boolean
sorted
Optional

sorts the output so that returned series are in order, defaults to false

boolean
cached
Optional

whether the query cache is used, defaults to true

string of array
dimensionTuples
Optional

dimensionTuples

boolean
useRawQK
Optional

useRawQK


Authentication
This operation uses the following authentication methods.
Responses
200

successful operation

Returns QueryResult of type(s) application/json
{
    "errorMessage": "string",
    "name": "string",
    "query": "string",
    "stats": {
        "keys": 0,
        "points": 0,
        "metrics": 0,
        "edges": 0,
        "spans": 0,
        "distributions": 0,
        "summaries": 0,
        "queries": 0,
        "buffer_keys": 0,
        "compacted_keys": 0,
        "skipped_compacted_keys": 0,
        "compacted_points": 0,
        "cached_compacted_keys": 0,
        "latency": 0,
        "s3_keys": 0,
        "cpu_ns": 0,
        "metrics_used": 0,
        "hosts_used": 0,
        "query_tasks": 0
    },
    "warnings": "string",
    "events": [
        {
            "name": "string",
            "start": 0,
            "end": 0,
            "hosts": [
                "string"
            ],
            "summarized": 0,
            "isEphemeral": false
        }
    ],
    "spans": [
        {
            "name": "string",
            "annotations": [
                {}
            ],
            "host": "string",
            "startMs": 0,
            "spanId": "string",
            "traceId": "string",
            "durationMs": 0
        }
    ],
    "timeseries": [
        {
            "label": "string",
            "host": "string",
            "data": [
                [
                    {}
                ]
            ]
        }
    ],
    "granularity": 0,
    "errorType": "string",
    "traces": [
        {
            "end_ms": 0,
            "spans": [
                {
                    "name": "string",
                    "annotations": [
                        {}
                    ],
                    "host": "string",
                    "startMs": 0,
                    "spanId": "string",
                    "traceId": "string",
                    "durationMs": 0
                }
            ],
            "start_ms": 0,
            "traceId": "string",
            "total_duration_ms": 0
        }
    ],
    "dimensions": [
        {
            "key": [
                "string"
            ],
            "valueList": [
                {
                    "count": 0,
                    "value": [
                        "string"
                    ]
                }
            ]
        }
    ],
    "traceDimensions": [
        {
            "key": [
                "string"
            ],
            "valueList": [
                {
                    "count": 0,
                    "value": [
                        "string"
                    ]
                }
            ]
        }
    ]
}
string
errorMessage
Optional

Error message, if query execution did not finish successfully

string
name
Optional

The name of this query

string
query
Optional

The query used to obtain this result

stats
Optional

stats

string
warnings
Optional

The warnings incurred by this query

array of QueryEvent
events
Optional

events

array of Span
spans
Optional

spans

array of Timeseries
timeseries
Optional

timeseries

integer As int64 As int64
granularity
Optional

The granularity of the returned results, in seconds

string
errorType
Optional

Error type, if query execution did not finish successfully

Possible values are : N/A, QuerySyntaxError, QueryExecutionError, Timeout,
array of Trace
traces
Optional

traces

array of TupleResult
dimensions
Optional

List of all dimension tuple results

array of TupleResult
traceDimensions
Optional

List of all tracing tuple results