Skip to content

dpguthrie/dbt-cloud-webhooks-pagerduty

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dbt Cloud Webhooks - PagerDuty

Overview

This repo contains code necessary to create PagerDuty alerts in the event of a job error.

Requirements

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

Getting Started

Clone this repo

git clone https://github.com/dpguthrie/dbt-cloud-webhooks-pagerduty.git

Deploy on fly.io (Optional)

fly.io is a platform for running full stack apps and databases close to your users.

Install

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

Secrets

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 Cloud
  • DBT_CLOUD_SERVICE_TOKEN - Generate a service token in dbt Cloud. Ensure that it has at least the Metadata 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 as routing_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=***

Other Helpful Commands

Check the secrets set in your app

flyctl secrets list

Monitor your app

flyctl monitor

Open browser to currently deployed app

flyctl open

Other Deploy Options

About

Send job failure details to pagerduty

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published