DogOnCall is a Go application that retrieves an on-call schedule from Datadog and sends notification to Slack about the current on-call engineer.
Slack will receive following variables from app:
engineer_email
: Email of the current on-call engineer.schedule_name
: Schedule name.schedule_link
: Link to datadog schedule page.
Engineer email in Datadog and Slack should be equal.
In Slack app:
-
More
button on the left screen side =>Automations
=>Workflows
=>New workflow
=>Build workflow
-
For
Start the workflow…
choose eventFrom a webhook
-
Set up variables:
engineer_email
asSlack user email
schedule_name
andschedule_link
asText
.
-
Use
Web request URL
asSLACK_ENDPOINT
later. -
For
Then, do these things
chooseSend a message to...
and compose a message using variables.See this if you want to use
schedule_name
andschedule_link
together as link. -
Publish the workflow
The application requires the following environment variables:
DD_API_KEY
: Your Datadog API key.DD_APP_KEY
: Your Datadog application key.SCHEDULE_NAME
: The name of the Datadog on-call schedule.SLACK_ENDPOINT
: The Slack workflow webhook endpoint to send notifications.
It's reasonable to run this app by a cron. For k8s I use CronJob in the Helm chart.
# put required values in helm/values-private.yaml
helm upgrade --install dogoncall oci://registry-1.docker.io/rgeraskin/helm-dogoncall -f helm/values-private.yaml
or from the cloned git repo:
# put required values in helm/values-private.yaml
helm upgrade --install dogoncall ./helm -f helm/values-private.yaml
# put required envs in .env
docker run --name dogoncall --env-file .env --rm rgeraskin/dogoncall:latest
or from the cloned git repo:
# put required envs in .env
docker buildx build . -t dogoncall
docker run --name dogoncall --env-file .env --rm dogoncall
go install github.com/rgeraskin/dogoncall/dogoncall@latest
# export required env vars
dogoncall
or from the cloned repo:
go build -C dogoncall -o ..
# export required env vars
./dogoncall
-
Install mise:
brew install mise
-
Zsh example:
echo 'eval "$(~/.local/bin/mise activate zsh)"' >> ~/.zshrc # restart shell or `source ~/.zshrc`
-
mise install
in the repo root dir to install all required tools
- Use Tilt for a realtime k8s experience:
tilt up
- Use mise tasks for routines:
mise run build
,mise run deploy
This project is licensed under the MIT License. See the LICENSE file for details.