SignalFx Developers Guide

dimensions()

Duplicates or renames dimensions for the timeseries in the input stream

Syntax

dimensions([aliases=alias_map][, renames=renames_map])

Table 1. Parameter definitions
Parameter Type Description

alias_map

Map of string properties. Default is None.

Optional: This map adds new dimensions to each timeseries, based on existing dimensions.

renames

Map of string properties. Default is None.

Optional: This map renames existing dimensions.

Notice that aliases=alias_map argument adds dimensions but doesn’t change existing ones, while the renames=rename_map argument replaces existing dimension keys with new names.

The return value is a stream object in which the time series have altered dimensions

Errors

The following cause errors:

  • alias_map or rename_map value that isn’t a map in which both keys and values are strings

  • A key in either map that’s also a value in one of the maps.

Examples

1
2
3
4
5
6
7
#counter example: this is an error, because you can't make server an alias to host and node an alias to server
#at the same time
data('cpu.load').dimensions(aliases={'server':'host', 'node':'server'}).publish()

#counter example: this is an error, because you create an alias to server and then rename node to server at the
#same time
data('cpu.load').dimensions(aliases={'server':'host'}, renames={'node':'server'}).publish()

Notes

SignalFx provides the dimensions() method so you can repair misnamed dimensions in place. For this reason, you usually use the renames argument.

You should assume that the aliasing and renaming occur simultaneously, so that none of the key-value pairs in the maps affect any of the others. This lets you alias or rename an existing dimension to multiple new dimensions.

dimensions() only returns timeseries that include the aliased or renamed dimensions, so any timeseries that doesn’t have these dimensions aren’t in the output. For example, if you want to rename "host" to "server", a time series that doesn’t have the "host" dimension won’t be in the output stream.

Examples

If you wanted to report a timeseries with a "server" dimension but misreported it with "host", use the dimensions() method to fix it:

data('cpu.load').dimensions(renames={'server':'host'}).publish()

To rename "project" to both "service" and "team":

data('cpu.load').dimensions(renames={'service':'project', 'team':'project'}).publish()

© Copyright 2019 SignalFx.

Third-party license information