mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Alerting: Add first Grafana reserved label grafana_folder (#50262)
* Alerting: Add first Grafana reserved label g_label g_label holds the title of the folder container the alert. The intention of this label is to use it as part of the new default notification policy groupBy. * Add nil check on updateRule labels map * Disable gocyclo lint on schedule.ruleRoutine will remove later in a separate refactoring PR to reduce complexity. * Address doc suggestions * Update g_folder for rules in folder when folder title changes * Remove global bus in FolderService * Modify tests to fit new common g_folder label * Add changelog entry * Fix merge conflicts * Switch GrafanaReservedLabelPrefix from `g_` to `grafana_`
This commit is contained in:
@@ -87,6 +87,14 @@ const (
|
||||
// This isn't a hard-coded secret token, hence the nolint.
|
||||
//nolint:gosec
|
||||
ScreenshotTokenAnnotation = "__alertScreenshotToken__"
|
||||
|
||||
// GrafanaReservedLabelPrefix contains the prefix for Grafana reserved labels. These differ from "__<label>__" labels
|
||||
// in that they are not meant for internal-use only and will be passed-through to AMs and available to users in the same
|
||||
// way as manually configured labels.
|
||||
GrafanaReservedLabelPrefix = "grafana_"
|
||||
|
||||
// FolderTitleLabel is the label that will contain the title of an alert's folder/namespace.
|
||||
FolderTitleLabel = GrafanaReservedLabelPrefix + "folder"
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
Reference in New Issue
Block a user