SignalFx Developers Guide

publish()

(stream method)

Persists the results of the block on which its called, making the results available to SignalFx.

For example:

  • data().publish() displays a plot.

  • detect(<predicate>).publish() generates alerts when <predicate> is True.

In a detector’s SignalFlow, using .data().publish(label, enable=False) hides the plots that otherwise appear in the detector’s chart in the web UI.

Syntax

publish(label,enable=<boolean>)

Parameters

Table 1. Parameter definitions
Parameter Type Description

label

string

Required: Names the output from publish(). Use this label to backreference the publish() output from elsewhere in the SignalFlow program.

enable=boolean

boolean

Optional, default True: Controls the operation of publish(). Setting enable=False disables the publish(), which in effect disables the associated block.

Returns the output of the associated block.

Examples

Set up the SignalFlow for a detector so that the detector UI doesn’t display a plot of the signal in the chart:

1
2
3
4
5
6
7
# Publishes a data stream to A
A = data('cpu.utilization').publish('A')
# Creates a detector
# When cpu utilization is > 50 for 5 minutes, trigger an alert event
# When it's < 40 for 10 minutes, trigger a clear event
# Don't display the plot of A in the detector UI
detect(when(A > 50, '5m'), off=when(A < 40, '10m')).publish('cpu_too_high', enable=False)

© Copyright 2020 Splunk, Inc.

Third-party license information