Snap Prometheus plugin written in Go supports publishing ingested time series data points into Prometheus. It's used in the Snap framework.
To get started, you'll need Snap and OpenTSDB running to receive and aggregate sampling data points.
- golang 1.6+ (needed only for building)
- snap
All OSs currently supported by Snap:
- Linux/amd64
- Darwin/amd64
You can get the pre-built binaries for your OS and architecture at plugin's GitHub Releases page.
Fork https://github.com/intelsdi-x/snap-plugin-publisher-prometheus
Clone repo into $GOPATH/src/github.com/intelsdi-x/
:
$ git clone https://github.com/<yourGithubID>/snap-plugin-publisher-prometheus.git
Build the plugin by running make within the cloned repo:
$ make
This builds the plugin in ./build
- Set up the Snap framework
TODO
Example of running psutil collector plugin and publishing data to Prometheus.
Set up the Snap framework
Ensure Snap daemon is running:
- initd:
service snap-telemetry start
- systemd:
systemctl start snap-telemetry
- command line:
sudo snapteld -l 1 -t 0 &
Download and load Snap plugins (paths to binary files for Linux/amd64):
$ snaptel plugin load snap-plugin-publisher-prometheus
$ snaptel plugin load snap-plugin-collector-psutil
Create a task manifest (see exemplary tasks),
for example psutil-prometheus.json
with following content:
{
"version": 1,
"schedule": {
"type": "simple",
"interval": "10s"
},
"workflow": {
"collect": {
"metrics": {
"/intel/psutil/load/load1": {},
"/intel/psutil/load/load15": {},
"/intel/psutil/load/load5": {},
"/intel/psutil/vm/available": {},
"/intel/psutil/vm/free": {},
"/intel/psutil/vm/used": {}
},
"publish": [
{
"plugin_name": "prometheus",
"config": {
"host": "127.0.0.1",
"port": 80
}
}
]
}
}
}
Create a task:
$ snaptel task create -t psutil-prometheus.json
Watch created task:
$ snaptel task watch <task_id>
To stop previously created task:
$ snaptel task stop <task_id>
This plugin only supports the "host" tag for now.
As we launch this plugin, we do not have any outstanding requirements for the next release. If you have a feature request, please add it as an issue.
This repository is one of many plugins in Snap, a powerful telemetry framework. See the full project at http://github.com/intelsdi-x/snap To reach out to other users, head to the main framework
We love contributions!
There's more than one way to give back, from examples to blogs to code updates. See our recommended process in CONTRIBUTING.md.
This is Open Source software released under the Apache 2.0 License. Please see the LICENSE file for full license details.
Your contribution is incredibly important to us.