[ZBXNEXT-3441] Unify trigger expressions and calculated item formulas (at least syntax) Created: 2016 Sep 15  Updated: 2021 Jan 19  Resolved: 2021 Jan 19

Status: Closed
Project: ZABBIX FEATURE REQUESTS
Component/s: Frontend (F), Server (S)
Affects Version/s: 3.4.0alpha1
Fix Version/s: None

Type: Change Request Priority: Major
Reporter: Glebs Ivanovskis (Inactive) Assignee: Unassigned
Resolution: Duplicate Votes: 2
Labels: calculateditems, codequality, syntax, triggers, usability
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates ZBXNEXT-6451 Support new syntax for trigger expres... Closed
is duplicated by ZBXNEXT-6374 Unified syntax for trigger expression... Closed
Epic Link: DEV-591
Story Points: 8

 Description   

Trigger expressions and calculated items support the same set of trigger functions, operators, (more or less) macros. However, there are very significant differences which both worsen user experience and make development harder.

  Triggers Calculated items
Function syntax
{host:key.func(params)}
func(<host:>key,params)
Frontend-side syntax validation Yes No
Configurable update interval No Yes
Can be referenced No Yes, by host:key in triggers, other calculated items and aggregated items
Can trigger Actions Yes No
Guaranteed reevaluation for every new value Yes No
Support for LLD macros in function parameters No (ZBXNEXT-1667) Yes

Under the hood triggers are preprocessed by frontend and stored in two separate DB tables, while calculated items are stored as single piece raw formula and server needs to do the same preprocessing as frontend before using trigger functions for calculated item evaluation.

This code separation between frontend and server and between triggers and calculated items hinders development of new features a lot. Most recent example are context based macros - added half a year ago, but still not fully supported (ZBX-11206, ZBX-11207, ZBX-11211). Imagine, to add a new feature for both triggers and calculated items (macro functions, for example) we need to update code in 6 places:

  • frontend trigger expression validation;
  • (nonexistent so far) frontend calculated item formula validation;
  • server-side trigger expression evaluation;
  • server-side calculated item formula evaluation;
  • server-side creation of LLD triggers out of trigger prototypes;
  • server-side creation of LLD calculated items out of prototypes.

Let's put all eggs in one basket. It should not be that difficult to perform automatic upgrade of all calculated item formulas to trigger-like syntax. Server does it on-the-fly every time it polls calculated item.



 Comments   
Comment by Rostislav Palivoda [ 2021 Jan 19 ]

Please follow ZBXNEXT-6451 

Generated at Fri Apr 26 19:31:20 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.