SignalFx Developers Guide

promote()

promote() converts custom properties in an input stream.

Syntax

  • promote(property, allow_missing=allow_missing_flag)

  • promote([property,property,…], allow_missing=allow_missing_flag)

  • promote(property,property,…, allow_missing=allow_missing_flag)

  • promote([by=property], allow_missing=allow_missing_flag)

Table 1. Parameter definitions
Parameter Type Description
  • property

  • [property, property, …]

  • property, property, …

  • [by=property]

string, array of strings, or multiple string arguments

Required: One or more property names to convert to dimensions.

allow_missing=allow_missing_flag

Python boolean
(True or False)

Optional:

  • True: promote() returns a data stream in which any of the specified custom properties that exist are converted to dimensions, and those that don’t exist are ignored.

  • False: promote() only returns a data stream if all of the custom properties exist. If one of them doesn’t exist, promote() returns an empty data stream.

Default is False.

Return value

  • If allow_missing= is True, returns the input data stream with the specified custom properties converted to dimensions.

  • If allow_missing is False, returns the input data stream with the specified custom properties converted to dimensions, but only if *all of the custom properties exist. If one or more don’t exist, promote() returns an empty data stream.

Examples

This example publishes a data stream in which aws_availability_zone and aws_region are dimensions. If one of them is missing, the other one is still promoted in the publish() stream.

data('cpu.utilization').promote('aws_availability_zone','aws_region', allow_missing=True).publish()

This example publishes a data stream in which aws_availability_zone and aws_region are dimensions. If one of them is missing, the statement doesn’t publish anything in the publish() stream.

data('cpu.utilization').promote('aws_availability_zone','aws_region', allow_missing=False).publish()

This example shows how promote() works within a larger SignalFlow program. If neither aws_availability_zone nor endpoint are present in the input stream, requests is empty.

1
2
3
4
properties = ['aws_availability_zone', 'endpoint']
requests = data('requests').promote(properties, allow_missing=False)
cpu_usage = data('cpu.utilization').mean(by='aws_availability_zone')
(100 * cpu_usage / requests).publish('cpu spent handling a request')

© Copyright 2020 Splunk, Inc.

Third-party license information