MetricsQueryOptions interface

Options used when querying metrics.

Extends

Properties

aggregations

The list of aggregation types (comma separated) to retrieve.

autoAdjustTimegrain

When set to true, if the timespan passed in is not supported by this metric, the API will return the result using the closest supported timespan. When set to false, an error is returned for invalid timespan parameters. Defaults to false.

filter

The $filter is used to reduce the set of metric data returned.
Example:
Metric contains metadata A, B and C.
- Return all time series of C where A = a1 and B = b1 or b2
$filter=A eq ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq ‘*’
- Invalid variant:
$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B = ‘b2’
This is invalid because the logical or operator cannot separate two different metadata names.
- Return all time series where A = a1, B = b1 and C = c1:
$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’
- Return all time series where A = a1
$filter=A eq ‘a1’ and B eq ‘’ and C eq ‘.

granularity

The interval (i.e. timegrain) of the query. Durations helper contains aliases for some common ISO8601 durations. This is an ISO8601 duration value in the format P[n]Y[n]M[n]DT[n]H[n]M[n]S where P is the duration designator (for period) placed at the start of the duration representation. Y is the year designator that follows the value for the number of years. M is the month designator that follows the value for the number of months. W is the week designator that follows the value for the number of weeks. D is the day designator that follows the value for the number of days. T is the time designator that precedes the time components of the representation. H is the hour designator that follows the value for the number of hours. M is the minute designator that follows the value for the number of minutes. S is the second designator that follows the value for the number of seconds.

metricNamespace

Metric namespace to query metric definitions for.

orderBy

The aggregation to use for sorting results and the direction of the sort. Only one order can be specified. Examples: sum asc.

resultType

Reduces the set of data collected. The syntax allowed depends on the operation. See the operation's description for details.

rollUpBy

Dimension name(s) to rollup results by. For example if you only want to see metric values with a filter like 'City eq Seattle or City eq Tacoma' but don't want to see separate values for each city, you can specify 'RollUpBy=City' to see the results for Seattle and Tacoma rolled up into one timeseries.

timespan

The enclosing timespan for metrics.

top

The maximum number of records to retrieve. Valid only if $filter is specified. Defaults to 10.

validateDimensions

When set to false, invalid filter parameter values will be ignored. When set to true, an error is returned for invalid filter parameters. Defaults to true.

Inherited Properties

abortSignal

The signal which can be used to abort requests.

onResponse

A function to be called each time a response is received from the server while performing the requested operation. May be called multiple times.

requestOptions

Options used when creating and sending HTTP requests for this operation.

serializerOptions

Options to override serialization/de-serialization behavior.

tracingOptions

Options used when tracing is enabled.

Property Details

aggregations

The list of aggregation types (comma separated) to retrieve.

aggregations?: AggregationType[]

Property Value

autoAdjustTimegrain

When set to true, if the timespan passed in is not supported by this metric, the API will return the result using the closest supported timespan. When set to false, an error is returned for invalid timespan parameters. Defaults to false.

autoAdjustTimegrain?: boolean

Property Value

boolean

filter

The $filter is used to reduce the set of metric data returned.
Example:
Metric contains metadata A, B and C.
- Return all time series of C where A = a1 and B = b1 or b2
$filter=A eq ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq ‘*’
- Invalid variant:
$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B = ‘b2’
This is invalid because the logical or operator cannot separate two different metadata names.
- Return all time series where A = a1, B = b1 and C = c1:
$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’
- Return all time series where A = a1
$filter=A eq ‘a1’ and B eq ‘’ and C eq ‘.

filter?: string

Property Value

string

granularity

The interval (i.e. timegrain) of the query. Durations helper contains aliases for some common ISO8601 durations. This is an ISO8601 duration value in the format P[n]Y[n]M[n]DT[n]H[n]M[n]S where P is the duration designator (for period) placed at the start of the duration representation. Y is the year designator that follows the value for the number of years. M is the month designator that follows the value for the number of months. W is the week designator that follows the value for the number of weeks. D is the day designator that follows the value for the number of days. T is the time designator that precedes the time components of the representation. H is the hour designator that follows the value for the number of hours. M is the minute designator that follows the value for the number of minutes. S is the second designator that follows the value for the number of seconds.

granularity?: string

Property Value

string

metricNamespace

Metric namespace to query metric definitions for.

metricNamespace?: string

Property Value

string

orderBy

The aggregation to use for sorting results and the direction of the sort. Only one order can be specified. Examples: sum asc.

orderBy?: string

Property Value

string

resultType

Reduces the set of data collected. The syntax allowed depends on the operation. See the operation's description for details.

resultType?: ResultType

Property Value

rollUpBy

Dimension name(s) to rollup results by. For example if you only want to see metric values with a filter like 'City eq Seattle or City eq Tacoma' but don't want to see separate values for each city, you can specify 'RollUpBy=City' to see the results for Seattle and Tacoma rolled up into one timeseries.

rollUpBy?: string

Property Value

string

timespan

The enclosing timespan for metrics.

timespan?: QueryTimeInterval

Property Value

top

The maximum number of records to retrieve. Valid only if $filter is specified. Defaults to 10.

top?: number

Property Value

number

validateDimensions

When set to false, invalid filter parameter values will be ignored. When set to true, an error is returned for invalid filter parameters. Defaults to true.

validateDimensions?: boolean

Property Value

boolean

Inherited Property Details

abortSignal

The signal which can be used to abort requests.

abortSignal?: AbortSignalLike

Property Value

Inherited From OperationOptions.abortSignal

onResponse

A function to be called each time a response is received from the server while performing the requested operation. May be called multiple times.

onResponse?: RawResponseCallback

Property Value

Inherited From OperationOptions.onResponse

requestOptions

Options used when creating and sending HTTP requests for this operation.

requestOptions?: OperationRequestOptions

Property Value

Inherited From OperationOptions.requestOptions

serializerOptions

Options to override serialization/de-serialization behavior.

serializerOptions?: SerializerOptions

Property Value

Inherited From OperationOptions.serializerOptions

tracingOptions

Options used when tracing is enabled.

tracingOptions?: OperationTracingOptions

Property Value

Inherited From OperationOptions.tracingOptions