The open telemetry framework
**Snap** is an open telemetry framework designed to simplify the collection, processing and publishing of system data through a single API. The goals of this project are to: * Empower systems to expose a consistent set of telemetry data * Simplify telemetry ingestion across ubiquitous storage systems * Allow flexible processing of telemetry data on agent (e.g. filtering and decoration) * Provide powerful clustered control of telemetry workflows across small or large clusters ---- 1. [Overview](#overview) 2. [Getting Started](#getting-started) * [System Requirements](#system-requirements) * [Installation](#installation) * [Running Snap](#running-snap) * [Load Plugins](#load-plugins) * [Running Tasks](#running-tasks) * [Building Tasks](#building-tasks) * [Plugin Catalog](#plugin-catalog) 3. [Documentation](#documentation) * [Examples](#examples) 4. [Community Support](#community-support) 5. [Contributing](#contributing) * [Author a Plugin](#author-a-plugin) * [Become a Maintainer](#become-a-maintainer) 6. [Code of Conduct](#code-of-conduct) 7. [Security Disclosure](#security-disclosure) 8. [License](#license) 10. [Thank You](#thank-you) ## Overview **The Snap Telemetry Framework** is a project made up of multiple parts: * A hardened, extensively tested daemon, `snapteld`, and CLI, `snaptel` (in this repo) * A growing number of maturing `plugins` (found in the [Plugin Catalog](#plugin-catalog)) * Lots of example `tasks` to gather and publish metrics (found in the [Examples folder](examples/)) These and other terminology are explained in the [glossary](docs/GLOSSARY.md). The key features of Snap are: * **Plugin Architecture**: Snap has a simple and smart modular design. The four types of plugins (collectors, processors, publishers and streaming collectors) allow Snap to mix and match functionality based on user need. All plugins are designed with versioning, signing and deployment at scale in mind. The **open plugin model** allows for loading built-in, community, or proprietary plugins into Snap. * **Collectors** - Collectors gather telemetry data at determined interval. Collectors are plugins for leveraging existing telemetry solutions (Facter, CollectD, Ohai) as well as specific plugins for consuming Intel telemetry (Node, DCM, NIC, Disk) and can reach into new architectures through additional plugins (see [Plugin Authoring below](#author-a-plugin)). Telemetry data is organized into a dynamically generated catalog of available data points. * **Processors** - Extensible workflow injection. Convert telemetry into another data model for consumption by existing systems. Allows encryption of all or part of the telemetry payload before publishing. Inject remote queries into workflow for tokens, filtering, or other external calls. Implement filtering at an agent level reducing injection load on telemetry consumer. * **Publishers** - Store telemetry into a wide array of systems. Snap decouples the collection of telemetry from the implementation of where to send it. Snap comes with a large library of publisher plugins that allow exposure to telemetry analytics systems both custom and common. This flexibility allows Snap to be valuable to open source and commercial ecosystems alike by writing a publisher for their architectures. * **Streaming Collectors** - Streaming collectors act just like collectors, but there is no determined interval of gathering metrics. They send metrics immediately when they are available over a GRPC to Snap daemon. There is also available mechanism of buffering incoming metrics configurable by params MaxMetricsBuffer and MaxCollectDuration. Check out [STREAMING.md](/docs/STREAMING.md) for more details. * **Dynamic Updates**: Snap is designed to evolve. Each scheduled workflow automatically uses the most mature plugin for that step, unless the collection is pinned to a specific version (e.g. get `/intel/psutil/load/load1/v1`). Loading a new plugin automatically upgrades running workflows in tasks. Load plugins dynamically, without a restart to the service or server. This dynamically extends the metric catalog when loaded, giving access to new measurements immediately. Swapping a newer version plugin for an old one in a safe transaction. All of these behaviors allow for simple and secure bug fixes, security patching, and improving accuracy in production. * **Snap tribe**: Snap is designed for ease of administration. With Snap tribe, nodes work in groups (aka tribes). Requests are made through agreement- or task-based node groups, designed as a scalable gossip-based node-to-node communication process. Administrators can control all Snap nodes in a tribe agreement by messaging just one of them. There is auto-discovery of new nodes and import of tasks and plugins from nodes within a given tribe. It is cluster configuration management made simple. **Snap** is not intended to: * Operate as an analytics platform: the intention is to allow plugins for feeding those platforms * Compete with existing metric/monitoring/telemetry agents: Snap is simply a new option to use or reference ## Getting Started ### System Requirements Snap needs [Swagger for Go](https://github.com/go-swagger/go-swagger) installed to update OpenAPI specification file after successful build. Swagger will be installed automatically during build process (`make` or `make deps`). #### To install Swagger manually Using `go get` (recommended): ```sh go get -u github.com/go-swagger/go-swagger/cmd/swagger ``` From Debian package: ```sh echo "deb https://dl.bintray.com/go-swagger/goswagger-debian ubuntu main" | sudo tee -a /etc/apt/sources.list sudo apt-get update sudo apt-get install swagger ``` From GitHub release: ```sh curl -LO https://github.com/go-swagger/go-swagger/releases/download/0.10.0/swagger_linux_amd64 chmod +x swagger_linux_amd64 && sudo mv swagger_linux_amd64 /usr/bin/swagger ``` Snap does not have external dependencies since it is compiled into a statically linked binary. At this time, we build Snap binaries for Linux and MacOS. We also provide Linux RPM/Deb packages and MacOS X .pkg installer. ### Installation You can obtain Linux RPM/Deb packages from [Snap's packagecloud.io repository](https://packagecloud.io/intelsdi-x/snap). After installation, please check and ensure `/usr/local/bin:/usr/local/sbin` is in your path via `echo $PATH` before executing any Snap commands. RedHat 6/7: ``` $ curl -s https://packagecloud.io/install/repositories/intelsdi-x/snap/script.rpm.sh | sudo bash $ sudo yum install -y snap-telemetry ``` Ubuntu 14.04/16.04 (see known issue with Ubuntu 16.04.1 below) ``` $ curl -s https://packagecloud.io/install/repositories/intelsdi-x/snap/script.deb.sh | sudo bash $ sudo apt-get install -y snap-telemetry ``` We only build and test packages for a limited set of Linux distributions. For distros that are compatible with RedHat/Ubuntu packages, you can use the environment variable `os=` and `dist=` to override the OS detection script. For example Linux Mint 17/17.* (use `dist=xenial` for Linux Mint 18/18.*): ``` $ curl -s https://packagecloud.io/install/repositories/intelsdi-x/snap/script.deb.sh | sudo os=ubuntu dist=trusty bash $ sudo apt-get install -y snap-telemetry ``` MacOS X: If you use homebrew, the latest version of Snap package: [](http://brew.sh/) ``` $ brew install snap-telemetry ``` If you do not use homebrew, download and install Mac pkg package: ``` $ curl -sfL mac.pkg.dl.snap-telemetry.io -o snap-telemetry.pkg $ sudo installer -pkg ./snap-telemetry.pkg -target / ``` Tarball (choose the appropriate version and platform): ``` $ curl -sfL linux.tar.dl.snap-telemetry.io -o snap-telemetry.tar.gz $ tar xf snap-telemetry.tar.gz $ cp snapteld /usr/local/sbin $ cp snaptel /usr/local/bin ``` The intelsdi-x package repo contains additional information regarding: * [Snap Redhat/Ubuntu packages](https://packagecloud.io/intelsdi-x/snap) * [Snap `.tar.gz` bundles and MacOS `.pkg` installer](https://github.com/intelsdi-x/snap/releases). * [installation script](https://packagecloud.io/intelsdi-x/snap/install#bash) * [manual installation steps](https://packagecloud.io/intelsdi-x/snap/install#manual) * [repo mirroring](https://packagecloud.io/intelsdi-x/snap/mirror) NOTE: snap-telemetry packages prior to 0.19.0 installed `/usr/local/bin/{snapctl|snapd}` and these binaries have been renamed to `snaptel` and `snapteld`. snap-telemetry packages prior to 0.18.0 symlinked `/usr/bin/{snapctl|snapd}` to `/opt/snap/bin/{snapctl|snapd}` and may cause conflicts with [Ubuntu's `snapd` package](http://packages.ubuntu.com/xenial-updates/snapd). Ubuntu 16.04.1 [snapd package version 2.13+](https://launchpad.net/ubuntu/+source/snapd) installs snapd/snapctl binary in /usr/bin. These executables are not related to snap-telemetry. Running `snapctl` from snapd package will result in the following error message: ``` $ snapctl error: snapctl requires SNAP_CONTEXT environment variable ``` NOTE: If you prefer to build from source, follow the steps in the [build documentation](docs/BUILD_AND_TEST.md). The _alpha_ binaries containing the latest master branch are available here for bleeding edge testing purposes: * snapteld: [linux](http://snap.ci.snap-telemetry.io/snap/latest_build/linux/x86_64/snapteld) | [darwin](http://snap.ci.snap-telemetry.io/snap/latest_build/darwin/x86_64/snapteld) * snaptel: [linux](http://snap.ci.snap-telemetry.io/snap/latest_build/linux/x86_64/snaptel) | [darwin](http://snap.ci.snap-telemetry.io/snap/latest_build/darwin/x86_64/snaptel) ### Running Snap If you installed Snap from RPM/Deb package, you can start/stop Snap daemon as a service: RedHat 6/Ubuntu 14.04: ``` $ service snap-telemetry start ``` RedHat 7/Ubuntu 16.04: ``` $ systemctl start snap-telemetry ``` If you installed Snap from binary, you can start Snap daemon via the command: ``` $ sudo mkdir -p /var/log/snap $ sudo snapteld --plugin-trust 0 --log-level 1 --log-path /var/log/snap & ``` To view the service logs: ``` $ tail -f /var/log/snap/snapteld.log ``` By default, Snap daemon will be running in standalone mode and listening on port 8181. To enable gossip mode, checkout the [tribe documentation](docs/TRIBE.md). For additional configuration options such as plugin signing and port configuration see [snapteld documentation](docs/SNAPTELD.md). ### Load Plugins Snap gets its power from the use of plugins. The [plugin catalog](#plugin-catalog) contains a collection of all known Snap plugins with links to their repo and release pages. First, let's download the file and psutil plugins (also make sure [psutil is installed](https://github.com/giampaolo/psutil/blob/master/INSTALL.rst)): ``` $ export OS=$(uname -s | tr '[:upper:]' '[:lower:]') $ export ARCH=$(uname -m) $ curl -sfL "https://github.com/intelsdi-x/snap-plugin-publisher-file/releases/download/2/snap-plugin-publisher-file_${OS}_${ARCH}" -o snap-plugi
No open issues yet, or sync has not completed.