@@ -228,6 +228,9 @@ func resolveFilepaths(baseDir string, cfg *Config) {
228
228
for _ , cfg := range receiver .OpsGenieConfigs {
229
229
cfg .HTTPConfig .SetDirectory (baseDir )
230
230
}
231
+ for _ , cfg := range receiver .TelegramConfigs {
232
+ cfg .HTTPConfig .SetDirectory (baseDir )
233
+ }
231
234
for _ , cfg := range receiver .PagerdutyConfigs {
232
235
cfg .HTTPConfig .SetDirectory (baseDir )
233
236
}
@@ -511,6 +514,14 @@ func (c *Config) Validate() error {
511
514
ogc .APIKeyFile = c .Global .OpsGenieAPIKeyFile
512
515
}
513
516
}
517
+ for _ , telegram := range rcv .TelegramConfigs {
518
+ if telegram .HTTPConfig == nil {
519
+ telegram .HTTPConfig = c .Global .HTTPConfig
520
+ }
521
+ if telegram .APIUrl == nil {
522
+ telegram .APIUrl = c .Global .TelegramAPIUrl
523
+ }
524
+ }
514
525
for _ , wcc := range rcv .WechatConfigs {
515
526
if wcc .HTTPConfig == nil {
516
527
wcc .HTTPConfig = c .Global .HTTPConfig
@@ -770,6 +781,7 @@ func DefaultGlobalConfig() GlobalConfig {
770
781
SMTPRequireTLS : true ,
771
782
PagerdutyURL : mustParseURL ("https://events.pagerduty.com/v2/enqueue" ),
772
783
OpsGenieAPIURL : mustParseURL ("https://api.opsgenie.com/" ),
784
+ TelegramAPIUrl : mustParseURL ("https://api.telegram.org" ),
773
785
WeChatAPIURL : mustParseURL ("https://qyapi.weixin.qq.com/cgi-bin/" ),
774
786
VictorOpsAPIURL : mustParseURL ("https://alert.victorops.com/integrations/generic/20131114/alert/" ),
775
787
}
@@ -889,6 +901,7 @@ type GlobalConfig struct {
889
901
OpsGenieAPIURL * URL `yaml:"opsgenie_api_url,omitempty" json:"opsgenie_api_url,omitempty"`
890
902
OpsGenieAPIKey Secret `yaml:"opsgenie_api_key,omitempty" json:"opsgenie_api_key,omitempty"`
891
903
OpsGenieAPIKeyFile string `yaml:"opsgenie_api_key_file,omitempty" json:"opsgenie_api_key_file,omitempty"`
904
+ TelegramAPIUrl * URL `yaml:"telegram_api_url,omitempty" json:"telegram_api_url,omitempty"`
892
905
WeChatAPIURL * URL `yaml:"wechat_api_url,omitempty" json:"wechat_api_url,omitempty"`
893
906
WeChatAPISecret Secret `yaml:"wechat_api_secret,omitempty" json:"wechat_api_secret,omitempty"`
894
907
WeChatAPICorpID string `yaml:"wechat_api_corp_id,omitempty" json:"wechat_api_corp_id,omitempty"`
@@ -1052,6 +1065,7 @@ type Receiver struct {
1052
1065
SlackConfigs []* SlackConfig `yaml:"slack_configs,omitempty" json:"slack_configs,omitempty"`
1053
1066
WebhookConfigs []* WebhookConfig `yaml:"webhook_configs,omitempty" json:"webhook_configs,omitempty"`
1054
1067
OpsGenieConfigs []* OpsGenieConfig `yaml:"opsgenie_configs,omitempty" json:"opsgenie_configs,omitempty"`
1068
+ TelegramConfigs []* TelegramConfig `yaml:"telegram_configs,omitempty" json:"telegram_configs,omitempty"`
1055
1069
WechatConfigs []* WechatConfig `yaml:"wechat_configs,omitempty" json:"wechat_configs,omitempty"`
1056
1070
PushoverConfigs []* PushoverConfig `yaml:"pushover_configs,omitempty" json:"pushover_configs,omitempty"`
1057
1071
VictorOpsConfigs []* VictorOpsConfig `yaml:"victorops_configs,omitempty" json:"victorops_configs,omitempty"`
0 commit comments