fix: remove instance-specific information from chart titles (#12644)
Co-authored-by: Vasilis Kalintiris <vasilis@netdata.cloud>
Ilya Mashchenko committed
Apr 11, 2022 at 20:30 UTC
27e2d4537ea973d5d03ec2453b16ec799c490801
10 files changed
+44
-51
collectors/charts.d.plugin/sensors/sensors.chart.sh
+14
-14
@@ -143,8 +143,8 @@ sensors_create() {
143
files="$(sensors_check_files "$files")"
144
files="$(sensors_check_temp_type "$files")"
145
[ -z "$files" ] && continue
146
- echo "CHART sensors.temp_$id '' '$name Temperature' 'Celsius' 'temperature' 'sensors.temp' line $((sensors_priority + 1)) $sensors_update_every '' '' 'sensors'"
147
- echo >>"$TMP_DIR/sensors.sh" "echo \"BEGIN sensors.temp_$id \$1\""
146
+ echo "CHART 'sensors.temp_${id}_${name}' '' 'Temperature' 'Celsius' 'temperature' 'sensors.temp' line $((sensors_priority + 1)) $sensors_update_every '' '' 'sensors'"
147
+ echo >>"$TMP_DIR/sensors.sh" "echo \"BEGIN 'sensors.temp_${id}_${name}' \$1\""
148
divisor=1000
149
;;
150
@@ -152,8 +152,8 @@ sensors_create() {
152
files="$(ls "$path"/in*_input 2>/dev/null)"
153
files="$(sensors_check_files "$files")"
154
[ -z "$files" ] && continue
155
- echo "CHART sensors.volt_$id '' '$name Voltage' 'Volts' 'voltage' 'sensors.volt' line $((sensors_priority + 2)) $sensors_update_every '' '' 'sensors'"
156
- echo >>"$TMP_DIR/sensors.sh" "echo \"BEGIN sensors.volt_$id \$1\""
155
+ echo "CHART 'sensors.volt_${id}_${name}' '' 'Voltage' 'Volts' 'voltage' 'sensors.volt' line $((sensors_priority + 2)) $sensors_update_every '' '' 'sensors'"
156
+ echo >>"$TMP_DIR/sensors.sh" "echo \"BEGIN 'sensors.volt_${id}_${name}' \$1\""
157
divisor=1000
158
;;
159
@@ -161,8 +161,8 @@ sensors_create() {
161
files="$(ls "$path"/curr*_input 2>/dev/null)"
162
files="$(sensors_check_files "$files")"
163
[ -z "$files" ] && continue
164
- echo "CHART sensors.curr_$id '' '$name Current' 'Ampere' 'current' 'sensors.curr' line $((sensors_priority + 3)) $sensors_update_every '' '' 'sensors'"
165
- echo >>"$TMP_DIR/sensors.sh" "echo \"BEGIN sensors.curr_$id \$1\""
164
+ echo "CHART 'sensors.curr_${id}_${name}' '' 'Current' 'Ampere' 'current' 'sensors.curr' line $((sensors_priority + 3)) $sensors_update_every '' '' 'sensors'"
165
+ echo >>"$TMP_DIR/sensors.sh" "echo \"BEGIN 'sensors.curr_${id}_${name}' \$1\""
166
divisor=1000
167
;;
168
@@ -170,8 +170,8 @@ sensors_create() {
170
files="$(ls "$path"/power*_input 2>/dev/null)"
171
files="$(sensors_check_files "$files")"
172
[ -z "$files" ] && continue
173
- echo "CHART sensors.power_$id '' '$name Power' 'Watt' 'power' 'sensors.power' line $((sensors_priority + 4)) $sensors_update_every '' '' 'sensors'"
174
- echo >>"$TMP_DIR/sensors.sh" "echo \"BEGIN sensors.power_$id \$1\""
173
+ echo "CHART 'sensors.power_${id}_${name}' '' 'Power' 'Watt' 'power' 'sensors.power' line $((sensors_priority + 4)) $sensors_update_every '' '' 'sensors'"
174
+ echo >>"$TMP_DIR/sensors.sh" "echo \"BEGIN 'sensors.power_${id}_${name}' \$1\""
175
divisor=1000000
176
;;
177
@@ -179,16 +179,16 @@ sensors_create() {
179
files="$(ls "$path"/fan*_input 2>/dev/null)"
180
files="$(sensors_check_files "$files")"
181
[ -z "$files" ] && continue
182
- echo "CHART sensors.fan_$id '' '$name Fans Speed' 'Rotations / Minute' 'fans' 'sensors.fans' line $((sensors_priority + 5)) $sensors_update_every '' '' 'sensors'"
183
- echo >>"$TMP_DIR/sensors.sh" "echo \"BEGIN sensors.fan_$id \$1\""
182
+ echo "CHART 'sensors.fan_${id}_${name}' '' 'Fans Speed' 'Rotations / Minute' 'fans' 'sensors.fans' line $((sensors_priority + 5)) $sensors_update_every '' '' 'sensors'"
183
+ echo >>"$TMP_DIR/sensors.sh" "echo \"BEGIN 'sensors.fan_${id}_${name}' \$1\""
184
;;
185
186
energy)
187
files="$(ls "$path"/energy*_input 2>/dev/null)"
188
files="$(sensors_check_files "$files")"
189
[ -z "$files" ] && continue
190
- echo "CHART sensors.energy_$id '' '$name Energy' 'Joule' 'energy' 'sensors.energy' areastack $((sensors_priority + 6)) $sensors_update_every '' '' 'sensors'"
191
- echo >>"$TMP_DIR/sensors.sh" "echo \"BEGIN sensors.energy_$id \$1\""
190
+ echo "CHART 'sensors.energy_${id}_${name}' '' 'Energy' 'Joule' 'energy' 'sensors.energy' areastack $((sensors_priority + 6)) $sensors_update_every '' '' 'sensors'"
191
+ echo >>"$TMP_DIR/sensors.sh" "echo \"BEGIN 'sensors.energy_${id}_${name}' \$1\""
192
algorithm="incremental"
193
divisor=1000000
194
;;
@@ -197,8 +197,8 @@ sensors_create() {
197
files="$(ls "$path"/humidity*_input 2>/dev/null)"
198
files="$(sensors_check_files "$files")"
199
[ -z "$files" ] && continue
200
- echo "CHART sensors.humidity_$id '' '$name Humidity' 'Percent' 'humidity' 'sensors.humidity' line $((sensors_priority + 7)) $sensors_update_every '' '' 'sensors'"
201
- echo >>"$TMP_DIR/sensors.sh" "echo \"BEGIN sensors.humidity_$id \$1\""
200
+ echo "CHART 'sensors.humidity_${id}_${name}' '' 'Humidity' 'Percent' 'humidity' 'sensors.humidity' line $((sensors_priority + 7)) $sensors_update_every '' '' 'sensors'"
201
+ echo >>"$TMP_DIR/sensors.sh" "echo \"BEGIN 'sensors.humidity_${id}_${name}' \$1\""
202
divisor=1000
203
;;
204
collectors/diskspace.plugin/plugin_diskspace.c
+2
-2
@@ -284,7 +284,7 @@ static inline void do_disk_space_stats(struct mountinfo *mi, int update_every) {
284
m->st_space = rrdset_find_active_bytype_localhost("disk_space", disk);
285
if(unlikely(!m->st_space)) {
286
char title[4096 + 1];
287
- snprintfz(title, 4096, "Disk Space Usage for %s [%s]", family, mi->mount_source);
287
+ snprintfz(title, 4096, "Disk Space Usage");
288
m->st_space = rrdset_create_localhost(
289
"disk_space"
290
, disk
@@ -326,7 +326,7 @@ static inline void do_disk_space_stats(struct mountinfo *mi, int update_every) {
326
m->st_inodes = rrdset_find_active_bytype_localhost("disk_inodes", disk);
327
if(unlikely(!m->st_inodes)) {
328
char title[4096 + 1];
329
- snprintfz(title, 4096, "Disk Files (inodes) Usage for %s [%s]", family, mi->mount_source);
329
+ snprintfz(title, 4096, "Disk Files (inodes) Usage");
330
m->st_inodes = rrdset_create_localhost(
331
"disk_inodes"
332
, disk
collectors/proc.plugin/proc_interrupts.c
+1
-1
@@ -210,7 +210,7 @@ int do_proc_interrupts(int update_every, usec_t dt) {
210
snprintfz(id, 50, "cpu%d_interrupts", c);
211
212
char title[100+1];
213
- snprintfz(title, 100, "CPU%d Interrupts", c);
213
+ snprintfz(title, 100, "CPU Interrupts");
214
core_st[c] = rrdset_create_localhost(
215
"cpu"
216
, id
collectors/proc.plugin/proc_net_softnet_stat.c
+1
-1
@@ -117,7 +117,7 @@ int do_proc_net_softnet_stat(int update_every, usec_t dt) {
117
st = rrdset_find_active_bytype_localhost("cpu", id);
118
if(unlikely(!st)) {
119
char title[100+1];
120
- snprintfz(title, 100, "CPU%zu softnet_stat", l);
120
+ snprintfz(title, 100, "CPU softnet_stat");
121
122
st = rrdset_create_localhost(
123
"cpu"
collectors/proc.plugin/proc_softirqs.c
+1
-1
@@ -201,7 +201,7 @@ int do_proc_softirqs(int update_every, usec_t dt) {
201
snprintfz(id, 50, "cpu%d_softirqs", c);
202
203
char title[100 + 1];
204
- snprintfz(title, 100, "CPU%d softirqs", c);
204
+ snprintfz(title, 100, "CPU softirqs");
205
206
core_st[c] = rrdset_create_localhost(
207
"cpu"
collectors/proc.plugin/sys_fs_btrfs.c
+4
-4
@@ -552,7 +552,7 @@ int do_sys_fs_btrfs(int update_every, usec_t dt) {
552
553
snprintf(id, RRD_ID_LENGTH_MAX, "disk_%s", node->id);
554
snprintf(name, RRD_ID_LENGTH_MAX, "disk_%s", node->label);
555
- snprintf(title, 200, "BTRFS Physical Disk Allocation for %s", node->label);
555
+ snprintf(title, 200, "BTRFS Physical Disk Allocation");
556
557
netdata_fix_chart_id(id);
558
netdata_fix_chart_name(name);
@@ -610,7 +610,7 @@ int do_sys_fs_btrfs(int update_every, usec_t dt) {
610
611
snprintf(id, RRD_ID_LENGTH_MAX, "data_%s", node->id);
612
snprintf(name, RRD_ID_LENGTH_MAX, "data_%s", node->label);
613
- snprintf(title, 200, "BTRFS Data Allocation for %s", node->label);
613
+ snprintf(title, 200, "BTRFS Data Allocation");
614
615
netdata_fix_chart_id(id);
616
netdata_fix_chart_name(name);
@@ -653,7 +653,7 @@ int do_sys_fs_btrfs(int update_every, usec_t dt) {
653
654
snprintf(id, RRD_ID_LENGTH_MAX, "metadata_%s", node->id);
655
snprintf(name, RRD_ID_LENGTH_MAX, "metadata_%s", node->label);
656
- snprintf(title, 200, "BTRFS Metadata Allocation for %s", node->label);
656
+ snprintf(title, 200, "BTRFS Metadata Allocation");
657
658
netdata_fix_chart_id(id);
659
netdata_fix_chart_name(name);
@@ -698,7 +698,7 @@ int do_sys_fs_btrfs(int update_every, usec_t dt) {
698
699
snprintf(id, RRD_ID_LENGTH_MAX, "system_%s", node->id);
700
snprintf(name, RRD_ID_LENGTH_MAX, "system_%s", node->label);
701
- snprintf(title, 200, "BTRFS System Allocation for %s", node->label);
701
+ snprintf(title, 200, "BTRFS System Allocation");
702
703
netdata_fix_chart_id(id);
704
netdata_fix_chart_name(name);
collectors/python.d.plugin/python_modules/bases/charts.py
+1
-1
@@ -23,7 +23,7 @@ DIMENSION_SET = "SET '{id}' = {value}\n"
23
24
CHART_VARIABLE_SET = "VARIABLE CHART '{id}' = {value}\n"
25
26
-RUNTIME_CHART_CREATE = "CHART netdata.runtime_{job_name} '' 'Execution time for {job_name}' 'ms' 'python.d' " \
26
+RUNTIME_CHART_CREATE = "CHART netdata.runtime_{job_name} '' 'Execution time' 'ms' 'python.d' " \
27
"netdata.pythond_runtime line 145000 {update_every} '' 'python.d.plugin' '{module_name}'\n" \
28
"DIMENSION run_time 'run time' absolute 1 1\n"
29
collectors/python.d.plugin/sensors/sensors.chart.py
+7
-8
@@ -19,43 +19,43 @@ ORDER = [
19
# This is a prototype of chart definition which is used to dynamically create self.definitions
20
CHARTS = {
21
'temperature': {
22
- 'options': [None, ' temperature', 'Celsius', 'temperature', 'sensors.temperature', 'line'],
22
+ 'options': [None, 'Temperature', 'Celsius', 'temperature', 'sensors.temperature', 'line'],
23
'lines': [
24
[None, None, 'absolute', 1, 1000]
25
]
26
},
27
'voltage': {
28
- 'options': [None, ' voltage', 'Volts', 'voltage', 'sensors.voltage', 'line'],
28
+ 'options': [None, 'Voltage', 'Volts', 'voltage', 'sensors.voltage', 'line'],
29
'lines': [
30
[None, None, 'absolute', 1, 1000]
31
]
32
},
33
'current': {
34
- 'options': [None, ' current', 'Ampere', 'current', 'sensors.current', 'line'],
34
+ 'options': [None, 'Current', 'Ampere', 'current', 'sensors.current', 'line'],
35
'lines': [
36
[None, None, 'absolute', 1, 1000]
37
]
38
},
39
'power': {
40
- 'options': [None, ' power', 'Watt', 'power', 'sensors.power', 'line'],
40
+ 'options': [None, 'Power', 'Watt', 'power', 'sensors.power', 'line'],
41
'lines': [
42
[None, None, 'absolute', 1, 1000]
43
]
44
},
45
'fan': {
46
- 'options': [None, ' fans speed', 'Rotations/min', 'fans', 'sensors.fan', 'line'],
46
+ 'options': [None, 'Fans speed', 'Rotations/min', 'fans', 'sensors.fan', 'line'],
47
'lines': [
48
[None, None, 'absolute', 1, 1000]
49
]
50
},
51
'energy': {
52
- 'options': [None, ' energy', 'Joule', 'energy', 'sensors.energy', 'line'],
52
+ 'options': [None, 'Energy', 'Joule', 'energy', 'sensors.energy', 'line'],
53
'lines': [
54
[None, None, 'incremental', 1, 1000]
55
]
56
},
57
'humidity': {
58
- 'options': [None, ' humidity', 'Percent', 'humidity', 'sensors.humidity', 'line'],
58
+ 'options': [None, 'Humidity', 'Percent', 'humidity', 'sensors.humidity', 'line'],
59
'lines': [
60
[None, None, 'absolute', 1, 1000]
61
]
@@ -143,7 +143,6 @@ class Service(SimpleService):
143
if name not in self.order:
144
self.order.append(name)
145
chart_def = list(CHARTS[sensor]['options'])
146
- chart_def[1] = chip_name + chart_def[1]
146
self.definitions[name] = {'options': chart_def}
147
self.definitions[name]['lines'] = []
148
line = list(CHARTS[sensor]['lines'][0])
ml/Host.cc
+12
-18
@@ -20,11 +20,10 @@ static void updateDimensionsChart(RRDHOST *RH,
20
static thread_local RRDDIM *NumAnomalousDimensionsRD = nullptr;
21
22
if (!RS) {
23
- std::stringstream IdSS, NameSS, TitleSS;
23
+ std::stringstream IdSS, NameSS;
24
25
IdSS << "dimensions_on_" << localhost->machine_guid;
26
NameSS << "dimensions_on_" << localhost->hostname;
27
- TitleSS << "Anomaly detection dimensions for host " << RH->hostname;
27
28
RS = rrdset_create(
29
RH,
@@ -33,7 +32,7 @@ static void updateDimensionsChart(RRDHOST *RH,
32
NameSS.str().c_str(), // name
33
"dimensions", // family
34
"anomaly_detection.dimensions", // ctx
36
- TitleSS.str().c_str(), // title
35
+ "Anomaly detection dimensions", // title
36
"dimensions", // units
37
"netdata", // plugin
38
"ml", // module
@@ -67,11 +66,10 @@ static void updateRateChart(RRDHOST *RH, collected_number AnomalyRate) {
66
static thread_local RRDDIM *AnomalyRateRD = nullptr;
67
68
if (!RS) {
70
- std::stringstream IdSS, NameSS, TitleSS;
69
+ std::stringstream IdSS, NameSS;
70
71
IdSS << "anomaly_rate_on_" << localhost->machine_guid;
72
NameSS << "anomaly_rate_on_" << localhost->hostname;
74
- TitleSS << "Percentage of anomalous dimensions for host " << RH->hostname;
73
74
RS = rrdset_create(
75
RH,
@@ -80,7 +78,7 @@ static void updateRateChart(RRDHOST *RH, collected_number AnomalyRate) {
78
NameSS.str().c_str(), // name
79
"anomaly_rate", // family
80
"anomaly_detection.anomaly_rate", // ctx
83
- TitleSS.str().c_str(), // title
81
+ "Percentage of anomalous dimensions", // title
82
"percentage", // units
83
"netdata", // plugin
84
"ml", // module
@@ -105,11 +103,10 @@ static void updateWindowLengthChart(RRDHOST *RH, collected_number WindowLength)
103
static thread_local RRDDIM *WindowLengthRD = nullptr;
104
105
if (!RS) {
108
- std::stringstream IdSS, NameSS, TitleSS;
106
+ std::stringstream IdSS, NameSS;
107
108
IdSS << "detector_window_on_" << localhost->machine_guid;
109
NameSS << "detector_window_on_" << localhost->hostname;
112
- TitleSS << "Anomaly detector window length for host " << RH->hostname;
110
111
RS = rrdset_create(
112
RH,
@@ -118,7 +115,7 @@ static void updateWindowLengthChart(RRDHOST *RH, collected_number WindowLength)
115
NameSS.str().c_str(), // name
116
"detector_window", // family
117
"anomaly_detection.detector_window", // ctx
121
- TitleSS.str().c_str(), // title
118
+ "Anomaly detector window length", // title
119
"seconds", // units
120
"netdata", // plugin
121
"ml", // module
@@ -147,11 +144,10 @@ static void updateEventsChart(RRDHOST *RH,
144
static thread_local RRDDIM *NewAnomalyEventRD = nullptr;
145
146
if (!RS) {
150
- std::stringstream IdSS, NameSS, TitleSS;
147
+ std::stringstream IdSS, NameSS;
148
149
IdSS << "detector_events_on_" << localhost->machine_guid;
150
NameSS << "detector_events_on_" << localhost->hostname;
154
- TitleSS << "Anomaly events triggered for host " << RH->hostname;
151
152
RS = rrdset_create(
153
RH,
@@ -160,7 +156,7 @@ static void updateEventsChart(RRDHOST *RH,
156
NameSS.str().c_str(), // name
157
"detector_events", // family
158
"anomaly_detection.detector_events", // ctx
163
- TitleSS.str().c_str(), // title
159
+ "Anomaly events triggered", // title
160
"boolean", // units
161
"netdata", // plugin
162
"ml", // module
@@ -194,11 +190,10 @@ static void updateDetectionChart(RRDHOST *RH) {
190
static thread_local RRDDIM *UserRD, *SystemRD = nullptr;
191
192
if (!RS) {
197
- std::stringstream IdSS, NameSS, TitleSS;
193
+ std::stringstream IdSS, NameSS;
194
195
IdSS << "prediction_stats_" << RH->machine_guid;
196
NameSS << "prediction_stats_for_" << RH->hostname;
201
- TitleSS << "Prediction thread CPU usage for host " << RH->hostname;
197
198
RS = rrdset_create_localhost(
199
"netdata", // type
@@ -206,7 +201,7 @@ static void updateDetectionChart(RRDHOST *RH) {
201
NameSS.str().c_str(), // name
202
"ml", // family
203
"netdata.prediction_stats", // ctx
209
- TitleSS.str().c_str(), // title
204
+ "Prediction thread CPU usage", // title
205
"milliseconds/s", // units
206
"netdata", // plugin
207
"ml", // module
@@ -235,11 +230,10 @@ static void updateTrainingChart(RRDHOST *RH, struct rusage *TRU)
230
static thread_local RRDDIM *SystemRD = nullptr;
231
232
if (!RS) {
238
- std::stringstream IdSS, NameSS, TitleSS;
233
+ std::stringstream IdSS, NameSS;
234
235
IdSS << "training_stats_" << RH->machine_guid;
236
NameSS << "training_stats_for_" << RH->hostname;
242
- TitleSS << "Training thread CPU usage for host " << RH->hostname;
237
238
RS = rrdset_create_localhost(
239
"netdata", // type
@@ -247,7 +241,7 @@ static void updateTrainingChart(RRDHOST *RH, struct rusage *TRU)
241
NameSS.str().c_str(), // name
242
"ml", // family
243
"netdata.training_stats", // ctx
250
- TitleSS.str().c_str(), // title
244
+ "Training thread CPU usage", // title
245
"milliseconds/s", // units
246
"netdata", // plugin
247
"ml", // module
web/server/static/static-threaded.c
+1
-1
@@ -331,7 +331,7 @@ static void web_server_tmr_callback(void *timer_data) {
331
char title[100 + 1];
332
333
snprintfz(id, 100, "web_thread%d_cpu", worker_private->id + 1);
334
- snprintfz(title, 100, "Netdata web server thread No %d CPU usage", worker_private->id + 1);
334
+ snprintfz(title, 100, "Netdata web server thread CPU usage");
335
336
st = rrdset_create_localhost(
337
"netdata"