If you choose to send your metrics to Anodot using a relay system, you can use the Anodot Relay.
The Anodot Relay is in charge of sending all metrics to Anodot through the API. Sending metrics to the Anodot Relay is accomplished using the Graphite protocol (line or pickle). The following steps explain how to:
Installing the Anodot Relay
The relay is the component that sends the metrics from your environment to Anodot.
There are three options for installing the Anodot Relay:
- Using Docker:
Follow the instructions in:
- Using Chef recipe:
Follow the instructions to download, configure and run the recipe in your Chef environment:
https://github.com/anodot/cookbook-anodot-relay - Manual installation:
- Install nodejs (version >= 0.10.x )
- Make sure npm is version >= 1.4.x
- Install relay:
sudo npm install anodot-relay forever –g
- Copy the json. See https://www.npmjs.org/package/anodot-relay.
- Set your Anodot token in the json file.
- Run Anodot-relay:
"forever start -a /usr/lib/node_modules/anodot-relay/bin/relay config.json"
Examples
Manual installation example on Ubuntu 12:
"curl -sL https://deb.nodesource.com/setup | sudo bash -
sudo apt-get install nodejs
sudo npm install anodot-relay forever –g"
Edit "config.json" and add your token:<p//>
"vi /usr/lib/node_modules/anodot-relay/bin/config.json"
Run relay:
"forever start -a /usr/lib/node_modules/anodot-relay/bin/relay /usr/lib/node_modules/anodot-relay/bin/config.json"
Manual installation example on Ubuntu 14:
"sudo apt-get update
sudo apt-get install nodejs nodejs-legacy npm
sudo npm install anodot-relay forever –g"
Edit config.json and add your token:
"vi /usr/local/lib/node_modules/anodot-relay/bin/config.json"
Run relay:
"forever start -a /usr/local/lib/node_modules/anodot-relay/bin/relay /usr/local/lib/node_modules/anodot-relay/bin/config.json"
Manual installation example on Centos 6.5:
"curl -sL https://rpm.nodesource.com/setup | sudo bash -
sudo yum install -y nodejs
sudo apt-get install nodejs nodejs-legacy npm
sudo npm install anodot-relay forever –g"
Edit "config.json" and add your token:
"vi /usr/lib/node_modules/anodot-relay/bin/config.json"
Run relay:
"forever start -a /usr/lib/node_modules/anodot-relay/bin/relay /usr/lib/node_modules/anodot-relay/bin/config.json"
Notes:
- For all options, your Anodot provided API token should be inserted into the "config.json" file: "token": "<YOUR API TOKEN>". The API token can be found on the main Anodot Navigation panel. See also Token Management.
- The Docker and manual options should be configured to run as a service (e.g., upstart, runit) so that the Anodot-Relay will start automatically in case of host restarts. For Docker you can use the restart policy option at https://docs.docker.com/engine/reference/run/#restart-policies-restart.
Sending the Metrics to Anodot Relay
We split the setup of sending metrics to the Anodot relay to two cases:
- The first is if you already have Graphite installed and collecting metrics in your environment.
- The second is when you do not have Graphite where metrics will be sent directly from the collection agent(s) you already have.
Note: If you cannot use Graphite compatible agents, send metrics directly to Anodot. See Metrics 1.0 Protocol definitions.
Case 1: Graphite installed in your environment:
Architecture when graphite is installed
Notes:
- The carbon-relay and carbon-cache are part of the Graphite package.
- All three components can be installed on the same machine depending on the load.
Post-Installation
After installing the Anodot relay, there are several simple configuration changes required to graphite for duplicating the metrics to the Anodot relay:
- Changes to "carbon.conf":
- Change the default carbon-cache port to something else (e.g. to 2103, 2104 from 2003, 2004):
LINE_RECEIVER_PORT = 2103
PICKLE_RECEIVER_PORT = 2104 - Change the relay ports to continue receive metrics from your application
[relay]
LINE_RECEIVER_PORT = 2003
PICKLE_RECEIVER_PORT = 2004 - Update destinations: Put the Anodot relay IP address and port as another destination. Update the port for the carbon cache to the new port configured in step 1.
DESTINATIONS = [CARBON CACHE IP]:[PICKLE CARBON CACHE PORT]:a, [ANODOT RELAY IP]:[ANODOT RELAY PORT]:b
IMPORTANT: When the Anodot relay is installed on the same machine as the carbon-cache and shares the same IP, change the Anodot relay port to a free one in the config.json file of the Anodot relay.
2. Changes to "relay-rules.conf":
- Create the "relay-rules.conf" file if it does not exist: It can be copied from the' relay-rules.conf.example" file under "$graphiteintallpath/graphite/conf/".
- Change the destinations to point both the local carbon cache and to the Anodot relay:
[default]
default = true
destinations = = [CARBON CACHE IP]:[PICKLE CARBON CACHE PORT]:a, [ANODOT RELAY IP]:[ANODOT RELAY PORT]:b
3. Restart carbon-cache and carbon relay.
Case 2: Send directly from your agent (e.g., collectd, Coda Hale metrics)
- Verify that your agent supports sending metrics in the graphite protocol (pickle or line), and set it up to send metrics to graphite.
- Set the IP address and port of the Anodot relay as the graphite destination.
Instructions on how to set up agents to send metrics to graphite can be found for each agent. For example:
- Collectd: https://collectd.org/wiki/index.php/Plugin:Write_Graphite
- Cookbook for installing collectd: https://github.com/hectcastro/chef-collectd
- Coda Hale Metrics: https://dropwizard.github.io/metrics/3.1.0/manual/graphite
- From logs to metrics via Logstash: http://logstash.net/docs/1.4.2/outputs/graphite
- Nagios: If you have Nagios, you can send metrics to our relay using: https://github.com/shawn-sterling/graphios
Post-installation
After you install the relay and point metrics to it, verify that metrics are being sent to Anodot by logging into your Anodot account, navigate to Metrics search and type * (asterisk) in the search box. You should be able to see how many metrics have already been processed by Anodot and view their charts.
If you cannot see your metrics after a few minutes, contact Anodot support.