-
Notifications
You must be signed in to change notification settings - Fork 157
/
Copy pathairquality.yml
226 lines (222 loc) · 6.76 KB
/
airquality.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
apiVersion: influxdata.com/v2alpha1
kind: Label
metadata:
name: flamboyant-leakey-f37001
spec:
color: '#67d74e'
name: airquality
---
apiVersion: influxdata.com/v2alpha1
kind: Variable
metadata:
name: ridiculous-keller-caf001
spec:
associations:
- kind: Label
name: flamboyant-leakey-f37001
language: flux
name: bucket
query: |-
buckets()
|> filter(fn: (r) => r.name !~ /^_/)
|> rename(columns: {name: "_value"})
|> keep(columns: ["_value"])
type: query
---
apiVersion: influxdata.com/v2alpha1
kind: Bucket
metadata:
name: musing-grothendieck-f37005
spec:
associations:
- kind: Label
name: flamboyant-leakey-f37001
name: airquality
retentionRules:
- everySeconds: 2.592e+06
type: expire
---
apiVersion: influxdata.com/v2alpha1
kind: Dashboard
metadata:
name: serene-yonath-337001
spec:
associations:
- kind: Label
name: flamboyant-leakey-f37001
charts:
- colors:
- hex: '#7CE490'
id: "0"
name: honeydew
type: min
- hex: '#FFD255'
id: 32aeb4df-7946-405e-bd74-ec9336d1b26a
name: thunder
type: threshold
value: 51
- hex: '#F48D38'
id: 91f149f0-3060-4ac1-91c1-66c38139b9aa
name: tiger
type: threshold
value: 101
- hex: '#F95F53'
id: 63cc456e-8de9-4954-b9a1-3d35ae1e72a3
name: curacao
type: threshold
value: 151
- hex: '#513CC6'
id: 6ff114b1-61d3-480e-b9d5-0319c847df6e
name: planet
type: threshold
value: 201
- hex: '#BF3D5E'
id: ed566b2f-9cf5-4d32-a94b-bcfc4defd011
name: ruby
type: threshold
value: 301
- hex: '#BF3D5E'
id: "1"
name: ruby
type: max
value: 500
decimalPlaces: 2
height: 4
kind: Gauge
name: Current PM2.5 Gauge
queries:
- query: |-
from(bucket: v.bucket)
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r["ParameterName"] == "PM2.5")
|> filter(fn: (r) => r["_field"] == "AQI")
|> aggregateWindow(every: v.windowPeriod, fn: last, createEmpty: false)
|> yield(name: "last")
width: 4
- axes:
- base: "10"
name: x
scale: linear
- base: "10"
name: y
scale: linear
colors:
- hex: '#31C0F6'
id: 9a009419-c2b6-47ce-bc5e-bec960ccc1c9
name: Nineteen Eighty Four
type: scale
- hex: '#A500A5'
id: 4696c34e-fc79-4ba1-a6a1-2c93b864f47e
name: Nineteen Eighty Four
type: scale
- hex: '#FF7E27'
id: 9664276e-2f02-4749-af44-113ca213def0
name: Nineteen Eighty Four
type: scale
geom: line
height: 4
hoverDimension: auto
kind: Xy
legendOpacity: 1
legendOrientationThreshold: 10
name: Air Quality Trends
position: overlaid
queries:
- query: |-
from(bucket: v.bucket)
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r["ParameterName"] == "O3" or r["ParameterName"] == "PM2.5")
|> filter(fn: (r) => r["_field"] == "AQI")
|> aggregateWindow(every: v.windowPeriod, fn: last, createEmpty: false)
|> yield(name: "last")
width: 8
xCol: _time
yCol: _value
yPos: 4
- colors:
- hex: '#4ED8A0'
id: "0"
name: rainforest
type: min
- hex: '#FFD255'
id: 901cb28f-0c21-4dd8-a946-860cc23bb589
name: thunder
type: threshold
value: 51
- hex: '#F48D38'
id: 056816bd-08d4-4882-b667-772f050c8b63
name: tiger
type: threshold
value: 101
- hex: '#F95F53'
id: 91f149f0-3060-4ac1-91c1-66c38139b9aa
name: curacao
type: threshold
value: 151
- hex: '#513CC6'
id: 63cc456e-8de9-4954-b9a1-3d35ae1e72a3
name: planet
type: threshold
value: 201
- hex: '#BF3D5E'
id: 6ff114b1-61d3-480e-b9d5-0319c847df6e
name: ruby
type: threshold
value: 301
- hex: '#BF3D5E'
id: "1"
name: ruby
type: max
value: 500
decimalPlaces: 2
height: 4
kind: Gauge
name: Current Ozone Quality
queries:
- query: |-
from(bucket: v.bucket)
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r["ParameterName"] == "O3")
|> filter(fn: (r) => r["_field"] == "AQI")
|> aggregateWindow(every: v.windowPeriod, fn: last, createEmpty: false)
|> yield(name: "last")
width: 5
xPos: 4
name: Air Quality
---
apiVersion: influxdata.com/v2alpha1
kind: Telegraf
metadata:
name: airquality-telegraf
spec:
associations:
- kind: Label
name: flamboyant-leakey-f37001
name: airquality-telegraf-config
config: |
[[outputs.influxdb_v2]]
## The URLs of the InfluxDB cluster nodes.
urls = ["$INFLUX_HOST"]
## Token for authentication.
token = "$INFLUX_TOKEN"
## Organization is the name of the organization you wish to write to; must exist.
organization = "$INFLUX_ORG"
## Destination bucket to write into. Default should be set to 'airquality'
bucket = "airquality"
# interval at which the API is called. air quality is only updated 1-2 times per day
[agent]
interval = "12h"
# Read formatted metrics from one or more HTTP endpoints
[[inputs.http]]
## One or more URLs from which to read formatted metrics
urls = ["$INFLUX_AIRQUAL_URL"]
## HTTP method
method = "GET"
## List of success status codes
success_status_codes = [200]
## Data format to consume.
data_format = "json"
json_time_key = ["DateForecast"]
json_time_format = "2006 01 02 "
tag_keys = ["Category_Name", "ParameterName", "Latitude", "Longitude", "ReportingArea"]
json_string_fields = ["ActionDay"]