Skip to content

Commit f96eea6

Browse files
Add configurable InfluxDB policy
Closes #1
1 parent 0c06d61 commit f96eea6

File tree

9 files changed

+141
-54
lines changed

9 files changed

+141
-54
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1313
- Update metrics version to 0.3.0 in experimental cluster
1414
- Rework example Tarantool instance on "cartridge.roles.metrics"
1515
- Rework example Tarantool docker to start multiple instances with luatest
16+
- Make InfluxDB policy configurable
1617
- Documentation improvements and fixes
1718

1819
## [0.1.0] - 2020-06-30

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Guide on Tarantool project prerequirements and metrics collectors configuration
1818

1919
* Paste dashboard id (`12567` for InfluxDB) or link to dashboard (https://grafana.com/grafana/dashboards/12567 for InfluxDB) or upload json file (download it from Grafana page: [InfluxDB](https://grafana.com/grafana/dashboards/12567); or build it by yourself).
2020

21-
* Set dashboard name, folder, uid (if needed), and metrics database parameters (i.e., InfluxDB source and measurement).
21+
* Set dashboard name, folder, uid (if needed), and metrics database parameters (i.e., InfluxDB source, measurement and policy).
2222

2323
![Grafana import setup in v6.6.0 for InfluxDB](./docs/grafana_import_setup_v6.png)
2424

docs/grafana_import_setup_v6.png

1.63 KB
Loading

jsonnetfile.lock.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
"subdir": "grafonnet"
99
}
1010
},
11-
"version": "7ab8a79738de007c407b939b35e54e84c213d542",
12-
"sum": "q2B0w9iyqTD99PJacSpHg9XshQN7kiupxaORQcAlb2E="
11+
"version": "cc1626a1b4dee45c99b78ddd9714dfd5f5d7816e",
12+
"sum": "nkgrtMYPCq/YB4r3mKyToepaLhicwWnxDdGIodPpzz0="
1313
}
1414
],
1515
"legacyImports": false

tarantool/dashboard.libsonnet

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ local dashboard = grafana.dashboard.new(
1616
);
1717

1818
local datasource = '${DS_INFLUXDB}';
19-
local measurement = '${TARANTOOL_MEASUREMENT}';
19+
local policy = '${INFLUXDB_POLICY}';
20+
local measurement = '${INFLUXDB_MEASUREMENT}';
2021

