Skip to content

Commit

Permalink
pagerduty.py: Change default summary text (#4239)
Browse files Browse the repository at this point in the history
* pagerduty.py: Change default summary text

Change is made to use alert name in PagerDuty's alert
destination default summary text instead of
query id and name

* Update default description text & field description
  • Loading branch information
frextrite authored and arikfr committed Oct 15, 2019
1 parent 53d971b commit 29b1130
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions redash/destinations/pagerduty.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
class PagerDuty(BaseDestination):

KEY_STRING = '{alert_id}_{query_id}'
DESCRIPTION_STR = u'Alert - Redash Query #{query_id}: {query_name}'
DESCRIPTION_STR = u'Alert: {alert_name}'

@classmethod
def enabled(cls):
Expand All @@ -29,7 +29,7 @@ def configuration_schema(cls):
},
'description': {
'type': 'string',
'title': 'Description for the event, defaults to query',
'title': 'Description for the event, defaults to alert name',
}
},
"required": ["integration_key"]
Expand All @@ -46,7 +46,7 @@ def notify(self, alert, query, user, new_state, app, host, options):
elif options.get('description'):
default_desc = options.get('description')
else:
default_desc = self.DESCRIPTION_STR.format(query_id=query.id, query_name=query.name)
default_desc = self.DESCRIPTION_STR.format(alert_name=alert.name)

incident_key = self.KEY_STRING.format(alert_id=alert.id, query_id=query.id)
data = {
Expand Down

0 comments on commit 29b1130

Please sign in to comment.