Skip to main content

SignalFx Python Library

Project description

signalflow is a command-line client for SignalFx SignalFlow Analytics. It allows for executing, controlling and streaming live output from SignalFlow Analytics computations, as well as batch non-streaming output.

For more information on the SignalFlow analytics language, visit the SignalFx Developers documentation at https://developers.signalfx.com.

Installation

To install, along with the required dependencies, simply use pip:

$ pip install git+https://github.com/signalfx/signalflow-cli

Demo

demo

Usage

The signalflow command-line tool supports both interactive and non-interactive operation modes. In interactive mode, it offers a prompt that allows for setting computation parameters and executing SignalFlow programs while visualizing their streaming output in real-time. The display shows the live data, with a spark line of the last 10 values, for each received time series.

In non-interactive mode, signalflow reads the SignalFlow program text (either from stdin or from a file) and can output the results in various formats as controlled by the --output command-line flag:

  • csv; outputs the data in CSV format. The first column is a millisecond timestamp; other columns contain the value of each output time series for each of those times.

    This output will keep streaming unless a fixed stopped time has been specified (which can be either in the past or in the future).

    CSV output is the default output type for non-interactive mode.

  • graph; generates CSV data and renders it as a graph in a window.

  • live; shows the same live display as in interactive mode, just without the prompt around it. Computation parameters should be set via the appropriate command-line flags as necessary.

Finally, the graphing can also be used from the provided standalone utility csv-to-plot, which reads CSV data from a file (or stdin) and renders the graph. Using --output graph is the same as piping the output of --output csv into csv-to-plot:

$ signalflow --token <session token> --start=-15m --stop=-1m \
    < program.txt | csv-to-plot

Interactive mode usage

$ signalflow --token <session token>

After a greeting header, you should see the prompt > ``. You can then enter a SignalFlow program (even across multiple lines) and press ``^D (Control-D) to execute the program and visualize the results. Press ^C at any time to interrupt the stream, and again to exit the client.

Computation parameters can be listed with the . command:

> .
{'max_delay': None, 'resolution': None, 'start': '-1m', 'stop': None}

You can change one of those values with .<parameter> <value>:

 > .start -15m
 > .stop -1m
 > .
{'max_delay': None, 'resolution': None, 'start': '-15m', 'stop': '-1m'}

To reset a parameter to None (which usually means “auto”), use .<parameter>:

 > .stop
 > .
{'max_delay': None, 'resolution': None, 'start': '-15m', 'stop': None}

Obtaining your token

To obtain a session token, simply authenticate against the SignalFx API’s /v2/session endpoint as described in the API documentation: https://developers.signalfx.com/docs/session. If you don’t pass the --token parameter, the SignalFlow CLI will prompt for your username and password and obtain a token for you.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

signalflowcli-1.0.0-py2-none-any.whl (15.2 kB view details)

Uploaded Python 2

File details

Details for the file signalflowcli-1.0.0-py2-none-any.whl.

File metadata

File hashes

Hashes for signalflowcli-1.0.0-py2-none-any.whl
Algorithm Hash digest
SHA256 a70051660fd73f60a440e112a1f6e919d98a9ee12d1bd3b50a789c9f10813585
MD5 853e00bd740d0e72a25e9f99c9f8b254
BLAKE2b-256 1f4bd0284c8e9c9b577d98f8f51eb125f4bb4bf2aba46520da443b02336cd5e8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page