You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This Lambda will execute DataFusion queries defined in a YAML file and submit
5
+
the results to CloudWatch Metrics which can be alerted upon or forwarded into
6
+
other tools
7
+
8
+
9
+
10
+
## Types
11
+
12
+
### Count
13
+
14
+
This is the simplest type of query and will simply record the number of rows from the query, e.g.:
15
+
16
+
```sql
17
+
SELECT id FROM source WHERE id >1000AND id <=2000
18
+
```
19
+
20
+
Would consistently produce a counted metric value of `1000`.
21
+
22
+
23
+
### Numeric
24
+
25
+
Numeric is likely the most common and easy to understand query. There should only be one row in the result set and all of its values should be numeric values, e.g.:
26
+
27
+
```sql
28
+
SELECTCOUNT(*) AS total, SUM(CASE WHEN (id >1000AND id <=2000) THEN 1 ELSE 0 END) AS valid_ids FROM source
29
+
```
30
+
31
+
This will produce a result set of:
32
+
33
+
```
34
+
+-------+-----------+
35
+
| total | valid_ids |
36
+
+-------+-----------+
37
+
| 4096 | 1000 |
38
+
+-------+-----------+
39
+
```
40
+
41
+
Which wiull produce metric values of:
42
+
43
+
*`total` 4096
44
+
*`valid_ids` 1000
45
+
46
+
47
+
### Dimensional Count
48
+
49
+
The dimensional count is the most advanced query type and can be used to
50
+
provide dimensional (or tagged) metrics in CloudWatch
0 commit comments