Home

Awesome

<!-- http://www.apache.org/licenses/LICENSE-2.0.txt Copyright 2015 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -->

snap <sup><sub>A powerful telemetry framework</sub></sup>

Join the chat at https://gitter.im/intelsdi-x/snap Build Status Go Report Card

<img src="https://cloud.githubusercontent.com/assets/1744971/13930753/6f676b34-ef5d-11e5-97be-8503562cd5fe.png" width="50%">

Here are blog posts related to snap by the team:


  1. Overview
  2. Getting Started
  1. Documentation
  1. Community Support
  2. Contributing
  1. License
  2. Contributors
  1. Thank You

Overview

snap is a framework for enabling the gathering of telemetry from systems. The goals of this project are to:

The key features of snap are:

Some additionally important notes about how snap works:

snap is not intended to:

Getting Started

In Active Development

The master branch is used for new feature development. Our goal is to keep it in a deployable state. If you're looking for the most recent binary that is versioned, please see the latest release.

System Requirements

Snap deploys as a binary, which makes requirements quite simple. We've tested on a subset of Linux and OS X versions.

Installation

You can get the pre-built binaries for your OS and architecture at snap's GitHub Releases page. This isn't the comprehensive list of plugins, but they will help you get started. Right now, snap only supports Linux and OS X (Darwin).

Building snap

If you're looking for the bleeding edge of snap, you can build it by getting the master branch using go get github.com/intelsdi-x/snap. Otherwise you can just use the binaries. To build snap from source, you will need Golang >= 1.4 and GNU Make. For more on building snap check out BUILD_AND_TEST.md.

Running snap

Start a standalone snap agent (snapd):

If you cloned down the repository and aren't using just downloaded binaries, you can set the following. Also, follow the steps in BUILD_AND_TEST.md:

$ export SNAP_PATH=<snapDirectoryPath>/build

And then you can use $SNAP_PATH/bin for your <snapBinPath>.

$ <snapBinPath>/snapd --plugin-trust 0 --log-level 1

This will bring up a snap agent without requiring plugin signing and set the logging level to debug. snap's REST API will be listening on port 8181. To learn more about the snap agent and how to use it look at SNAPD.md and/or run <snapBinPath>/snapd -h.

Running snap in tribe (cluster) mode

Start the first node:

$ <snapBinPath>/snapd --tribe

All other nodes who join will need to select any existing member of the cluster.

$ <snapBinPath>/snapd --tribe-seed <ip or name of another tribe member>

Checkout the tribe doc for more info.

Load Plugins

snap gets its power from the use of plugins. The plugin catalog is a collection of all known plugins for snap.

Next, open a new shell and lets load a few of the demo plugins. You can do this via cURL, or snapctl, snap's CLI.

Using cURL

$ cd $SNAP_PATH
$ curl -X POST -F plugin=@plugin/snap-collector-mock1 http://localhost:8181/v1/plugins
$ curl -X POST -F plugin=@plugin/snap-processor-passthru http://localhost:8181/v1/plugins
$ curl -X POST -F plugin=@plugin/snap-publisher-file http://localhost:8181/v1/plugins

Or:

Using snapctl (snap CLI)

cd $SNAP_PATH
$ <snapBinPath>/snapctl plugin load plugin/snap-collector-mock1
$ <snapBinPath>/snapctl plugin load plugin/snap-processor-passthru
$ <snapBinPath>/snapctl plugin load plugin/snap-publisher-file

Let's look at what plugins we have loaded now:

$ <snapBinPath>/snapctl plugin list
NAME             VERSION         TYPE            SIGNED          STATUS          LOADED TIME
mock             1               collector       false           loaded          Tue, 17 Nov 2015 14:08:17 PST
passthru         1               processor       false           loaded          Tue, 17 Nov 2015 14:16:12 PST
file             3               publisher       false           loaded          Tue, 17 Nov 2015 14:16:19 PST

Running Tasks

Tasks can be in JSON or YAML format. Let's start one of the example tasks from the examples/tasks/ directory:

$ cd <snapDirectoryPath>
$ <snapBinPath>/snapctl task create -t examples/tasks/mock-file.yaml
Using task manifest to create task
Task created
ID: 8b9babad-b3bc-4a16-9e06-1f35664a7679
Name: Task-8b9babad-b3bc-4a16-9e06-1f35664a7679
State: Running

From here, you should be able to do 2 things:

See the data that is being published to the file:

$ tail -f /tmp/snap_published_mock_file.log

Or actually tap into the data that snap is collecting using the task ID to watch the task:

