Rule Library
This page is under development.
Screenshots and detailed configuration options will be added soon.
Rule Library is the screen where automation rules are created and managed. Each rule binds a data source query, a condition expression, and an action.
Prerequisite
Before defining a rule, create a data source in Port and then a query in Compass. You will select that Compass record in the Trigger section.
Rule Components
| Component | Description |
|---|---|
| Trigger | Which data source or Compass query to monitor |
| Condition | Which value or state transition activates the rule |
| Action | What to do when triggered (Alert Center entry, webhook, email) |
| Priority | Critical / High / Medium / Low |
| Status | Active / Inactive — pause without removing the rule |
Creating a Rule
- Open Automation → Rule Library in the left menu.
- Click the Add New Rule button.
- In the Trigger section pick a data source and the relevant Compass query.
- In the Condition section define the threshold value or state expression (e.g.
value > 95). - In the Action section define what happens when triggered.
- Enter priority and description; click Save.
Condition Syntax
Conditions are written as JavaScript-like expressions (Goja engine):
| Example | Meaning |
|---|---|
value > 95 |
When the value exceeds 95 |
value < 10 \|\| value > 90 |
When the value goes out of range |
value >= threshold && status !== 'maintenance' |
When threshold is exceeded and not in maintenance |
status === 'stopped' |
When status becomes "stopped" |
Action Configuration
Alert Center Entry (Default)
When Alert Center is selected as the action, a record is automatically created in Alert Center when the rule triggers. The record includes the rule name, priority, trigger time, and the value at the time of trigger.
Webhook
- Select Webhook in the Action section.
- Enter the target URL (e.g.
https://hooks.example.com/alert). - Optionally add HTTP headers and a payload template.
- Pirivision sends a POST request to this URL when the rule triggers.
Payload
The JSON body includes the rule name, trigger time, value, and priority.
Email Notification
- Select Email in the Action section.
- Enter recipient email addresses (comma-separated).
- Customize the subject line.
- A notification email is sent to the listed addresses when the rule triggers.
SMTP Configuration
The email action requires SMTP configuration to be completed in the Docker Compose environment.
Rule Management
| Action | Description |
|---|---|
| Edit | Update any component of the rule |
| Active / Inactive | Toggle to temporarily pause the rule |
| Delete | Remove the rule permanently |
| Test | Trigger the condition manually with current data and see the result |
Next Step
→ Alert Center — Alert Management → Automation Overview → Horizon — Monitoring Panel → Atlas — Advanced Dashboard
Common Mistakes
| Mistake | Why It Happens | Fix |
|---|---|---|
| Rule never triggers | Compass query returns no data | Test the query in Compass; verify data is present |
| Rule triggers constantly | Condition is true on every data update | Add a time window or debounce interval to the condition |
| Webhook fails | Target URL unreachable | Verify the URL is accessible from the Docker network |
| Email not received | SMTP not configured | Check the SMTP variables in dev/.env |