Skip to content

Commit b355a38

Browse files
update notifications dev docs (#480)
1 parent e37d256 commit b355a38

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

docs/dev/notifications.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,15 @@ Each notification has a structure that includes the following fields:
3131
```json
3232
{
3333
"title": "string", // e.g., "Geth Ethereum Node Sync Status"
34-
"body": "string", // e.g., "Triggered: Geth Ethereum Node Syncing"
34+
"body": "string", // e.g., "Geth Ethereum Node Syncing"
3535
"category": "string", // e.g., "ethereum"
3636
"dnpName": "string", // e.g., "geth.dnp.dappnode.eth"
3737
"seen": false, // e.g., false
3838
"timestamp": "string", // e.g., "2023-10-01T12:00:00Z"
39+
"priority": "string", // e.g., "medium"
40+
"status": "string", // e.g., "triggered"
41+
"correlationId": "string", // e.g., "geth-eth-syncing"
42+
"isBanner": false, // e.g., false
3943
"callToAction": {
4044
"title": "string", // e.g., "View Logs"
4145
"url": "string" // e.g., "http://dappmanager.dappnode/packages/my/geth.dnp.dappnode.eth/logs"
@@ -66,11 +70,14 @@ curl -X POST \
6670
"body": "This is a test notification sent with curl",
6771
"category": "other",
6872
"dnpName": "test.dnp.dappnode.eth",
73+
"priority": "low",
74+
"status": "triggered",
6975
"callToAction": {
7076
"title": "Hello World",
7177
"url": "http://dappmanager.dappnode"
7278
},
73-
"icon": "https://gateway.ipfs.dappnode.io/ipfs/QmTVc5LQkTuaN3VxcteQ2E27pHSVJakE6XPo2FMxQTP284"
79+
"correlationId": "testPkg-test",
80+
"isBanner": false
7481
}'
7582
```
7683

docs/dev/references/notifications.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ endpoints:
3333
definition:
3434
title: "Mainnet ETH Node Synced Check" # Notifications - settings: title of the notification to be configured
3535
description: "Check if the Mainnet ETH Node is synced. You will receive a notification if the node is syncing and another one when it is synced." # Notifications - settings: description of the notification to be configured
36+
correlationId: "geth-eth-syncing" # Unique identifier for each notification endpoint
37+
isBanner: false
38+
priority: "medium"
3639
alerts:
3740
- type: custom
3841
enabled: true
@@ -51,6 +54,9 @@ An array of configured notification endpoints. Each endpoint object includes:
5154
- **`conditions`** (`string[]`, required): Array of string expressions representing the conditions that trigger the alert.
5255
- **`interval`** (`string`, required): Time between checks. Must match the pattern `^[0-9]+[smhd]$` (e.g., `10s`, `5m`, `1h`, `1d`).
5356
- **`group`** (`string`, required): Group to which the endpoint belongs.
57+
- **`correlationId`** (`string`, required): It is the unique identifier that links triggered and resolved notifications based on their endpoint.
58+
- **`isBanner`** (`boolean`, required): Boolean that controls whether a banner displaying the notification appears at the top of the DAppManager UI. Should be set to `true` only for relevant notifications.
59+
- **`priority`** (`string`, required): Priority that will be displayed on the notification. One of: `low`, `medium`, `high`, `critical`.
5460
- **`alerts`** (`array`, required): List of alert configurations for this endpoint.
5561

5662
Each alert object includes:
@@ -105,6 +111,8 @@ The response will include the manifest with user settings for custom endpoints:
105111
```yaml
106112
customEndpoints:
107113
- name: "Package updates notifications"
114+
isBanner: false
115+
correlationId: "dappmanager-update-pkg"
108116
description: "Receive package updates notifications when a new version is available."
109117
enabled: true
110118
```
@@ -114,6 +122,8 @@ Each object includes:
114122
- **`enabled`** (`boolean`, required): Whether the custom endpoint is active.
115123
- **`name`** (`string`, required): Unique name for the custom metric.
116124
- **`description`** (`string`, required): Explanation of the custom metric.
125+
- **`correlationId`** (`string`, required): It is the unique identifier that links triggered and resolved notifications based on their endpoint.
126+
- **`isBanner`** (`boolean`, required): Boolean that controls whether a banner displaying the notification appears at the top of the DAppManager UI. Should be set to `true` only for relevant notifications.
117127
- **`metric`** (`object`, optional): Metric boundaries and unit.
118128
- **`treshold`** (`number`, optional): Threshold value to trigger alert (note: possibly a typo, intended to be `threshold`).
119129
- **`min`** (`number`, optional): Minimum acceptable value.

0 commit comments

Comments
 (0)