Skip to content

Commit

Permalink
Fix revenue bridge alert
Browse files Browse the repository at this point in the history
  • Loading branch information
prevostc committed Jun 22, 2024
1 parent 2bd0f41 commit f1840ef
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion analytics/provisioning/alerting/alerts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,21 @@ groups:
intervalMs: 1000
maxDataPoints: 43200
rawQuery: true
rawSql: "with revenue_bridge_harvested_chains as (\n select distinct chain\n from raw_revenue_bridge_harvest_report\n where $__timeFilter(datetime) \n),\nchains_harvested_recently as (\n select c.chain, rh.chain is not null as bridge_harvested_recently\n from chain c\n left join revenue_bridge_harvested_chains rh using (chain)\n where revenue_bridge_harvest_enabled\n)\nSELECT \n date_trunc('hour', now()) as time, \n chain,\n (not bridge_harvested_recently) :: integer as value\nFROM chains_harvested_recently\n;"
rawSql: >
with last_revenue_bridge_harvest_success_by_chain as (
select chain, datetime, cast(report_content->'summary'->'success' as boolean) as success
from last_revenue_bridge_harvest_report_by_chain
),
chains_harvested_recently as (
select c.chain, (not c.revenue_bridge_harvest_enabled) or (lh.chain is not null and lh.success and $__timeFilter(lh.datetime)) as bridge_harvest_recent_success
from chain c
left join last_revenue_bridge_harvest_success_by_chain lh using (chain)
)
SELECT
date_trunc('hour', now()) as time,
chain,
(not bridge_harvest_recent_success) :: integer as value
FROM chains_harvested_recently
refId: revenue_bridge_harvested_recently
sql:
columns:
Expand Down

0 comments on commit f1840ef

Please sign in to comment.