From 0eee3ca9cb15995d593d84d311e60acc6d61e78e Mon Sep 17 00:00:00 2001
From: Alex Weaver <weaver.alex.d@gmail.com>
Date: Tue, 13 Dec 2022 17:26:14 -0600
Subject: [PATCH] Rename key to max_runes

Signed-off-by: Alex Weaver <weaver.alex.d@gmail.com>
---
 notify/opsgenie/opsgenie.go   | 2 +-
 notify/pagerduty/pagerduty.go | 4 ++--
 notify/pushover/pushover.go   | 6 +++---
 notify/slack/slack.go         | 2 +-
 notify/telegram/telegram.go   | 2 +-
 notify/victorops/victorops.go | 2 +-
 6 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/notify/opsgenie/opsgenie.go b/notify/opsgenie/opsgenie.go
index a3ba2f45..426734f2 100644
--- a/notify/opsgenie/opsgenie.go
+++ b/notify/opsgenie/opsgenie.go
@@ -176,7 +176,7 @@ func (n *Notifier) createRequests(ctx context.Context, as ...*types.Alert) ([]*h
 	default:
 		message, truncated := notify.TruncateInRunes(tmpl(n.conf.Message), maxMessageLenRunes)
 		if truncated {
-			level.Warn(n.logger).Log("msg", "Truncated message", "alert", key, "runes", maxMessageLenRunes)
+			level.Warn(n.logger).Log("msg", "Truncated message", "alert", key, "max_runes", maxMessageLenRunes)
 		}
 
 		createEndpointURL := n.conf.APIURL.Copy()
diff --git a/notify/pagerduty/pagerduty.go b/notify/pagerduty/pagerduty.go
index 1e549db8..b6b816e0 100644
--- a/notify/pagerduty/pagerduty.go
+++ b/notify/pagerduty/pagerduty.go
@@ -157,7 +157,7 @@ func (n *Notifier) notifyV1(
 
 	description, truncated := notify.TruncateInRunes(tmpl(n.conf.Description), maxV1DescriptionLenRunes)
 	if truncated {
-		level.Warn(n.logger).Log("msg", "Truncated description", "key", key, "runes", maxV1DescriptionLenRunes)
+		level.Warn(n.logger).Log("msg", "Truncated description", "key", key, "max_runes", maxV1DescriptionLenRunes)
 	}
 
 	serviceKey := string(n.conf.ServiceKey)
@@ -222,7 +222,7 @@ func (n *Notifier) notifyV2(
 
 	summary, truncated := notify.TruncateInRunes(tmpl(n.conf.Description), maxV2SummaryLenRunes)
 	if truncated {
-		level.Warn(n.logger).Log("msg", "Truncated summary", "key", key, "runes", maxV2SummaryLenRunes)
+		level.Warn(n.logger).Log("msg", "Truncated summary", "key", key, "max_runes", maxV2SummaryLenRunes)
 	}
 
 	routingKey := string(n.conf.RoutingKey)
diff --git a/notify/pushover/pushover.go b/notify/pushover/pushover.go
index 3a3361a0..c5fc287a 100644
--- a/notify/pushover/pushover.go
+++ b/notify/pushover/pushover.go
@@ -89,7 +89,7 @@ func (n *Notifier) Notify(ctx context.Context, as ...*types.Alert) (bool, error)
 
 	title, truncated := notify.TruncateInRunes(tmpl(n.conf.Title), maxTitleLenRunes)
 	if truncated {
-		level.Warn(n.logger).Log("msg", "Truncated title", "incident", key, "runes", maxTitleLenRunes)
+		level.Warn(n.logger).Log("msg", "Truncated title", "incident", key, "max_runes", maxTitleLenRunes)
 	}
 	parameters.Add("title", title)
 
@@ -102,7 +102,7 @@ func (n *Notifier) Notify(ctx context.Context, as ...*types.Alert) (bool, error)
 
 	message, truncated = notify.TruncateInRunes(message, maxMessageLenRunes)
 	if truncated {
-		level.Warn(n.logger).Log("msg", "Truncated message", "incident", key, "runes", maxMessageLenRunes)
+		level.Warn(n.logger).Log("msg", "Truncated message", "incident", key, "max_runes", maxMessageLenRunes)
 	}
 	message = strings.TrimSpace(message)
 	if message == "" {
@@ -113,7 +113,7 @@ func (n *Notifier) Notify(ctx context.Context, as ...*types.Alert) (bool, error)
 
 	supplementaryURL, truncated := notify.TruncateInRunes(tmpl(n.conf.URL), maxURLLenRunes)
 	if truncated {
-		level.Warn(n.logger).Log("msg", "Truncated URL", "incident", key, "runes", maxURLLenRunes)
+		level.Warn(n.logger).Log("msg", "Truncated URL", "incident", key, "max_runes", maxURLLenRunes)
 	}
 	parameters.Add("url", supplementaryURL)
 	parameters.Add("url_title", tmpl(n.conf.URLTitle))
diff --git a/notify/slack/slack.go b/notify/slack/slack.go
index 42851939..22bb3093 100644
--- a/notify/slack/slack.go
+++ b/notify/slack/slack.go
@@ -109,7 +109,7 @@ func (n *Notifier) Notify(ctx context.Context, as ...*types.Alert) (bool, error)
 		if err != nil {
 			return false, err
 		}
-		level.Warn(n.logger).Log("msg", "Truncated title", "key", key, "runes", maxTitleLenRunes)
+		level.Warn(n.logger).Log("msg", "Truncated title", "key", key, "max_runes", maxTitleLenRunes)
 	}
 	att := &attachment{
 		Title:      title,
diff --git a/notify/telegram/telegram.go b/notify/telegram/telegram.go
index f02b8bdb..90e0ca35 100644
--- a/notify/telegram/telegram.go
+++ b/notify/telegram/telegram.go
@@ -76,7 +76,7 @@ func (n *Notifier) Notify(ctx context.Context, alert ...*types.Alert) (bool, err
 
 	messageText, truncated := notify.TruncateInRunes(tmpl(n.conf.Message), maxMessageLenRunes)
 	if truncated {
-		level.Warn(n.logger).Log("msg", "Truncated message", "alert", key, "runes", maxMessageLenRunes)
+		level.Warn(n.logger).Log("msg", "Truncated message", "alert", key, "max_runes", maxMessageLenRunes)
 	}
 
 	message, err := n.client.Send(telebot.ChatID(n.conf.ChatID), messageText, &telebot.SendOptions{
diff --git a/notify/victorops/victorops.go b/notify/victorops/victorops.go
index 8111cc8e..02c93621 100644
--- a/notify/victorops/victorops.go
+++ b/notify/victorops/victorops.go
@@ -139,7 +139,7 @@ func (n *Notifier) createVictorOpsPayload(ctx context.Context, as ...*types.Aler
 
 	stateMessage, truncated := notify.TruncateInRunes(stateMessage, maxMessageLenRunes)
 	if truncated {
-		level.Warn(n.logger).Log("msg", "Truncated state_message", "incident", key, "runes", maxMessageLenRunes)
+		level.Warn(n.logger).Log("msg", "Truncated state_message", "incident", key, "max_runes", maxMessageLenRunes)
 	}
 
 	msg := map[string]string{