Skip to content

Commit

Permalink
Ensure we don't correlate incidents with staging deploys
Browse files Browse the repository at this point in the history
  • Loading branch information
hackebrot committed May 29, 2024
1 parent e275e49 commit 88f4eaa
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions queries/incidents.sql
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ WITH
),
issue AS (
SELECT
*
*,
NULL as deployment_environment -- Remove this once we collect deployment_environment
FROM
github_pagerduty
UNION ALL
Expand All @@ -50,6 +51,7 @@ WITH
time_resolved,
root_cause,
TRUE as bug,
deployment_environment, -- This is expected to always be `production`
FROM
`four_keys.incidents_google_form`
)
Expand Down Expand Up @@ -80,11 +82,16 @@ LEFT JOIN (
service,
environment
FROM
four_keys.deployments d,
`four_keys.deployments` AS d,
d.changes
) AS root
ON
( service_catalog.service = root.service AND root_cause = root.changes )
service_catalog.service = root.service
AND root_cause = root.changes
-- GitHub and PagerDuty incidents don't contain information about the environment.
-- Google Form incidents are always reported for the `production` environment.
-- The following ensures we don't correlate incidents with `staging` deployments.
AND issue.deployment_environment = root.environment
GROUP BY
1,
2,
Expand Down

0 comments on commit 88f4eaa

Please sign in to comment.