mirror of
				https://github.com/grafana/grafana.git
				synced 2025-02-25 18:55:37 -06:00 
			
		
		
		
	feat(alerting): add more fields to webhook
This commit is contained in:
		@@ -47,8 +47,19 @@ func (this *WebhookNotifier) Notify(context *alerting.EvalContext) {
 | 
			
		||||
	bodyJSON.Set("title", context.GetNotificationTitle())
 | 
			
		||||
	bodyJSON.Set("ruleId", context.Rule.Id)
 | 
			
		||||
	bodyJSON.Set("ruleName", context.Rule.Name)
 | 
			
		||||
	bodyJSON.Set("firing", context.Firing)
 | 
			
		||||
	bodyJSON.Set("state", context.Rule.State)
 | 
			
		||||
	bodyJSON.Set("severity", context.Rule.Severity)
 | 
			
		||||
	bodyJSON.Set("evalMatches", context.EvalMatches)
 | 
			
		||||
 | 
			
		||||
	ruleUrl, err := context.GetRuleUrl()
 | 
			
		||||
	if err == nil {
 | 
			
		||||
		bodyJSON.Set("rule_url", ruleUrl)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	imageUrl, err := context.GetImageUrl()
 | 
			
		||||
	if err == nil {
 | 
			
		||||
		bodyJSON.Set("image_url", imageUrl)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	body, _ := bodyJSON.MarshalJSON()
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user