Alerting: Fix logging pointer address of DashboardUID and PanelID variables (#58539)

This commit is contained in:
George Robinson
2022-11-10 09:58:38 +00:00
committed by GitHub
parent 68600c224b
commit c5ae1bcfe0
3 changed files with 28 additions and 10 deletions
+16
View File
@@ -166,6 +166,22 @@ type AlertRule struct {
Labels map[string]string
}
// GetDashboardUID returns the DashboardUID or "".
func (alertRule *AlertRule) GetDashboardUID() string {
if alertRule.DashboardUID != nil {
return *alertRule.DashboardUID
}
return ""
}
// GetPanelID returns the Panel ID or -1.
func (alertRule *AlertRule) GetPanelID() int64 {
if alertRule.PanelID != nil {
return *alertRule.PanelID
}
return -1
}
type LabelOption func(map[string]string)
func WithoutInternalLabels() LabelOption {