Edge Delta Threshold Node
3 minute read
Overview
The Threshold node evaluates metric items for certain conditions and sends a signal to a trigger destination if those conditions are met.
Example Configuration
For example, a threshold node can be configured to trigger a signal if a particular metric surpasses 40.
nodes:
- name: threshold_test
type: threshold
filter: item.name == "delivery_time_by_platform_delivery_time.avg"
condition: value > 40
links:
- from: log_to_metric_test
to: threshold_test
- from: threshold_test
to: webhook_output_test
Input logs:
Suppose the following metrics are fed to the threshold node:
[
{
"_type": "metric",
"attributes": {
"platform": "mobile_app"
},
"gauge": {
"value": 40.666666666666664
},
"kind": "gauge",
"name": "delivery_time_by_platform_delivery_time.avg",
"resource": {
"ed.conf.id": "12345678-1x234-4abc-def5-12345678910g",
"ed.org.id": "1098765a-432b-1cde-2345-fg6789hij101",
"ed.tag": "parallel_container",
"host.ip": "10.0.0.1",
"host.name": "ED_TEST",
"src_type": "memory_input"
},
"start_timestamp": 1715682953917,
"timestamp": 1715683013917,
"unit": "1",
"_stat_type": "avg"
},
{
"_type": "metric",
"attributes": {
"platform": "web"
},
"gauge": {
"value": 34.5
},
"kind": "gauge",
"name": "delivery_time_by_platform_delivery_time.avg",
"resource": {
"ed.conf.id": "12345678-1x234-4abc-def5-12345678910g",
"ed.org.id": "1098765a-432b-1cde-2345-fg6789hij101",
"ed.tag": "parallel_container",
"host.ip": "10.0.0.1",
"host.name": "ED_TEST",
"src_type": "memory_input"
},
"start_timestamp": 1715682953917,
"timestamp": 1715683013917,
"unit": "1",
"_stat_type": "avg"
}
]
Notice how the mobile app metric breaches the threshold on 40.
Output:
Therefore the threshold node outputs the following signal:
[
{
"_type": "signal",
"resource": {
"ed.conf.id": "12345678-1x234-4abc-def5-12345678910g",
"ed.org.id": "1098765a-432b-1cde-2345-fg6789hij101",
"ed.tag": "parallel_container",
"host.ip": "10.0.0.1",
"host.name": "ED_TEST",
"src_type": "memory_input"
},
"signal": {
"description": "delivery_time_by_platform_delivery_time.avg hit threshold threshold_test-threshold-checker of filter: item.name == \"delivery_time_by_platform_delivery_time.avg\" and condition: value > 40 with value 40.67",
"name": "delivery_time_by_platform_delivery_time.avg",
"signal_id": "850666",
"threshold_condition": "value > 40",
"threshold_filter": "item.name == \"delivery_time_by_platform_delivery_time.avg\"",
"title": "Threshold threshold_test-threshold-checker triggered",
"value": 40.666666666666664
},
"timestamp": 1715683146563
}
]
See the Webhook destination node for an example of handling a signal.
Required Parameters
name
A descriptive name for the node. This is the name that will appear in Visual Pipelines and you can reference this node in the YAML using the name. It must be unique across all nodes. It is a YAML list element so it begins with a -
and a space followed by the string. It is a required parameter for all nodes.
nodes:
- name: <node name>
type: <node type>
type: threshold
The type
parameter specifies the type of node being configured. It is specified as a string from a closed list of node types. It is a required parameter.
nodes:
- name: <node name>
type: <node type>
filter
The filter parameter identifies the metrics that are subject to threshold evaluation. It is specified in the Common Expression Language (CEL) and you can use CEL macros. A filter is a required parameter for a threshold.
nodes:
- name: example_threshold
type: threshold
filter: item.name == "error.anomaly1"
condition: value > 90
condition
The condition parameter specifies the condition to evaluate if the node should emit a signal. The evaluation is done on incoming metrics. It is specified using Common Expression Language (CEL) and you can use CEL macros. A condition is required.
nodes:
- name: example_threshold
type: threshold
filter: item.name == "error.anomaly1"
condition: value > 90
consecutive
The consecutive
parameter is the minimum number of times that one of the limits must be exceeded before alerting. Default is 0 so when any limit is exceeded once then the alert is fired. It is optional.
nodes:
- name: example_threshold
type: threshold
filter: item.name == "error.anomaly1"
condition: value > 90
consecutive: 5
See Also: