Comment on page
Telemetry - script API
StackState Self-hosted v5.0.x
A telemetry query is a conjunction of equality conditions. For example,
name = 'system.load.norm.15' and host='localhost'. There are several builder methods available that help to refine the query time range, limit the number of points returned, or set a metric field.
dataSourceName- name of the data source.
query- set of equality conditions.
The output format of the Telemetry API changed in StackState v5.0. If you are running an earlier version of StackState, see the documentation for StackState v4.6 documentation (docs.stackstate.com/v/4.6).
.groupBy(fieldName: String)- optional. Used to return grouped results from Elasticsearch. Requires
.aggregation()to be used. If there is no aggregation, a plain metric stream will be returned.
limit(points: Int)- limits the number of points returned, applicable to non-aggregated queries.
metricField(fieldName: String)- optional, but may be required for some data sources. Sets a field that holds metric value.
compileQuery()- returns the telemetry query that was created with this function and the builder methods. After this builder method no more builder methods can be called.