This repo contains code necessary to create PagerDuty alerts in the event of a job error.
Python 3.7+
- dbtc - Unofficial python interface to dbt Cloud APIs
- FastAPI - Modern, fast, web framework for building APIs with Python 3.7+
- requests - Elegant and simple HTTP library for Python, built for human beings
- uvicorn - ASGI web server implementation for Python
Clone this repo
git clone https://github.com/dpguthrie/dbt-cloud-webhooks-pagerduty.git
fly.io is a platform for running full stack apps and databases close to your users.
Directions to install here
Once installed, sign up for fly.io
flyctl auth signup
Now sign in
flyctl auth login
Launch your app!
flyctl launch
The following secrets need to be configured to your runtime environment for your application to work properly.
DBT_CLOUD_AUTH_TOKEN
- his is the secret key that's shown after initailly creating your webhook subscription in dbt CloudDBT_CLOUD_SERVICE_TOKEN
- Generate a service token in dbt Cloud. Ensure that it has at least theMetadata Only
permission as we will be making requests against the Metadata API.PD_ROUTING_KEY
- Use the integration key for your integration (will be used asrouting_key
). More info here
To set a secret in your fly.io app, do the following:
flyctl secrets set DBT_CLOUD_SERVICE_TOKEN=***
Or set them all at once:
flyctl secrets set DBT_CLOUD_AUTH_TOKEN=*** DBT_CLOUD_SERVICE_TOKEN=*** PD_ROUTING_KEY=***
Check the secrets set in your app
flyctl secrets list
Monitor your app
flyctl monitor
Open browser to currently deployed app
flyctl open