Skip to content

Query metric

GET /collector/<collectorKey>/check//type//metric/?fields=...

Description

Returns detailed information for a specific metric within a check type. By supplying optional query parameters, you can include the metric's data definition (data), UI display formatting (format), and outgoing reference target (ref) in a single request.

To inspect broader levels of the hierarchy, see Query type, Query check, or Query collector. For a list of all available display formats, see List available metric formats.

Path parameters

Param Description
collectorKey Collector key.
checkKey Check key.
typeKey Type key.
metricKey Metric key.

Query parameters

Param Default Description
fields all fields Fields to return (see Fields below for all available fields).
data none Data fields. The result will include "data" with a data object (see Data below for all available data fields).
format none Format fields. The result will include "format" with a format object (see Format below for all available format fields).
ref none Ref type fields. The result will include "ref" with a ref object (see Ref below for all available ref fields).

Fields

Field Return type Description
key string Metric key.
name string Metric display name.

Data

Field Return type Description
aggregation string/null Aggregation method. One of First, Last, Append, AppendUnique, MergeSort, MergeSortUnique, Sum, Mean, Median, MedianHigh, MedianLow, Maximum,Minimum or Mode.
type string Data type. One of Bool, Int, Float, String, ListBool, ListInt, ListFloat or ListString.
required boolean When true, a non-null value is required for the metric.

Format

Field Return type Description
key string Format key.
name string Format name.
category string Category used to group similar formats (e.g., General, Data Size & Rate).
valueType string Supported metric value type. One of Any, Numeric, Text.
example string Example showing how a raw value is transformed into its formatted representation.

Ref

Field Return type Description
check string Referenced check key.
type string Referenced type key.

Return codes

Error code Reason
200 Success.
400 Unknown field.
401 Invalid or missing token.
403 Insufficient permissions (required: API+READ).
404 Collector, check or type not found.

Example

Curl request:

curl \
    -X GET 'https://api.infrasonar.com/collector/http/check/http/type/http/metric/responseTime?fields=key&data=type&format=key' \
    -H 'Authorization: Bearer XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'

Response:

{
    "key": "responseTime",
    "data": {
        "type": "Float"
    },
    "format": {
        "key": "HumanizedSeconds"
    }
}