This plugin collects metrics from Snap itself. It is quite simple so far and just collects some counts for all tasks.
It's used in the snap framework.
- golang 1.5+ (needed only for building)
Fork https://github.com/raintank/snap-plugin-collector-snapstats
Clone repo into $GOPATH/src/github.com/raintank/
:
$ git clone https://github.com/<yourGithubID>/snap-plugin-collector-snapstats.git
Build the plugin by running make within the cloned repo:
$ make
This builds the plugin in /build/
Uses govendor to manage dependencies.
- Set up the snap framework
- Ensure
$SNAP_PATH
is exportedexport SNAP_PATH=$GOPATH/src/github.com/intelsdi-x/snap/build
This plugin has the ability to gather the following metrics:
Namespace | Description (optional) |
---|---|
/grafanalabs/snapstats/tasks/state/Disabled/count | Total number of disabled Snap tasks |
/grafanalabs/snapstats/tasks/state/Running/count | Total number of Running Snap tasks |
/grafanalabs/snapstats/tasks/state/Stopped/count | Total number of Stopped Snap tasks |
/grafanalabs/snapstats/tasks/hitcount | Total sum of the all the snap tasks' hit counts |
/grafanalabs/snapstats/tasks/failedcount | Total sum of the all the snap tasks' failed counts |
There is an example task in the examples directory.
It has one config variable that is required - snap-url
For most users, this value should be http://localhost:8181
. It is mandatory that the url starts with the http or https protocol.
Hopefully, Intel will be releasing a more complete lib that will make this obsolete.
This plugin is released under the Apache 2.0 License.
- Author: @daniellee