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",
|
Text: "External URL",
|
||||||
}},
|
}},
|
||||||
Description: tmpl(`{{ template "default.title" . }}`), // TODO: this can be configurable template.
|
Description: tmpl(`{{ template "default.title" . }}`), // TODO: this can be configurable template.
|
||||||
Payload: &pagerDutyPayload{
|
Payload: pagerDutyPayload{
|
||||||
Component: tmpl(pn.Component),
|
Component: tmpl(pn.Component),
|
||||||
Summary: tmpl(pn.Summary),
|
Summary: tmpl(pn.Summary),
|
||||||
Severity: tmpl(pn.Severity),
|
Severity: tmpl(pn.Severity),
|
||||||
@ -177,18 +177,15 @@ func (pn *PagerdutyNotifier) SendResolved() bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type pagerDutyMessage struct {
|
type pagerDutyMessage struct {
|
||||||
RoutingKey string `json:"routing_key,omitempty"`
|
RoutingKey string `json:"routing_key,omitempty"`
|
||||||
ServiceKey string `json:"service_key,omitempty"`
|
ServiceKey string `json:"service_key,omitempty"`
|
||||||
DedupKey string `json:"dedup_key,omitempty"`
|
DedupKey string `json:"dedup_key,omitempty"`
|
||||||
IncidentKey string `json:"incident_key,omitempty"`
|
Description string `json:"description,omitempty"`
|
||||||
EventType string `json:"event_type,omitempty"`
|
EventAction string `json:"event_action"`
|
||||||
Description string `json:"description,omitempty"`
|
Payload pagerDutyPayload `json:"payload"`
|
||||||
EventAction string `json:"event_action"`
|
Client string `json:"client,omitempty"`
|
||||||
Payload *pagerDutyPayload `json:"payload"`
|
ClientURL string `json:"client_url,omitempty"`
|
||||||
Client string `json:"client,omitempty"`
|
Links []pagerDutyLink `json:"links,omitempty"`
|
||||||
ClientURL string `json:"client_url,omitempty"`
|
|
||||||
Details map[string]string `json:"details,omitempty"`
|
|
||||||
Links []pagerDutyLink `json:"links,omitempty"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type pagerDutyLink struct {
|
type pagerDutyLink struct {
|
||||||
@ -200,7 +197,6 @@ type pagerDutyPayload struct {
|
|||||||
Summary string `json:"summary"`
|
Summary string `json:"summary"`
|
||||||
Source string `json:"source"`
|
Source string `json:"source"`
|
||||||
Severity string `json:"severity"`
|
Severity string `json:"severity"`
|
||||||
Timestamp string `json:"timestamp,omitempty"`
|
|
||||||
Class string `json:"class,omitempty"`
|
Class string `json:"class,omitempty"`
|
||||||
Component string `json:"component,omitempty"`
|
Component string `json:"component,omitempty"`
|
||||||
Group string `json:"group,omitempty"`
|
Group string `json:"group,omitempty"`
|
||||||
|
@ -51,7 +51,7 @@ func TestPagerdutyNotifier(t *testing.T) {
|
|||||||
DedupKey: "6e3538104c14b583da237e9693b76debbc17f0f8058ef20492e5853096cf8733",
|
DedupKey: "6e3538104c14b583da237e9693b76debbc17f0f8058ef20492e5853096cf8733",
|
||||||
Description: "[FIRING:1] (val1)",
|
Description: "[FIRING:1] (val1)",
|
||||||
EventAction: "trigger",
|
EventAction: "trigger",
|
||||||
Payload: &pagerDutyPayload{
|
Payload: pagerDutyPayload{
|
||||||
Summary: "[FIRING:1] (val1)",
|
Summary: "[FIRING:1] (val1)",
|
||||||
Source: hostname,
|
Source: hostname,
|
||||||
Severity: "critical",
|
Severity: "critical",
|
||||||
@ -97,7 +97,7 @@ func TestPagerdutyNotifier(t *testing.T) {
|
|||||||
DedupKey: "6e3538104c14b583da237e9693b76debbc17f0f8058ef20492e5853096cf8733",
|
DedupKey: "6e3538104c14b583da237e9693b76debbc17f0f8058ef20492e5853096cf8733",
|
||||||
Description: "[FIRING:2] ",
|
Description: "[FIRING:2] ",
|
||||||
EventAction: "trigger",
|
EventAction: "trigger",
|
||||||
Payload: &pagerDutyPayload{
|
Payload: pagerDutyPayload{
|
||||||
Summary: "[FIRING:2] ",
|
Summary: "[FIRING:2] ",
|
||||||
Source: hostname,
|
Source: hostname,
|
||||||
Severity: "warning",
|
Severity: "warning",
|
||||||
|
Loading…
Reference in New Issue
Block a user