mozilla-services / pagerstatus

A service to automatically update Statuspage.io based on Pagerduty incidents
Apache License 2.0
7 stars 5 forks source link

Support interpolating component name in statuspage incident #2

Closed sciurus closed 6 years ago

sciurus commented 6 years ago

Currently all incidents have the same name and body, which makes it hard to understand at a glance what they affect. It would be better if we could interpolate the component's name into them.

This requires agreeing on a special string in the templates that would be replaced by the component name. I'm thinking {component}.

https://github.com/mozilla-services/pagerstatus/blob/master/chalicelib/incident_templates/default.yml

This also requires another statuspage api call in order to lookup the component name, since we only have the id. Statuspage has an endpoint for listing all components, so we could hit that once, save the results, and reuse them each time we open an incident.

https://doers.statuspage.io/api/v1/components/ https://github.com/mozilla-services/pagerstatus/blob/master/chalicelib/statuspage.py#L82-L100

sciurus commented 6 years ago

I'm going with {{component}} instead of {component} to avoid any confusion that this is an f-string.