On-call needs more responsibility. Also, On-call is a little bit tedious, anyway, now we talk about the on-call timetables on slack. this case is essential for developers. In this case, there are many ways possible for an on-call schedule on Slack, but someways need more configuration or someways need more protection, et cetera.
I shared my source code of the on-call informer on slack. Also, I experienced golang.
How to work?
When you create this slash command, you can see your slack’ slash command list /oncall
.
and \oncall
command return current on-call shift information like this,
Installation
First, you need a PagerDuty API token. You can find this argument in main.go
variables block.
var (
apiKey = kmsDecrypt(os.Getenv("apikey"))
...
)
and also apikey
must be encrypted via KMS service, it is an optional but recommended way. Sensitive values should be encrypted.
Environment:
Variables:
apikey: KMSENCRYPTEDAPIKEY
pd_schedule_id: PZXYWD #you can find this on your pagerduty schedule page
On the slack side, first, create a slash command.
Then, create a slash command like this,
When you create an on-call application via AWS SAM, you have an API endpoint, and you can put this endpoint on your slash command request path.
Also, you can find your pagerduty API key on your Pagerduty account’s Developer Tools.