SignalFx Developers Guide

Developer Home

Product Docs

SignalFx

SignalFlow API

API for streaming data to SignalFlow and managing SignalFlow background computations.

Create WebSocket Connection

Creates a WebSocket connection to SignalFlow

Creates a WebSocket connection to SignalFlow. After you have a connection, you can start a SignalFlow background job and receive results from it in WebSocket response objects.
NOTE: Only use this request if you're using WebSocket to communicate with SignalFlow. If you're using REST and SSE, you don't need a WebSocket connection.
If you are using WebSocket, you need to authenticate with SignalFlow after you create the connection. Send the following JSON within 5 seconds after connecting:

{
    'type': 'authenticate',
    'token': 'AUTH_TOKEN'
} 

If SignalFlow drops the connection for any reason, re-connect and re-authenticate. Your existing SignalFlow computations aren't affected by a connection drop unless the re-authentication fails. In that case, SignalFlow closes the connection and terminates all jobs.

Responses

Start SignalFlow Computation

Starts a SignalFlow computation

Starts the computation specified by the SignalFlow program in the request body. Control the computation by specifying query parameters in the request.

query Parameters
start
integer <int64>
Example: start=1557531030000

The date and time that the computation should start, in Unix time

stop
integer <int64>
Example: stop=1557617430000

The date and time that the computation should stop, in Unix time

resolution
integer <int32> >= 0

The minimum data resolution you want to use in the computation, in milliseconds. To learn more about data resolution, see the topic [SignalFx Analytics Overview] (https://docs.signalfx.com/en/latest/reference/analytics-docs/intro-analytics.html) in the SignalFx product documentation.

maxDelay
integer <int32> [ 0 .. 900000 ]

The maximum time that you want the computation to wait after it detects that input data has stopped arriving, in milliseconds. To get the automatic maximum, specify 0. The maximum delay you can specify yourself is 900000, or 15 minutes.

immediate
boolean

Flag that controls the stop timestamp. If true, the flag overrides the stop timestamp, and the computation doesn't wait for future incoming data

timezone
string
Default: "UTC"

Specifies which time zone SignalFlow should use as the basis of time-related calculations in the computation job. calendar window transformation methods.
For a list of supported time zones, see the section [Supported SignalFlow time zones] (https://developers.signalfx.com/signalflow_analytics/signalflow_overview.html#_supported_signalflow_time_zones).

header Parameters
Content-Type
required
string

Format of the request body. Always "text/plain".

X-SF-Token
required
string

Authentication token

Last-Event-ID
string

ID of the last Server-Sent Event you received. This value lets you resume a computation that's paused.

Request Body schema: text/plain

String specifying the SignalFlow program to run
NOTE: The equivalent WebSocket request message is described in the Developers Guide in the section [Execute a computation] (https://developers.signalfx.com/signalflow_analytics/websocket_request_messages.html#_execute_a_computation)

string

Responses

Response Schema: application/json
code
integer

Always contains 401

message
string

Always contains "You must use your user session"

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

Preview Detector Alert Count

Preview count of detector alerts

Generates a preview of the number of alerts a detector will generate during a specified time period. In the web UI, this feature is called Alert Preview.
In the request body, specify the detector you want to preview as plain text containing a SignalFlow program with one or more detect().publish() output streams.
NOTE: This is an asynchronous request that returns data to your client in the form of Server-Sent Event (SSE) messages. To learn more about these messages, see the API topic SignalFlow Stream Messages Reference.

query Parameters
start
required
integer <int64>
Example: start=1556839830000

Preview start timestamp, in Unix time

stop
required
integer <int64>
Example: stop=1557012630000

Preview stop timestamp, in Unix time

maxDelay
integer <int32> >= 0
Example: maxDelay=20000

Maximum time that the detector should wait after input data stops arriving, in milliseconds.

header Parameters
Content-Type
required
string

Format of the request body. Always "text/plain".

X-SF-Token
required
string

Authentication token

Request Body schema: text/plain

Text string containing a SignalFlow program that has one or more detect().publish() output streams

string

Responses

Response Schema: application/json
code
integer

HTTP response code, always 401

message
string

Text string, always "You must use your user session".

Response samples

Content type
application/json
{
  • "code": 401,
  • "message": "You must use your user session"
}

Retrieve Computation Feedback

Retrieves status and feedback messages for a computation

Retrieves status and feedback messages for a SignalFlow computation

path Parameters
id
required
string

The computation ID returned in the `"handle" property in an SSE message.

header Parameters
X-SF-Token
required
string

Authentication token.

Responses

Stop SignalFlow Computation

Stops a SignalFlow computation

Stops a SignalFlow computation identified by its ID (computation handle). The computation must belong to the same organization as the user whose access token you used to start the computation.

path Parameters
id
required
string

The computation ID returned in the `"handle" property in an SSE message. SignalFlow stops the computation based on this ID.

header Parameters
X-SF-Token
required
string

Authentication token.

Responses

Response Schema: application/json
code
integer

401

message
string

"You must use your user session"

Response Schema: application/json
message
any

"message" : "HTTP 404 Not Found"

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

© Copyright 2020 Splunk, Inc.

Third-party license information