mirror of
https://github.com/grafana/grafana.git
synced 2024-11-25 18:30:41 -06:00
Alerting: Remove unused fields in Pagerduty struct (#37198)
Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
This commit is contained in:
parent
01e984c394
commit
e8ac802e4f
@ -145,7 +145,7 @@ func (pn *PagerdutyNotifier) buildPagerdutyMessage(ctx context.Context, alerts m
|
||||
Text: "External URL",
|
||||
}},
|
||||
Description: tmpl(`{{ template "default.title" . }}`), // TODO: this can be configurable template.
|
||||
Payload: &pagerDutyPayload{
|
||||
Payload: pagerDutyPayload{
|
||||
Component: tmpl(pn.Component),
|
||||
Summary: tmpl(pn.Summary),
|
||||
Severity: tmpl(pn.Severity),
|
||||
@ -177,18 +177,15 @@ func (pn *PagerdutyNotifier) SendResolved() bool {
|
||||
}
|
||||
|
||||
type pagerDutyMessage struct {
|
||||
RoutingKey string `json:"routing_key,omitempty"`
|
||||
ServiceKey string `json:"service_key,omitempty"`
|
||||
DedupKey string `json:"dedup_key,omitempty"`
|
||||
IncidentKey string `json:"incident_key,omitempty"`
|
||||
EventType string `json:"event_type,omitempty"`
|
||||
Description string `json:"description,omitempty"`
|
||||
EventAction string `json:"event_action"`
|
||||
Payload *pagerDutyPayload `json:"payload"`
|
||||
Client string `json:"client,omitempty"`
|
||||
ClientURL string `json:"client_url,omitempty"`
|
||||
Details map[string]string `json:"details,omitempty"`
|
||||
Links []pagerDutyLink `json:"links,omitempty"`
|
||||
RoutingKey string `json:"routing_key,omitempty"`
|
||||
ServiceKey string `json:"service_key,omitempty"`
|
||||
DedupKey string `json:"dedup_key,omitempty"`
|
||||
Description string `json:"description,omitempty"`
|
||||
EventAction string `json:"event_action"`
|
||||
Payload pagerDutyPayload `json:"payload"`
|
||||
Client string `json:"client,omitempty"`
|
||||
ClientURL string `json:"client_url,omitempty"`
|
||||
Links []pagerDutyLink `json:"links,omitempty"`
|
||||
}
|
||||
|
||||
type pagerDutyLink struct {
|
||||
@ -200,7 +197,6 @@ type pagerDutyPayload struct {
|
||||
Summary string `json:"summary"`
|
||||
Source string `json:"source"`
|
||||
Severity string `json:"severity"`
|
||||
Timestamp string `json:"timestamp,omitempty"`
|
||||
Class string `json:"class,omitempty"`
|
||||
Component string `json:"component,omitempty"`
|
||||
Group string `json:"group,omitempty"`
|
||||
|
@ -51,7 +51,7 @@ func TestPagerdutyNotifier(t *testing.T) {
|
||||
DedupKey: "6e3538104c14b583da237e9693b76debbc17f0f8058ef20492e5853096cf8733",
|
||||
Description: "[FIRING:1] (val1)",
|
||||
EventAction: "trigger",
|
||||
Payload: &pagerDutyPayload{
|
||||
Payload: pagerDutyPayload{
|
||||
Summary: "[FIRING:1] (val1)",
|
||||
Source: hostname,
|
||||
Severity: "critical",
|
||||
@ -97,7 +97,7 @@ func TestPagerdutyNotifier(t *testing.T) {
|
||||
DedupKey: "6e3538104c14b583da237e9693b76debbc17f0f8058ef20492e5853096cf8733",
|
||||
Description: "[FIRING:2] ",
|
||||
EventAction: "trigger",
|
||||
Payload: &pagerDutyPayload{
|
||||
Payload: pagerDutyPayload{
|
||||
Summary: "[FIRING:2] ",
|
||||
Source: hostname,
|
||||
Severity: "warning",
|
||||
|
Loading…
Reference in New Issue
Block a user