2122
dashboard
2223
.addInput(
@@ -28,13 +29,18 @@ dashboard
2829
description='InfluxDB Tarantool metrics bank'
2930
)
3031
.addInput(
31-
name='TARANTOOL_MEASUREMENT',
32-
label='Measurement',
32+
name='INFLUXDB_MEASUREMENT',
33+
label='InfluxDB measurement',
3334
type='constant',
34-
pluginId=null,
35-
pluginName=null,
3635
description='InfluxDB Tarantool metrics measurement'
3736
)
37+
.addInput(
38+
name='INFLUXDB_POLICY',
39+
label='InfluxDB policy',
40+
type='constant',
41+
value='default',
42+
description='InfluxDB Tarantool metrics policy'
43+
)
3844
.addRequired(
3945
type='grafana',
4046
id='grafana',
@@ -66,41 +72,47 @@ dashboard
6672
.addPanel(
6773
http.rps_success(
6874
datasource=datasource,
75+
policy=policy,
6976
measurement=measurement,
7077
),
7178
{ w: 8, h: 8, x: 0, y: 1 }
7279
)
7380
.addPanel(
7481
http.rps_error_4xx(
7582
datasource=datasource,
83+
policy=policy,
7684
measurement=measurement,
7785
),
7886
{ w: 8, h: 8, x: 8, y: 1 },
7987
)
8088
.addPanel(
8189
http.rps_error_5xx(
8290
datasource=datasource,
91+
policy=policy,
8392
measurement=measurement,
8493
),
8594
{ w: 8, h: 8, x: 16, y: 1 },
8695
)
8796
.addPanel(
8897
http.latency_success(
8998
datasource=datasource,
99+
policy=policy,
90100
measurement=measurement,
91101
),
92102
{ w: 8, h: 8, x: 0, y: 9 }
93103
)
94104
.addPanel(
95105
http.latency_error_4xx(
96106
datasource=datasource,
107+
policy=policy,
97108
measurement=measurement,
98109
),
99110
{ w: 8, h: 8, x: 8, y: 9 },
100111
)
101112
.addPanel(
102113
http.latency_error_5xx(
103114
datasource=datasource,
115+
policy=policy,
104116
measurement=measurement,
105117
),
106118
{ w: 8, h: 8, x: 16, y: 9 },
@@ -116,62 +128,71 @@ dashboard
116128
.addPanel(
117129
slab.quota_used_ratio(
118130
datasource=datasource,
131+
policy=policy,
119132
measurement=measurement,
120133
),
121134
{ w: 8, h: 8, x: 0, y: 21 }
122135
)
123136
.addPanel(
124137
slab.arena_used_ratio(
125138
datasource=datasource,
139+
policy=policy,
126140
measurement=measurement,
127141
),
128142
{ w: 8, h: 8, x: 8, y: 21 },
129143
)
130144
.addPanel(
131145
slab.items_used_ratio(
132146
datasource=datasource,
147+
policy=policy,
133148
measurement=measurement,
134149
),
135150
{ w: 8, h: 8, x: 16, y: 21 },
136151
)
137152
.addPanel(
138153
slab.quota_used(
139154
datasource=datasource,
155+
policy=policy,
140156
measurement=measurement,
141157
),
142158
{ w: 8, h: 8, x: 0, y: 29 }
143159
)
144160
.addPanel(
145161
slab.arena_used(
146162
datasource=datasource,
163+
policy=policy,
147164
measurement=measurement,
148165
),
149166
{ w: 8, h: 8, x: 8, y: 29 },
150167
)
151168
.addPanel(
152169
slab.items_used(
153170
datasource=datasource,
171+
policy=policy,
154172
measurement=measurement,
155173
),
156174
{ w: 8, h: 8, x: 16, y: 29 },
157175
)
158176
.addPanel(
159177
slab.quota_size(
160178
datasource=datasource,
179+
policy=policy,
161180
measurement=measurement,
162181
),
163182
{ w: 8, h: 8, x: 0, y: 37 }
164183
)
165184
.addPanel(
166185
slab.arena_size(
167186
datasource=datasource,
187+
policy=policy,
168188
measurement=measurement,
169189
),
170190
{ w: 8, h: 8, x: 8, y: 37 },
171191
)
172192
.addPanel(
173193
slab.items_size(
174194
datasource=datasource,
195+
policy=policy,
175196
measurement=measurement,
176197
),
177198
{ w: 8, h: 8, x: 16, y: 37 },
@@ -183,41 +204,47 @@ dashboard
183204
.addPanel(
184205
space.select_rps(
185206
datasource=datasource,
207+
policy=policy,
186208
measurement=measurement,
187209
),
188210
{ w: 8, h: 8, x: 0, y: 46 },
189211
)
190212
.addPanel(
191213
space.insert_rps(
192214
datasource=datasource,
215+
policy=policy,
193216
measurement=measurement,
194217
),
195218
{ w: 8, h: 8, x: 8, y: 46 },
196219
)
197220
.addPanel(
198221
space.replace_rps(
199222
datasource=datasource,
223+
policy=policy,
200224
measurement=measurement,
201225
),
202226
{ w: 8, h: 8, x: 16, y: 46 },
203227
)
204228
.addPanel(
205229
space.upsert_rps(
206230
datasource=datasource,
231+
policy=policy,
207232
measurement=measurement,
208233
),
209234
{ w: 8, h: 8, x: 0, y: 46 },
210235
)
211236
.addPanel(
212237
space.update_rps(
213238
datasource=datasource,
239+
policy=policy,
214240
measurement=measurement,
215241
),
216242
{ w: 8, h: 8, x: 8, y: 46 },
217243
)
218244
.addPanel(
219245
space.delete_rps(
220246
datasource=datasource,
247+
policy=policy,
221248
measurement=measurement,
222249
),
223250
{ w: 8, h: 8, x: 16, y: 46 },

tarantool/http.libsonnet

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ local influxdb = grafana.influxdb;
88
title,
99
description,
1010
datasource,
11+
policy,
1112
measurement,
1213
metric_name,
1314
status_regex,
@@ -31,6 +32,7 @@ local influxdb = grafana.influxdb;
3132
legend_sortDesc=true,
3233
).addTarget(
3334
influxdb.target(
35+
policy=policy,
3436
measurement=measurement,
3537
group_tags=['label_pairs_alias', 'label_pairs_path', 'label_pairs_method', 'label_pairs_status'],
3638
alias='$tag_label_pairs_alias — $tag_label_pairs_method $tag_label_pairs_path (code $tag_label_pairs_status)',
@@ -46,12 +48,14 @@ local influxdb = grafana.influxdb;
4648
|||,
4749

4850
datasource=null,
51+
policy=null,
4952
measurement=null,
5053
metric_name='http_server_request_latency_count',
5154
):: rps_graph(
5255
title=title,
5356
description=description,
5457
datasource=datasource,
58+
policy=policy,
5559
measurement=measurement,
5660
metric_name=metric_name,
5761
status_regex='/^2\\d{2}$/',
@@ -65,12 +69,14 @@ local influxdb = grafana.influxdb;
6569
|||,
6670

6771
datasource=null,
72+
policy=null,
6873
measurement=null,
6974
metric_name='http_server_request_latency_count',
7075
):: rps_graph(
7176
title=title,
7277
description=description,
7378
datasource=datasource,
79+
policy=policy,
7480
measurement=measurement,
7581
metric_name=metric_name,
7682
status_regex='/^4\\d{2}$/',
@@ -84,12 +90,14 @@ local influxdb = grafana.influxdb;
8490
|||,
8591

8692
datasource=null,
93+
policy=null,
8794
measurement=null,
8895
metric_name='http_server_request_latency_count',
8996
):: rps_graph(
9097
title=title,
9198
description=description,
9299
datasource=datasource,
100+
policy=policy,
93101
measurement=measurement,
94102
metric_name=metric_name,
95103
status_regex='/^5\\d{2}$/',
@@ -99,6 +107,7 @@ local influxdb = grafana.influxdb;
99107
title,
100108
description,
101109
datasource,
110+
policy,
102111
measurement,
103112
metric_name,
104113
status_regex,
@@ -122,6 +131,7 @@ local influxdb = grafana.influxdb;
122131
legend_sortDesc=true,
123132
).addTarget(
124133
influxdb.target(
134+
policy=policy,
125135
measurement=measurement,
126136
group_tags=['label_pairs_alias', 'label_pairs_path', 'label_pairs_method', 'label_pairs_status'],
127137
alias='$tag_label_pairs_alias — $tag_label_pairs_method $tag_label_pairs_path (code $tag_label_pairs_status)',
@@ -136,12 +146,14 @@ local influxdb = grafana.influxdb;
136146
|||,
137147

138148
datasource=null,
149+
policy=null,
139150
measurement=null,
140151
metric_name='http_server_request_latency_avg',
141152
):: latency_graph(
142153
title=title,
143154
description=description,
144155
datasource=datasource,
156+
policy=policy,
145157
measurement=measurement,
146158
metric_name=metric_name,
147159
status_regex='/^2\\d{2}$/',
@@ -154,12 +166,14 @@ local influxdb = grafana.influxdb;
154166
|||,
155167

156168
datasource=null,
169+
policy=null,
157170
measurement=null,
158171
metric_name='http_server_request_latency_avg',
159172
):: latency_graph(
160173
title=title,
161174
description=description,
162175
datasource=datasource,
176+
policy=policy,
163177
measurement=measurement,
164178
metric_name=metric_name,
165179
status_regex='/^4\\d{2}$/',
@@ -172,12 +186,14 @@ local influxdb = grafana.influxdb;
172186
|||,
173187

174188
datasource=null,
189+
policy=null,
175190
measurement=null,
176191
metric_name='http_server_request_latency_avg',
177192
):: latency_graph(
178193
title=title,
179194
description=description,
180195
datasource=datasource,
196+
policy=policy,
181197
measurement=measurement,
182198
metric_name=metric_name,
183199
status_regex='/^5\\d{2}$/',

0 commit comments

Comments
 (0)