Send PagerDuty events to Tinybird

PagerDuty is a platform for incident management and alerting. By integrating PagerDuty with Tinybird, you can analyze your incident data in real time and enrich it with other data sources.

Some common use cases for sending PagerDuty events to Tinybird include:

  1. Monitoring and alerting on incidents.
  2. Creating custom dashboards for incident analysis.
  3. Incident logs.

Read on to learn how to send events from PagerDuty to Tinybird.

Before you start

Before you connect PagerDuty to Tinybird, ensure:

  • You have an PagerDuty account.
  • You have a Tinybird Workspace.

Connect PagerDuty to Tinybird

  1. From the PagerDuty dashboard, select Integrations > Developer Tools > Webhooks.

  2. Select New Webhook.

  3. In Tinybird, create a Data Source, called pagerduty, with the following schema:

SCHEMA >
    `event_id` String `json:$.event.id`,
    `event_type` String `json:$.event.event_type`,
    `resource_type` String `json:$.event.resource_type`,
    `occurred_at` DateTime64(3) `json:$.event.occurred_at`,
    `agent` JSON `json:$.event.agent` DEFAULT '{}',
    `client` JSON `json:$.event.client` DEFAULT '{}',
    `data` JSON `json:$.event.data` DEFAULT '{}'
    
ENGINE "MergeTree"
ENGINE_PARTITION_KEY "toYYYYMM(occurred_at)"
ENGINE_SORTING_KEY "resource_type, event_type, occurred_at"

Using the JSON Data Type you can store the semi-structured data you receive from PagerDuty in a single column. You can later retrieve various events and their metadata as needed in your Pipes.

  1. In Tinybird, copy a token with privileges to append to the Data Source you created. You can use the admin token or create one with the required scope.

  2. Back in PagerDuty, paste the Events API URL in your Webhook URL. Use the query parameter name to match the name of the Data Source you created in Tinybird. For example:

https://api.tinybird.co/v0/events?name=pagerduty

Replace the Tinybird API hostname or region with the API region that matches your Workspace.

  1. Select Add custom header and add 'Authorization' as Name and paste the token you created in Tinybird as Value.
Bearer <your user token>
  1. Select all event subcriptions and Add webhook

  2. You're done. Any of the PagerDuty events is automatically sent to Tinybird through the Events API.

You can check the status of the integration by testing the Webhook integration in PagerDuty or from the Log tab in the Tinybird pagerduty Data Source.

See also

Updated