By default, the chart renderer will use a summation method to condense entries within a time range. For this data set, you are probably looking for one of the other math modules, such as mean.
To illustrate, let's consider a user who is monitoring infrastructure performance. An example query might be looking to chart the free memory available on a system:
tag=mem regex "Mem:\s*(?P<total>\S*)\s* (?P<used>\S*)\s*(?P<free>\S*)\s*(?P<shared>\S*)\s*(?P<buffers>\S*)\s*(?P<available>\S*)" | chart free
The chart appears incorrect because the charting renderer adds the "free" value of each entry to provide a total for a given time slice for display on a chart. We can alter the query slightly to insert a mean module in order to take the average value within that same given time slice. This should provide the results we are looking for:
tag=mem regex "Mem:\s*(?P<total>\S*)\s* (?P<used>\S*)\s*(?P<free>\S*)\s*(?P<shared>\S*)\s*(?P<buffers>\S*)\s*(?P<available>\S*)" | mean free | chart mean
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article