Add additional labels to a monitor #3078

Open
opened 2026-02-28 03:17:07 -05:00 by deekerman · 0 comments
Owner

Originally created by @xathon on GitHub (Jan 29, 2024).

The issue is similar to #4344 and the issues linked in there, but this request is more about passing additional options to a notification.

🏷️ Feature Request Type

API / automation options, Change to existing notification-provider

🔖 Feature description

I would like to be able to add additional "labels" to a monitor, which could be passed to a notification. Those keys and values should be configurable by the user and usable in the notification wizard by referencing the monitor JSON.

✔️ Solution

The monitor json object should be extended to hold the labels:

[...]
  "monitor": {
    "id": 2,
    "name": "test",👈🏻👈🏻👈🏻👈🏻👈🏻
    "url": "https://test",
    "hostname": null,
    "port": null,
    "maxretries": 0,
    "weight": 2000,
    "active": 1,
    "type": "http",
    "interval": 60,
    "keyword": null,
    "notificationIDList": {
      "3": true
    },
    "labels": {
        "my_label": "my_value",
        "my_other_label": "my_other_value"
    }
},
[...]

These labels should be configured on the monitor add/edit page.

Alternatives

No response

📝 Additional Context

My use case is that I want to pass container names to a script which automatically restarts them. It would be possible to use the friendly name for that, but sometimes the name of the docker container is different to the name I picked for it in UK.

An alternative use case could e.g. be that an e-mail is sent to different persons based on what's specified in the monitor.

Originally created by @xathon on GitHub (Jan 29, 2024). ### 📑 I have found these related issues/pull requests The issue is similar to #4344 and the issues linked in there, but this request is more about passing additional options to a notification. ### 🏷️ Feature Request Type API / automation options, Change to existing notification-provider ### 🔖 Feature description I would like to be able to add additional "labels" to a monitor, which could be passed to a notification. Those keys and values should be configurable by the user and usable in the notification wizard by referencing the monitor JSON. ### ✔️ Solution The monitor json object should be extended to hold the labels: ``` [...] "monitor": { "id": 2, "name": "test",👈🏻👈🏻👈🏻👈🏻👈🏻 "url": "https://test", "hostname": null, "port": null, "maxretries": 0, "weight": 2000, "active": 1, "type": "http", "interval": 60, "keyword": null, "notificationIDList": { "3": true }, "labels": { "my_label": "my_value", "my_other_label": "my_other_value" } }, [...] ``` These labels should be configured on the monitor add/edit page. ### ❓ Alternatives _No response_ ### 📝 Additional Context My use case is that I want to pass container names to a script which automatically restarts them. It would be possible to use the friendly name for that, but sometimes the name of the docker container is different to the name I picked for it in UK. An alternative use case could e.g. be that an e-mail is sent to different persons based on what's specified in the monitor.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/uptime-kuma#3078
No description provided.