Metricbeat cpu metricset: what is sample rate?


We can set the period of the cpu metricset using the metricbeat.yml config file (which I believe represents the frequency with which the metricset is run). What is the minimum value that can be set? is it one second. If this is the case then something must be going on under the hood to aggregate cpu samples which are happening much much more frequently than for example 1 per second.

Could someone explain what the sample rate or other mechanisms are as we need to be sure that we have high resolution cpu metrics?


(Andrew Kroh) #2

The period configuration option controls how often the metricset is executed (frequency = 1/period). As far as I know the only requirement on period is that the value must be greater than 0. The config value is a duration which allows for the following unit types: ns, us, ms, s, m, h.

The OS is responsible for doing the CPU cycle accounting. Metricbeat is sampling the counters provided by the operating system (or reading timers on Windows).

So if you want a higher resolution samples of those counters you can decrease the period. If you set the period lower than the amount of time that it takes the metricset to execute one iteration then the metricset will be constantly running which won't be ideal. So take a look at the metricset.rtt value, which is the elapsed execution time for the collection operation, and keep the period above that value.

(system) #3

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.