SignalFx Developers Guide

const()

Creates a stream of constant-value timeseries.

Syntax

const(value=constant_value, key=key_maps, timeseries=timeseries_maps)

Table 1. Parameter definitions
Parameter Type Description

constant_value

Number. Default is None

The numeric value to use when generating a single timeseries

key_maps

Python map or list of maps. Default is None

The dimensions and values to insert into the timeseries

timeseries_maps

List of maps. Default is None

If specified, generates multiple constant timeseries in the output stream. Each map in the list contains a key map and a value constant.

Examples

Using const() to create a single timeseries

This SignalFlow expression publishes a single timeseries without any dimensions:

const(value=.5).publish()

To add dimensions to it, add the key parameter:

const(value=.5, key={"host": "host2"}).publish()

Using const() to create multiple timeseries

Test distinct static thresholds for a set of dimension values by generating multiple timeseries using const(). Specify each timeseries in the timeseries parameter. Don’t specify value and key as arguments to const(); instead, specify them in the value of timeseries.

1
2
3
4
5
6
7
8
9
#Define thresholds with two timeseries:
#- one with a 'aws_region:us-east-1' dimension with a value of 75
#- another with a 'aws_region:us-west-1' dimension with a value of 85
thresholds = const(timeseries=[
    {'key': {'aws_region': 'us-east-1'}, 'value': 75},
    {'key': {'aws_region': 'us-west-1'}, 'value': 85}])

#Use those thresholds in a detector and let correlation do the work
detect(data('cpu.utilization').promote('aws_region') > thresholds).publish('cpu too high')

© Copyright 2019 SignalFx.

Third-party license information