Snap-Telemetry Plugin for SignalFx sends numeric values to SignalFx.
Read the system requirements, supported platforms, and installation guide for obtaining and using this Snap plugin.
- golang 1.7+ (needed only for building)
All OSs currently supported by snap:
- Linux/amd64
- Darwin/amd64
The following sections provide a guide for obtaining the plugin.
The simplest approach is to use go get
to fetch and build the plugin. The following command will place the binary in your $GOPATH/bin
folder where you can load it into snap.
$ go get github.com/opsvision/snap-plugin-publisher-signalfx
The following provides instructions for building the plugin yourself if you decided to downlaod the source. We assume you already have a $GOPATH setup for golang development. The repository utilizes glide for library management.
$ mkdir -p $GOPATH/src/github.com/opsvision
$ cd $GOPATH/src/github.com/opsvision
$ git clone http://github.com/opsvision/snap-plugin-publisher-signalfx
$ glide up
[INFO] Downloading dependencies. Please wait...
[INFO] --> Fetching updates for ...
[INFO] Resolving imports
[INFO] --> Fetching updates for ...
[INFO] Downloading dependencies. Please wait...
[INFO] Setting references for remaining imports
[INFO] Exporting resolved dependencies...
[INFO] --> Exporting ...
[INFO] Replacing existing vendor dependencies
[INFO] Project relies on ... dependencies.
$ go install
The following file structure provides an overview of where the files exist in the source tree.
snap-plugin-publisher-signalfx
├── glide.yaml
├── LICENSE
├── main.go
├── metadata.yml
├── README.md
├── scripts
│ ├── load.sh
│ └── unload.sh
├── signalfx
│ └── signalfx.go
└── tasks
└── signalfx.yaml
Set up the Snap framework
Once the framework is up and running, you can load the plugin.
$ snaptel plugin load snap-plugin-publisher-signalfx
Plugin loaded
Name: signalfx
Version: 1
Type: publisher
Signed: false
Loaded Time: Tue, 24 Jan 2017 20:45:48 UTC
You need to create or update a task file to use the SignalFx publisher plugin. We have provided an example, tasks/awssqs.yaml shown below. In our example, we utilize the psutil collector so we have some data to work with. There are three (3) configuration settings you can use.
Setting | Description | Required? |
---|---|---|
debug_file | An absolute path to a log file - this makes debugging easier. | No |
hostname | The hostname to use; if absent, the plugin will attempt to determine the hostname. | No |
token | The SignalFx API token. | Yes |
---
version: 1
schedule:
type: "simple"
interval: "5s"
max-failures: 10
workflow:
collect:
config:
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: "signalfx"
config:
token: "1234ABCD"
debug_file: "/tmp/signalfx-debug.log"
hostname: "spiderman"
Once the task file has been created, you can create and watch the task.
$ snaptel task create -t signalfx.yaml
Using task manifest to create task
Task created
ID: 72869b36-def6-47c4-9db2-822f93bb9d1f
Name: Task-72869b36-def6-47c4-9db2-822f93bb9d1f
State: Running
$ snaptel task list
ID NAME STATE ...
72869b36-def6-47c4-9db2-822f93bb9d1f Task-72869b36-def6-47c4-9db2-822f93bb9d1f Running ...
Note: Truncated results for brevity.
The SignalFx plugin will only publish numeric values (int64 and float64) using the SignalFx Gauge and GaugeF respectively. The code attempts to convert numeric values; e.g. uint --> int64. All other metric values will be ignored (e.g. strings). The metrics will be sent with the namespace, metric value (converted), and the hostname as a dimension. This makes it simple to identify and use the incoming values in SignalFx.
- Testing: The testing being done is rudimentary at best. Need to improve the testing.
Note: Please let me know if you find a bug or have feedbck on how to improve the collector.
- Author: @dishmael
- Company: OpsVision Solutions