-
Notifications
You must be signed in to change notification settings - Fork 1.6k
/
Copy pathhost_metrics.cue
277 lines (255 loc) · 10.6 KB
/
host_metrics.cue
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
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
package metadata
components: sources: host_metrics: {
title: "Host Metrics"
description: """
Examines system data sources on the local system and generates metrics
describing utilization of various system resources, such as CPU, memory,
disk, and network utilization.
"""
classes: {
commonly_used: false
delivery: "at_least_once"
deployment_roles: ["daemon"]
development: "stable"
egress_method: "batch"
stateful: false
}
features: {
acknowledgements: false
collect: {
checkpoint: enabled: false
from: service: services.host
}
multiline: enabled: false
}
support: {
notices: []
requirements: []
warnings: [
"""
When vector is run under kubernetes, you may experience an error when loading the partition usage data:
```Failed to load partition usage data. mount_point="/host/proc/sys/fs/binfmt_misc" error=FFI function "statvfs" call failed: Too many levels of symbolic links (os error 40)```
To work around this configuration issue, add one of the following lines to the
`host_metrics` configuration section:
```filesystem.devices.excludes = ["binfmt_misc"]```,
```filesystem.filesystems.excludes = ["binfmt_misc"]```, or
```filesystem.mountpoints.excludes = ["*/proc/sys/fs/binfmt_misc"]```.
This workaround is included by default in the Helm chart distributed with Vector.
""",
]
}
installation: {
platform_name: null
}
env_vars: {
PROCFS_ROOT: {
description: "Sets an arbitrary path to the system's Procfs root. Can be used to expose host metrics from within a container. Unset and uses system `/proc` by default."
type: string: {
default: null
examples: ["/mnt/host/proc"]
}
}
SYSFS_ROOT: {
description: "Sets an arbitrary path to the system's Sysfs root. Can be used to expose host metrics from within a container. Unset and uses system `/sys` by default."
type: string: {
default: null
examples: ["/mnt/host/sys"]
}
}
}
configuration: base.components.sources.host_metrics.configuration
output: metrics: {
_host_metrics_tags: {
collector: {
description: "Which collector this metric comes from."
required: true
}
host: {
description: "The hostname of the originating system."
required: true
examples: [_values.local_host]
}
}
// Host CPU
host_cpu_seconds_total: _host & {
description: "The number of CPU seconds accumulated in different operating modes."
type: "counter"
tags: _host_metrics_tags & {
collector: examples: ["cpu"]
cpu: {
description: "The index of the CPU core or socket."
required: true
examples: ["1"]
}
mode: {
description: "Which mode the CPU was running in during the given time."
required: true
examples: ["idle", "system", "user", "nice", "io_wait"]
}
}
}
host_logical_cpus: _host & {
description: "The number of logical CPUs."
type: "gauge"
}
host_physical_cpus: _host & {
description: "The number of physical CPUs."
type: "gauge"
}
// Host process
process_runtime: _host & _process_counter & {description: "The process uptime."}
process_cpu_usage: _host & _process_gauge & {description: "The process CPU usage."}
process_memory_usage: _host & _process_gauge & {description: "The process memory usage."}
// Host cgroups
cgroup_cpu_usage_seconds_total: _host & _cgroup_cpu & {description: "The total amount CPU time used by this cgroup and its descendants, in seconds."}
cgroup_cpu_user_seconds_total: _host & _cgroup_cpu & {description: "The total amount of CPU time spent by this cgroup in user space, in seconds."}
cgroup_cpu_system_seconds_total: _host & _cgroup_cpu & {description: "The total amount of CPU time spent by this cgroup in system tasks, in seconds."}
cgroup_memory_current_bytes: _host & _cgroup_memory & {description: "The total amount of memory currently being used by this cgroup and its descendants, in bytes."}
cgroup_memory_anon_bytes: _host & _cgroup_memory & {description: "The total amount of memory used by this cgroup in anonymous mappings (normal program allocation), in bytes."}
cgroup_memory_file_bytes: _host & _cgroup_memory & {description: "The total amount of memory used by this cgroup to cache filesystem data, including tmpfs and shared memory, in bytes."}
// Host disk
disk_read_bytes_total: _host & _disk_counter & {description: "The accumulated number of bytes read in."}
disk_reads_completed_total: _host & _disk_counter & {description: "The accumulated number of read operations completed."}
disk_written_bytes_total: _host & _disk_counter & {description: "The accumulated number of bytes written out."}
disk_writes_completed_total: _host & _disk_counter & {description: "The accumulated number of write operations completed."}
// Host filesystem
filesystem_free_bytes: _host & _filesystem_bytes & {description: "The number of bytes free on the named filesystem."}
filesystem_total_bytes: _host & _filesystem_bytes & {description: "The total number of bytes in the named filesystem."}
filesystem_used_bytes: _host & _filesystem_bytes & {description: "The number of bytes used on the named filesystem."}
filesystem_used_ratio: _host & _filesystem_bytes & {description: "The ratio between used and total bytes on the named filesystem."}
// Host load
load1: _host & _loadavg & {description: "System load averaged over the last 1 minute."}
load5: _host & _loadavg & {description: "System load averaged over the last 5 minutes."}
load15: _host & _loadavg & {description: "System load averaged over the last 15 minutes."}
// Host time
uptime: _host & _host_metric & {description: "The number of seconds since the last boot."}
boot_time: _host & _host_metric & {description: "The UNIX timestamp of the last boot."}
// Host memory
memory_active_bytes: _host & _memory_gauge & _memory_nowin & {description: "The number of bytes of active main memory."}
memory_available_bytes: _host & _memory_gauge & {description: "The number of bytes of main memory available."}
memory_buffers_bytes: _host & _memory_linux & {description: "The number of bytes of main memory used by buffers."}
memory_cached_bytes: _host & _memory_linux & {description: "The number of bytes of main memory used by cached blocks."}
memory_free_bytes: _host & _memory_gauge & {description: "The number of bytes of main memory not used."}
memory_inactive_bytes: _host & _memory_macos & {description: "The number of bytes of main memory that is not active."}
memory_shared_bytes: _host & _memory_linux & {description: "The number of bytes of main memory shared between processes."}
memory_swap_free_bytes: _host & _memory_gauge & {description: "The number of free bytes of swap space."}
memory_swapped_in_bytes_total: _host & _memory_counter & _memory_nowin & {
description: "The number of bytes that have been swapped into main memory."
}
memory_swapped_out_bytes_total: _host & _memory_counter & _memory_nowin & {
description: "The number of bytes that have been swapped out from main memory."
}
memory_swap_total_bytes: _host & _memory_gauge & {description: "The total number of bytes of swap space."}
memory_swap_used_bytes: _host & _memory_gauge & {description: "The number of used bytes of swap space."}
memory_total_bytes: _host & _memory_gauge & {description: "The total number of bytes of main memory."}
memory_used_bytes: _host & _memory_linux & {description: "The number of bytes of main memory used by programs or caches."}
memory_wired_bytes: _host & _memory_macos & {description: "The number of wired bytes of main memory."}
// Host network
network_receive_bytes_total: _host & _network_gauge & {description: "The number of bytes received on this interface."}
network_receive_errs_total: _host & _network_gauge & {description: "The number of errors encountered during receives on this interface."}
network_receive_packets_total: _host & _network_gauge & {description: "The number of packets received on this interface."}
network_transmit_bytes_total: _host & _network_gauge & {description: "The number of bytes transmitted on this interface."}
network_transmit_errs_total: _host & _network_gauge & {description: "The number of errors encountered during transmits on this interface."}
network_transmit_packets_drop_total: _host & _network_nomac & {description: "The number of packets dropped during transmits on this interface."}
network_transmit_packets_total: _host & _network_nomac & {description: "The number of packets transmitted on this interface."}
// Helpers
_host: {
default_namespace: "host"
}
_cgroup_cpu: {
type: "counter"
tags: _host_metrics_tags & {
collector: examples: ["cgroups"]
cgroup: _cgroup_name
}
}
_cgroup_memory: {
type: "gauge"
tags: _host_metrics_tags & {
collector: examples: ["cgroups"]
cgroup: _cgroup_name
}
}
_cgroup_name: {
description: "The control group name."
required: true
examples: ["/", "user.slice", "system.slice/snapd.service"]
}
_disk_device: {
description: "The disk device name."
required: true
examples: ["sda", "sda1", "dm-1"]
}
_disk_counter: {
type: "counter"
tags: _host_metrics_tags & {
collector: examples: ["disk"]
device: _disk_device
}
}
_filesystem_bytes: {
type: "gauge"
tags: _host_metrics_tags & {
collector: examples: ["filesystem"]
device: _disk_device
filesystem: {
description: "The name of the filesystem type."
required: true
examples: ["ext4", "ntfs"]
}
}
}
_loadavg: {
type: "gauge"
tags: _host_metrics_tags & {
collector: examples: ["loadavg"]
}
relevant_when: "OS is not Windows"
}
_host_metric: {
type: "gauge"
tags: _host_metrics_tags & {
collector: examples: ["host"]
}
}
_memory_counter: {
type: "counter"
tags: _host_metrics_tags & {
collector: examples: ["memory"]
}
}
_memory_gauge: {
type: "gauge"
tags: _host_metrics_tags & {
collector: examples: ["memory"]
}
}
_memory_linux: _memory_gauge & {relevant_when: "OS is Linux"}
_memory_macos: _memory_gauge & {relevant_when: "OS is macOS X"}
_memory_nowin: {relevant_when: "OS is not Windows"}
_network_gauge: {
type: "gauge"
tags: _host_metrics_tags & {
collector: examples: ["network"]
device: {
description: "The network interface device name."
required: true
examples: ["eth0", "enp5s3"]
}
}
}
_network_nomac: _network_gauge & {relevant_when: "OS is not macOS"}
_process_counter: {
type: "counter"
tags: _host_metrics_tags & {
collector: examples: ["process"]
}
}
_process_gauge: {
type: "gauge"
tags: _host_metrics_tags & {
collector: examples: ["process"]
}
}
}
}