Add-on Calculation Webhook
JVM AGENT
Overview
The Add-on Calculation Webhook connector extends the calculation capabilities of Seeq with the compute capabilities of other external systems. When an Add-on Calculation Webhook connection is properly configured, the webhook is triggered in Workbench to make an HTTPS request to the configured endpoint, sending a payload of data to your external server and getting a response back to Workbench. A registered Add-on Calculation Webhook is accessible to Seeq users in the Formula editor as a User Defined Function (UDF).
Prerequisites
The main prerequisite to creating an Add-on Calculation Webhook connection is having a REST API endpoint accessible from the remote agent where the connection is configured. From the Seeq side, make sure that the Features/AddOnCalculations/Webhook/Enabled
flag is enabled (Administration > Configuration
with Advanced Filter
enabled)
The webhook can be triggered when indexing the connection or from a compute request from Workbench. The endpoint needs to send different responses depending on whether the HTTP request was triggered from an indexing operation or from compute operation. The HTTP request sends, as part of the payload, the property action
whose value can be either metadata
or compute
to distinguish between the indexing and compute operations that triggered the HTTP request.
Currently, two types of calculations are supported by the Add-on Calculation Webhook connector: 1) keywise calculations, and 2) sliding-window calculations. The main difference between the two is that window calculations provide expanded data in the HTTP request to perform calculations based on the time window specified (useful when doing data aggregation).
HTTP request payload to your endpoint
Property Name | Values | Data Type | Description |
---|---|---|---|
|
| String | The action that triggered the HTTP request. |
| [ | Array | Seeq signal types. Only if |
| [[ | Multidimensional Array | Signal data. Only if |
| Float | Size of the window in terms of number of samples. Only if |
HTTP response from your endpoint
The response from your endpoint must be different depending on whether the request action
is compute
or metadata
HTTP metadata
response
The metadata
response must be a json object with the following properties.
Property Name | Values | Data Type | Description |
---|---|---|---|
|
| String | Determines whether the Seeq HTTP request will send an expanded windowed data timeframe. |
|
| String | The data type of the response from the |
|
| Dictionary | UDF definition. See this page for details. |
|
| String | Please see the configuration details for Add- |
HTTP compute
response
The compute
response must be a json object with the following properties.
Property Name | Values | Data Type | Description |
---|---|---|---|
| [ | Array | Array of values that correspond to the samples of the output signal |
| [ | Array | Array of timestamps in nanoseconds for the output signal. This is typically re-arrange from the |
|
| String | Whether the output signal from the endpoint is a numeric or a string signal |
Examples
Configuration
This is an example configuration template that is displayed in the Additional Configuration box that appears when you click Configure for an existing datasource (or if a new datasource is being created, in the Create new datasource connection modal that appears after clicking Add Datasource) on the Datasources administration page.
{
"AuthenticationType": "BEARER_TOKEN",
"Url": "<endpointUrl>",
"PackageName": "<packageName>",
"Token": "<your token>",
"Version": null,
"ConnectTimeoutInSeconds": 120,
"ReadTimeoutInSeconds": 300,
"CallTimeoutInSeconds": 3600
}
Additional Configuration
If your API endpoint requires authentication, only Bearer Token authentication is supported by the Add-on Calculation Webhook connector.
Property Name | Default Value | Data Type | Description |
---|---|---|---|
|
| String | Use |
| null | String | The URL of your endpoint |
| null | String | The name of the UDF package in Formula |
| null | String | Token if |
| null | String | |
|
| Integer | |
|
| Integer | |
|
| Integer |
If your endpoint is set up in a Data Lab project, you must provide the Agents
group with Read and Write permissions to the DataLab project that hosts the API endpoint.
Known Issues
There are no known issues with this connector. Please report any issues you find to our support portal.
Please report any other issues you find to our support portal.
Troubleshooting
If you are having issues connecting to or accessing data from the Add-on Calculation Webhook, view our guide for troubleshooting datasource issues. Also, check out the https://support.seeq.com/kb/latest/cloud/add-on-calculation-engine and https://support.seeq.com/kb/latest/cloud/creating-user-defined-formula-functionssupport pages.
Performance considerations
Connecting to the Add-on Calculation Webhook does not have any special performance considerations. View our guide on optimizing datasource performance for general guidance.