$ <snapBinPath>/snapctl task watch 8b9babad-b3bc-4a16-9e06-1f35664a7679

If the task ID already scrolled by, you can get the task ID with:

$ <snapBinPath>/snapctl task list

Building Tasks

Documentation for building a task can be found here.

Plugin Catalog

All known plugins are tracked in the plugin catalog and are tagged as collectors, processors and publishers.

If you would like to write your own, read through Author a Plugin. Let us know if you begin to write one by opening an Issue. When you finish, please open a Pull Request to add yours to the catalog!

Documentation

Documentation for snap will be kept in this repository for now in the docs/ directory. We would also like to link to external how-to blog posts as people write them. See our CONTRIBUTING.md for more details.

Examples

There are interesting examples of using snap in every plugin repository. For the full list of plugins, review the plugin catalog. There is an Examples package that demonstrates snap configurations and usages.

Roadmap

We have a few known features we want to take on from here while we remain open for feedback after public release. They are:

If you would like to propose a feature, please open an Issue) that includes RFC in it (for request for comments).

Community Support

This repository is one of many projects in the snap framework. Discuss your questions about snap by reaching out to us:

The full project lives here, at http://github.com/intelsdi-x/snap.

Contributing

We encourage contribution from the community. snap needs:

To contribute to the snap framework, see our CONTRIBUTING file. To give back to a specific plugin, open an issue on its repository.

Author a Plugin

The power of snap comes from its open architecture. Add to the ecosystem by building your own plugins to collect, process or publish telemetry.

License

snap is Open Source software released under the Apache 2.0 License.

Contributors

Initial Authors

All contributors are equally important to us, but we would like to thank the initial authors for helping make open sourcing snap possible.

Maintainers

Amongst the many awesome contributors, there are the maintainers. These maintainers may change over time, but they are all members of the @intelsdi-x/snap-maintainers team. This group will help you by:

Just tag @intelsdi-x/snap-maintainers if you need to get some attention on an issue. If at any time, you don't get a quick enough response, reach out to any of the following team members directly:

<table border="0" cellspacing="0" cellpadding="0"> <tr> <td width="125"><a href="https://github.com/andrzej-k"><sub>@andrzej-k</sub><img src="https://avatars.githubusercontent.com/u/13486250" alt="@andrzej-k"></a></td> <td width="125"><a href="https://github.com/candysmurf"><sub>@candysmurf</sub><img src="https://avatars.githubusercontent.com/u/13841563" alt="@candysmurf"></a></td> <td width="125"><a href="https://github.com/ConnorDoyle"><sub>@ConnorDoyle</sub><img src="https://avatars.githubusercontent.com/u/379372" alt="@ConnorDoyle"></a></td> <td width="125"><a href="https://github.com/danielscottt"><sub>@danielscottt</sub><img src="https://avatars.githubusercontent.com/u/1194436" alt="@danielscottt"></a></td> <td width="125"><a href="https://github.com/geauxvirtual"><sub>@geauxvirtual</sub><img src="https://avatars.githubusercontent.com/u/1395030" alt="@geauxvirtual"></a></td> <td width="125"><a href="http://github.com/jcooklin"><sub>@jcooklin</sub><img src="https://avatars.githubusercontent.com/u/862968" alt="@jcooklin"></a></td> </tr> <tr> <td width="125"><a href="https://github.com/lynxbat"><sub>@lynxbat</sub><img src="https://avatars.githubusercontent.com/u/1278669" width="100" alt="@lynxbat"></a></td> <td width="125"><a href="https://github.com/marcin-krolik"><sub>@marcin-krolik</sub><img src="https://avatars.githubusercontent.com/u/14905131" width="100" alt="@marcin-krolik"></a></td> <td width="125"><a href="https://github.com/mjbrender"><sub>@mjbrender</sub><img src="https://avatars.githubusercontent.com/u/1744971" width="100" alt="@mjbrender"></a></td> <td width="125"><a href="https://github.com/nqn"><sub>@nqn</sub><img src="https://avatars.githubusercontent.com/u/897374" width="100" alt="@nqn"></a></td> <td width="125"><a href="https://github.com/tiffanyfj"><sub>@tiffanyfj</sub><img src="https://avatars.githubusercontent.com/u/12282848" width="100" alt="@tiffanyfj"></a></td> </tr> </table>

We're also looking for new maintainers from the community. Please let us know if you would like to become one by opening an Issue titled "interested in becoming a maintainer." We are currently working on a more official process.

Thank You

And thank you! Your contribution, through code and participation, is incredibly important to us.