SignalFx Developers Guide

graphite()

graphite() creates a stream that interprets its input query as a series of period-separated dimensions. Use graphite() to query metrics created by graphite.

Syntax

graphite(metric [,rollup=rtype][,extrapolation=extype][,maxExtrapolations=maxex], **kwargs)

Table 1. Parameter definitions
Parameter Type Description

metric

string

A query that specifies the metrics to add to the output stream. Allows the following expressions:

  • Wildcards using the '*' character

  • Character classes using [ and ]. This is the same as character classes used in Perl regular expressions.

  • Value lists using { and }. For example, the query {host,server,machine} selects host, server, or machine.

rtype

string. Default is None.

Optional: Type of rollup to use on the metric. Specify None to use the default rollup for the metric. You can also specify a value listed in the Rollup type table. Default is None

extype

string. Default is "null".

Specifies how to extrapolate missing data. Use one of the following options:

  • "null": Default Don’t supply missing data

  • "zero": Substitute the value 0 for missing data

  • "last_value": Use the last none-missing data value

maxex

integer

The allowed number of extrapolations after the function stops receiving data. The default is -1.

**kwargs

One or more named arguments and values

Mappings between graphite nodes generated from the metric name and SignalFx synthesized dimensions. See Metric names and graphite nodes

Table 2. Parameter definitions
Type Description

"average"

Average over the rollup duration (default for gauges)

"count"

Count of points over the rollup duration

"delta"

Change in value from the previous rollup. Useful for cumulative counters.

"latest"

Latest value received. Useful for gauges.

"max"

Max value in the rollup duration. Useful for cumulative counters.

"min"

Minimum value in the rollup duration. Useful for gauges.

"rate"

Speed that points arrive. Default for cumulative and distributed counters

"sum"

Sum over the rollup. Useful for distributed counters

"lag"

The lag in ingesting the timeseries for each timeslice

Returns a stream object. If you specify values for the <mappings> argument, the stream object contains synthesized dimensions.

Metric names and graphite nodes

When you call graphite() on a stream, SignalFx splits the metric name into nodes along period ('.') boundaries. For example, the graphite metric name 'api.login.count' is split into three notes: api, login, and count. SignalFx names these nodes according to the graphite scheme: node0 is api, node1 is login, and node2 is count.

To change the node naming to your own scheme, use the <map> argument to pass keyword arguments to graphite(). Specify the name you want to use as the keyword, and refer to a graphite node name by its number: 0 for node0, 1 for node1, and so forth. Continuing from the previous example, you can refer to api as serverType by specifying serverType=0, and you can refer to login as apiType by specifying apiType=1. The following code shows you the full function call:

graphite('api.login.count', serverType=0, apiType=1)

The strings serverType and apiType are known as synthesized dimensions. You can use them to group output streams using the by= argument, and they appear as dimensions in the output stream.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
#Start a stream containing all MTS with the metric 'api.login.count'
#Dimensions are node0=api, node1=login, and node2=count
graphite('api.login.count')

#Start a stream containing all MTS with metrics that are api counts
#Dimensions are node0=api, node1=apiType, node2=count
graphite('api.*.count')

#Provide synthesized dimensions for a node. The first and third node retain their default names
#Dimensions names become node0=api, apiType=apiType, node2=count
graphite('api.*.count', apiType=1)

© Copyright 2019 SignalFx.

Third-party license information