Edge Delta Threshold Node

Define thresholds for trigger nodes.

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. See the dimension numeric capture log to metric example.

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 logs are sent through a log to metric node that calculates the average delivery time per platform:

2023-04-15 12:05:23.123123 platform=mobile_app customer_id=node1612345 order_id=67890 delivery_time=39 order_status=delivered
2023-04-15 12:06:45.456456 platform=mobile_app customer_id=node1623456 order_id=78901 delivery_time=41 order_status=delivered
2023-04-15 12:07:17.789789 platform=web customer_id=node1634567 order_id=89012 delivery_time=30 order_status=delivered
2023-04-15 12:08:09.987987 platform=mobile_app customer_id=node1645678 order_id=90123 delivery_time=42 order_status=delivered
2023-04-15 12:10:22.654321 platform=web customer_id=node1656789 order_id=12345 delivery_time=39 order_status=delivered

The following metrics would be created and 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 output node for an example of handling this 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