SignalFx Developers Guide

newrelic()

The newrelic() function interprets a stream as a metric query that contains a series of slash-separated dimensions. This method is useful for querying metrics created by New Relic.

Syntax

newrelic(metric [,filter=query][,rollup=rtype][,extrapolation=exmethod][,maxExtrapolations=maxex], **kwargs)

Table 1. Parameter definitions
Parameter Type Description

metric

string

Required: A query that’s applied against the metrics in the input stream

query

string. Default is None.

Optional: query that filters the host dimension in the input stream

rtype

string. Default is None.

Optional: Specifies the rollup type to use for the metric. If you specify None, SignalFlow uses the default rollup for the metric. You can also specify a value listed in the Rollup type table.

exmethod

string. Default is None

Optional: 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. Default is -1

Optional: The allowed number of extrapolations after the function stops receiving data

**kwargs

List of maps

Optional: List of keywords and values that represents a mapping between New Relic nodes generated from the metric name and SignalFx synthesized dimensions. See Metric names and New Relic 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 the <mappings> argument, the stream object contains synthesized dimensions.

Metric names and New Relic nodes

When you call newrelic() on a stream, SignalFx splits the metric name into nodes along forward-slash ('/') boundaries. For example, the New Relic metric name 'HttpDispatcher/average_response_time/1273567' is split into three nodes: HttpDispatcher, average_response_time, and 1273567. SignalFx names these nodes according to the newrelic scheme: node0 is HttpDispatcher, node1 is average_response_time, and node2 is count.

To change the node naming to your own scheme, use <mappings> arguments to pass keyword arguments to newrelic(). Specify the name you want to use as the keyword, and refer to a newrelic node name by its number: 0 for node0, 1 for node1, and so forth. Continuing from the previous example, you can refer to HttpDispatcher as source by specifying source=0, and you can refer to 1273567 as applicationId by specifying applicationId=2. The following code shows you the full function call:

newrelic('HttpDispatcher/average_response_time/1273567', source=0, applicationId=2)

The strings source and applicationId 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
#Start a stream with all MTS with a metrics of 'HttpDispatcher/average_response_time/1273567'.
#Dimensions are node0=HttpDispatcher, node1=average_response_time, and node2=1273567
newrelic('HttpDispatcher/average_response_time/1273567')
#Start a stream with all MTS with a metric from HttpDispatcher/average_response_time for all application ids
#Dimensions are node0=HttpDispatcher, node1=average_response_time, node2=<application_id_value>
newrelic('HttpDispatcher/average_response_time/_')
#Name nodes
#Dimensions are node0=HttpDispatcher, node1=average_response_time, applicationId=<application_id_value>
newrelic('HttpDispatcher/average_response_time/*', applicationId=2)

© Copyright 2019 SignalFx.

Third-party license information