Skip to content

Commit

Permalink
Pipeline alternative SLIs followup (#861)
Browse files Browse the repository at this point in the history
* Pipeline alternative SLIs followup

* Use DATE function

* Pipeline SLIs followup

* Syntax fixes

* Fix wording

* Remove yesterday metric

* Fix label name

* Use gardener_jobs_total for config alert

* Add gardener_config_datatypes back

* Add offset back

* Query same as before

* Change date

* Dashboard

* fix switch query

* Change switch query back

* Review comments

* Dashboard

* Dashboard legend

* Add dashboard link
  • Loading branch information
cristinaleonr authored Jan 13, 2022
1 parent cdd2a2a commit ef5df77
Show file tree
Hide file tree
Showing 4 changed files with 812 additions and 8 deletions.
26 changes: 22 additions & 4 deletions config/federation/bigquery/bq_gardener_historical.sql.template
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,32 @@ WITH all_types AS (
`{{PROJECT}}.raw_ndt.scamper1`
WHERE
date > date('2019-03-28')
),

processed_types AS (
SELECT
datatype,
COUNT(distinct date) AS value_throughput
FROM
all_types
WHERE
(parseTime BETWEEN TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 24 HOUR) AND CURRENT_TIMESTAMP())
AND date < DATE_SUB(DATE(parseTime), INTERVAL 1 DAY) -- exclude daily.
GROUP BY
datatype
)

SELECT
datatype, COUNT(distinct date) AS value_throughput
datatype, value_throughput
FROM processed_types
UNION ALL
-- export 0 throughput for data types that were not processed
SELECT
all_types.datatype, 0 AS value_throughput
FROM
all_types
all_types LEFT JOIN processed_types
ON (all_types.datatype = processed_types.datatype)
WHERE
(parseTime BETWEEN TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 24 HOUR) AND CURRENT_TIMESTAMP())
AND date < DATE_SUB(CURRENT_DATE(), INTERVAL 1 DAY) -- exclude daily.
processed_types.datatype IS NULL
GROUP BY
datatype
Loading

0 comments on commit ef5df77

Please sign in to comment.