Alerting: Enable sending notifications to a specific topic on Telegram (#79546)

Co-authored-by: Yuri Tseretyan <yuriy.tseretyan@grafana.com>
This commit is contained in:
Gokhan 2024-02-06 18:19:22 +03:00 committed by GitHub
parent ce12eba858
commit cf601fab09
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 15 additions and 3 deletions

2
go.mod
View File

@ -59,7 +59,7 @@ require (
github.com/google/uuid v1.5.0 // @grafana/backend-platform
github.com/google/wire v0.5.0 // @grafana/backend-platform
github.com/gorilla/websocket v1.5.0 // @grafana/grafana-app-platform-squad
github.com/grafana/alerting v0.0.0-20240201111525-bd6396bbe2e1 // @grafana/alerting-squad-backend
github.com/grafana/alerting v0.0.0-20240202155917-ec2c02267fa5 // @grafana/alerting-squad-backend
github.com/grafana/cuetsy v0.1.11 // @grafana/grafana-as-code
github.com/grafana/grafana-aws-sdk v0.23.1 // @grafana/aws-datasources
github.com/grafana/grafana-azure-sdk-go v1.12.0 // @grafana/partner-datasources

2
go.sum
View File

@ -1916,6 +1916,8 @@ github.com/gotestyourself/gotestyourself v1.3.0/go.mod h1:zZKM6oeNM8k+FRljX1mnzV
github.com/gotestyourself/gotestyourself v2.2.0+incompatible/go.mod h1:zZKM6oeNM8k+FRljX1mnzVYeS8wiGgQyvST1/GafPbY=
github.com/grafana/alerting v0.0.0-20240201111525-bd6396bbe2e1 h1:xxtCQ02pBCzzr1GNZo2fUVrJLQZ9X/vp6rigDRN6PMo=
github.com/grafana/alerting v0.0.0-20240201111525-bd6396bbe2e1/go.mod h1:WMFwxILmCOpaeHe9xP/2v7fxRMStGcW4t2Iuc97Oi6k=
github.com/grafana/alerting v0.0.0-20240202155917-ec2c02267fa5 h1:gt514QzadNdnaNKm4DcmDo3ph0M7Hhg1+sdMEhPFVrA=
github.com/grafana/alerting v0.0.0-20240202155917-ec2c02267fa5/go.mod h1:WMFwxILmCOpaeHe9xP/2v7fxRMStGcW4t2Iuc97Oi6k=
github.com/grafana/codejen v0.0.3 h1:tAWxoTUuhgmEqxJPOLtJoxlPBbMULFwKFOcRsPRPXDw=
github.com/grafana/codejen v0.0.3/go.mod h1:zmwwM/DRyQB7pfuBjTWII3CWtxcXh8LTwAYGfDfpR6s=
github.com/grafana/cue v0.0.0-20230926092038-971951014e3f h1:TmYAMnqg3d5KYEAaT6PtTguL2GjLfvr6wnAX8Azw6tQ=

View File

@ -188,8 +188,9 @@ type SlackIntegration struct {
type TelegramIntegration struct {
DisableResolveMessage *bool `json:"-" yaml:"-" hcl:"disable_resolve_message"`
BotToken Secret `json:"bottoken" yaml:"bottoken" hcl:"token"`
ChatID string `json:"chatid,omitempty" yaml:"chatid,omitempty" hcl:"chat_id"`
BotToken Secret `json:"bottoken" yaml:"bottoken" hcl:"token"`
ChatID string `json:"chatid,omitempty" yaml:"chatid,omitempty" hcl:"chat_id"`
MessageThreadID string `json:"message_thread_id,omitempty" yaml:"message_thread_id,omitempty" hcl:"message_thread_id"`
Message *string `json:"message,omitempty" yaml:"message,omitempty" hcl:"message"`
ParseMode *string `json:"parse_mode,omitempty" yaml:"parse_mode,omitempty" hcl:"parse_mode"`

View File

@ -815,6 +815,15 @@ func GetAvailableNotifiers() []*NotifierPlugin {
PropertyName: "chatid",
Required: true,
},
{
Label: "Message Thread ID",
Element: ElementTypeInput,
InputType: InputTypeText,
Description: "Integer Telegram Message Thread Identifier",
PropertyName: "message_thread_id",
Required: false,
ValidationRule: "-?[0-9]{1,10}",
},
{ // New in 8.0.
Label: "Message",
Element: ElementTypeTextArea,