2

I've got a problem with doing a specific graph in Bosun. This graph should contain hosts with the highest memory usage in percentage, but I can't find any usable metric to do that. Of course I have os.mem.used just like os.mem.percent_free, but for me it isn't quite helpful. I thought of grabbing two series from query, just like for the alerting: total number of moemry and used one, divide used by total and multiply it by 100.

The problem seems to be that I can't divide series, so the last chance is to write my own metric by greping and awking free command in Linux.

bytecode77
  • 14,163
  • 30
  • 110
  • 141
autobus
  • 45
  • 4
  • Not sure I totally understand what you are after.... I think the expression language can probably do what you need, but I don't fully understand your question. – Kyle Brandt Sep 10 '15 at 16:25
  • Might help if you add why os.mem.percent_free isn't the metric you want. – Kyle Brandt Sep 10 '15 at 16:32

2 Answers2

1

If you really want a graph of percent_used instead of percent_free you should use 100-q("sum:os.mem.percent_free{host=$hosts}", "1h", ""). Then if you want to filter the series on the graph you should use the filter function. Example you can use on the expression page:

$hosts=ny-redis*|ny-devredis*
$limit=5
$avgfree=avg(q("sum:os.mem.percent_free{host=$hosts}", "1h", ""))
$lowest_free=limit(sort($avgfree,"asc"),$limit)
$percent_used=100-q("sum:os.mem.percent_free{host=$hosts}", "1h", "")
filter($percent_used,$lowest_free)

We have two dev instances and two prod instances, so with a limit of 5 I see all of them in the graph:

bosun percent_used

But you can change the expression to use $limit=2 and it would only show the top two:

bosun percent_used top 2

however note the scale has been truncated. Right now I don't think there is any way to specify what scale to use on the expression page or in an alert template, but you could grab the raw data and graph it using a different graphing library.

Greg Bray
  • 14,929
  • 12
  • 80
  • 104
0

If you're open to an alternative back-end, Axibase Time-Series Database supports scollector as the datasource.

Disclosure: I work for Axibase. We currently don't have a storage driver for Bosun itself but Bosun looks very promising, so we're looking at it.

In ATSD you compute derived scollector metrics as follows:

value = 100*value('os.mem.used')/value('os.mem.total')

Derived series example

Memory Usage %

Sometimes you just need to recalculate the same series, for example to convert some metric to negative values. In this case, replace-value works pretty well:

replace-value = -value

Replace-value example

Negative value example

Sergei Rodionov
  • 4,079
  • 6
  • 27
  • 44
  • I didn't know Axibase supported scollector. That is awesome! – Greg Bray Sep 11 '15 at 16:40
  • @GregBray Thanks! We actually discovered scollector by accident when Bosun made it to the top page on HN a few months ago. The combo looks very promising, we installed scollector on all Windows servers and recommended scollector to existing customers. – Sergei Rodionov Sep 11 '15 at 21:30
  • Cool! I wrote a bunch of the Windows collectors, so ping me on twitter (gbrayut) or bosun.slack.com if you see any issues :-) – Greg Bray Sep 11 '15 at 23:01