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.gitfly.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 signupNow sign in
flyctl auth loginLaunch your app!
flyctl launchThe 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 Onlypermission 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 listMonitor your app
flyctl monitorOpen browser to currently deployed app
flyctl open