routing_key in the following request content with the Integration Key in PagerDuty.Accept: application/json
Content-Type: application/json
{"payload": {"summary": "{{escape .Alarm}}","timestamp": "{{fromUnixTime .NotifyTimeUnix}}","severity": "{{if eq .Level "Critical"}}critical{{else if eq .Level "Warn"}}warning{{else if eq .Level "Info"}}info{{end}}","source": "Tencent Cloud Log Service","custom_details": {"Alarm Policy": "{{escape .Alarm}}","Trigger Condition": "{{escape .Condition}}","Current Data": "{{escape .TriggerParams}}","Additional Message": "{{escape .Message}}","Multidimensional Analysis": "{{escape .AnalysisResultFormat}}"}},"routing_key": "R03ECCMUCxxxxxxxxxxxNGFE87CT","dedup_key": "{{.RecordGroupId}}","event_action": "trigger","client": "{{escape .Topic}}","client_url": "{{.QueryUrl}}","links": [{"href": "{{.DetailUrl}}","text": "Alert Detail"}]}
Accept: application/json
Content-Type: application/json
{"payload": {"summary": "{{escape .Alarm}}","timestamp": "{{fromUnixTime .NotifyTimeUnix}}","severity": "{{if eq .Level "Critical"}}critical{{else if eq .Level "Warn"}}warning{{else if eq .Level "Info"}}info{{end}}","source": "Tencent Cloud Log Service"},"routing_key": "R03ECCMUCxxxxxxxxxxxNGFE87CT","dedup_key": "{{.RecordGroupId}}","event_action": "resolve"}
Content-Type: application/x-www-form-urlencoded
{{- define "subTemplate" -}}Alarm triggered for the log service of account {{.UIN}} ({{.Nickname}}):• Alarm Policy: {{.Alarm}}• Alarm Level: {{.Level}}• Monitoring Object: {{.Topic}}• Trigger Condition: {{.Condition}}• Current Data: {{.TriggerParams}}• Trigger Time: {{.StartTime}}{{- if (gt .Duration 0)}}• Duration: {{.Duration}} minutes{{- end}}• Additional Message: {{.Message}}• Multidimensional Analysis:``{{.AnalysisResultFormat}}``<{{.DetailUrl}}|DetailedReport> <{{.QueryUrl}}|QueryData>{{if .CanSilent}} <{{.DetailUrl}}|ClaimAlarm> <{{.SilentUrl}}|SilenceAlarm>{{end}}{{- end -}}payload={"username": "CLS Alert","icon_emoji": ":rotating_light:","blocks": [{"type":"header","text":{"type":"plain_text","text":":rotating_light:Alarm:{{escape .Alarm}}","emoji":true}},{"type": "section","text": {"type": "mrkdwn","text": "{{escape (substr (renderTemplate "subTemplate") 0 3500)}}"}}]}
Content-Type: application/x-www-form-urlencoded
{{- define "subTemplate" -}}A CLS alarm was resolved under your account (ID: {{.UIN}}; name: {{.Nickname}}):• Alarm Policy: {{.Alarm}}• Alarm Level: {{.Level}}• Monitoring Object: {{.Topic}}• Trigger Condition: {{.Condition}}• Trigger Time: {{.StartTime}}• Resolved Time: {{.NotifyTime}}• Duration: {{.Duration}} minutes"{{- end -}}payload={"username": "CLS Alert","icon_emoji": ":green_circle:","blocks": [{"type":"header","text":{"type":"plain_text","text":":large_green_circle:Resolved:{{escape .Alarm}}","emoji":true}},{"type": "section","text": {"type": "mrkdwn","text": "{{escape (substr (renderTemplate "subTemplate") 0 3500)}}"}}]}
Content-Type: application/json
{{- define "subTemplate" -}}Alarm triggered for the log service of account {{.UIN}} ({{.Nickname}}):- Alarm Policy: {{.Alarm}}- Alarm Level: {{.Level}}- Monitoring Object: {{.Topic}}- Trigger Condition: {{.Condition}}- Current Data: {{.TriggerParams}}- Trigger Time: {{.StartTime}}{{- if (gt .Duration 0)}}- Duration: {{.Duration}} minutes{{- end}}- Additional Message: {{.Message}}{{- range $key,$value := .AnalysisResult}}{{$key}}{{$value}}{{- end}}{{- end -}}{"type": "message","attachments": [{"contentType": "application/vnd.microsoft.card.adaptive","content": {"$schema": "http://adaptivecards.io/schemas/adaptive-card.json","type": "AdaptiveCard","version": "1.3","msteams": {"width": "Full"},"body": [{"type": "TextBlock","text": "Alarm:{{escape .Alarm}}","wrap": true,"color": "{{if eq .Level "Critical"}}attention{{else if eq .Level "Warn"}}warning{{else if eq .Level "Info"}}accent{{end}}","size": "Large"},{"type": "TextBlock","text": "{{- escape (substr (renderTemplate "subTemplate") 0 3500)}}","wrap": true},{"type": "ActionSet","actions": [{"type":"Action.OpenUrl","title":"DetailedReport","url":"{{.DetailUrl}}"},{"type":"Action.OpenUrl","title":"QueryData","url":"{{.QueryUrl}}"}{{if.CanSilent}},{"type":"Action.OpenUrl","title":"ClaimAlarm","url":"{{.DetailUrl}}"},{"type":"Action.OpenUrl","title":"SilenceAlarm","url":"{{.SilentUrl}}"}{{end}}]}]}}]}
Content-Type: application/json
{{- define "subTemplate" -}}A CLS alarm was resolved under your account (ID: {{.UIN}}; name: {{.Nickname}}):- Alarm Policy: {{.Alarm}}- Alarm Level: {{.Level}}- Monitoring Object: {{.Topic}}- Trigger Condition: {{.Condition}}- Trigger Time: {{.StartTime}}- Resolved Time: {{.NotifyTime}}- Duration: {{.Duration}} minutes"{{- end -}}{"type": "message","attachments": [{"contentType": "application/vnd.microsoft.card.adaptive","content": {"$schema": "http://adaptivecards.io/schemas/adaptive-card.json","type": "AdaptiveCard","version": "1.3","msteams": {"width": "Full"},"body": [{"type": "TextBlock","text": "Resolved:{{escape .Alarm}}","wrap": true,"color": "good","size": "Large"},{"type": "TextBlock","text": "{{- escape (substr (renderTemplate "subTemplate") 0 3500)}}","wrap": true}]}}]}
Authorization in the request header with the API Key in JSM, format Basic+space+API Key after Base64 encoding.Accept: application/json
Content-Type: application/json
Authorization: Basic YjdiYjI5MWXXXXXXXXXXXXXXXXXdhNDUyYjVmYjQw
{{- define "subTemplate" -}}Current Data:{{.TriggerParams}}Additional Message:{{.Message}}{{.AnalysisResultFormat}}Detail Report:{{.DetailUrl}}{{- end -}}{"message": "{{escape .Alarm}}","alias": "{{.RecordGroupId}}","description": "Alarm Policy:{{escape .Alarm}}\\nTrigger Condition:{{escape .Condition}}","entity": "{{escape .Topic}}","source": "Tencent Cloud Log Service","priority": "{{if eq .Level "Critical"}}P1{{else if eq .Level "Warn"}}P2{{else if eq .Level "Info"}}P5{{end}}","note": "{{escape (substr (renderTemplate "subTemplate") 0 3500)}}"}
Accept: application/json
Content-Type: application/json
Authorization: Basic YjdiYjI5MWXXXXXXXXXXXXXXXXXdhNDUyYjVmYjQw
{{- define "subTemplate" -}}Alarm was resolvedTrigger Time:{{.StartTime}}Resolved Time:{{.NotifyTime}}Duration: {{.Duration}} minutes"{{- end -}}{"message": "{{escape .Alarm}}","alias": "{{.RecordGroupId}}","description": "Alarm Policy:{{escape .Alarm}}\\nTrigger Condition:{{escape .Condition}}","entity": "{{escape .Topic}}","source": "Tencent Cloud Log Service","priority": "{{if eq .Level "Critical"}}P1{{else if eq .Level "Warn"}}P2{{else if eq .Level "Info"}}P5{{end}}","note": "{{escape (substr (renderTemplate "subTemplate") 0 3500)}}"}
Content-Type: application/json; charset=UTF-8
{{- define "subTemplate" -}}*Alarm triggered for the log service of account {{.UIN}} ({{.Nickname}})** Alarm Policy: {{.Alarm}}* Alarm Level: {{.Level}}* Monitoring Object: {{.Topic}}* Trigger Condition: {{.Condition}}* Current Data: {{.TriggerParams}}* Trigger Time: {{.StartTime}}{{- if (gt .Duration 0)}}* Duration: {{.Duration}} minutes{{- end}}* Additional Message: {{.Message}}* Multidimensional Analysis:``{{.AnalysisResultFormat}}``<{{.DetailUrl}}|DetailedReport> <{{.QueryUrl}}|QueryData>{{if .CanSilent}} <{{.DetailUrl}}|ClaimAlarm> <{{.SilentUrl}}|SilenceAlarm>{{end}}{{- end -}}{"text": "{{escape (substr (renderTemplate "subTemplate") 0 3500)}}"}
Content-Type: application/json; charset=UTF-8
{{- define "subTemplate" -}}*A CLS alarm was resolved under your account (ID: {{.UIN}}; name: {{.Nickname}})** Alarm Policy: {{.Alarm}}* Alarm Level: {{.Level}}* Monitoring Object: {{.Topic}}* Trigger Condition: {{.Condition}}* Trigger Time: {{.StartTime}}* Resolved Time: {{.NotifyTime}}* Duration: {{.Duration}} minutes"{{- end -}}{"text": "{{escape (substr (renderTemplate "subTemplate") 0 3500)}}"}
Feedback