Kapacitor

Kapacitor is a real-time streaming data processing engine.

Kapacitor is a native data processing engine for InfluxDB 1.x and is an integrated component in the InfluxDB 2.0 platform.Kapacitor can process both stream and batch data from InfluxDB, acting on this data in real-time via its programming language TICKscript. 

This article describes collection of metrics from AWS Cloudwatch through Telegraf(a plugin-driven server agent for collecting and reporting metrics for all kinds of data), storing in InfluxDB ,analysing to detect anomalies and raise alerts and visualising using Chronograf.

Key features of Kapacitor

  • Process both streaming data and batch data.
  • Query data from InfluxDB on a schedule, and receive data via the line protocol and any other method InfluxDB supports.
  • Perform any transformation currently possible in InfluxQL.
  • Store transformed data back in InfluxDB.
  • Add custom user defined functions to detect anomalies.
  • Integrate with HipChat, OpsGenie, Alerta, Sensu, PagerDuty, Slack, and more.

Networking

Kapacitor listens on TCP port 9092 for all API and write calls.

Installation

Kapacitor has two binaries:

  • kapacitor: a CLI program for calling the Kapacitor API.
  • kapacitord: the Kapacitor server daemon.

The quickest way to start using the InfluxB 1.x platform (TICK stack) OSS is to download and deploy the InfluxData Sandbox. The InfluxData Sandbox uses Docker containers to deploy the InfluxData Platform components. The InfluxData Sandbox provides a containerized, ready-to-use TICK stack, built using Dockerand Docker Compose, to capture data from your local machine and the Docker containers.

Download and run Sandbox

git clone https://github.com/influxdata/sandbox.git

cd sandbox            #cd into the sandbox directory

Once started, Chronograf tab will open in your browser at localhost:8888.

Chronograf

Chronograf is the web-based user interface for the TICK stack and can be used to:

Configuration

1. Telegraf

#on cd into sandbox directory

cd telegraf

vi telegraf.conf  #Edit telegraf.cong file

Add Amazon CloudWatch Statistics Input Plugin

[[inputs.cloudwatch]]

 region = “AWS_REGION”

 access_key = “AWS_ACCESS_KEY”

 secret_key = “AWS_SECRET_KEY”

 period = “5m”

 delay = “5m”

 interval = “5m”

 namespace = “AWS_NAMESPACE” #Ex: AWS/ELB

 [[inputs.cloudwatch.metrics]]

   names = [“Latency”] #list of specific metrics to collect.

2. Kapacitor

#on cd into sandbox directory

cd kapacitor

cd config

vi kapacitor.conf  #Edit kapacitor.conf file

Kapacitor integrates with multiple event handlers like HipChat, OpsGenie, Alerta, Sensu, PagerDuty, Slack, and more.

To configure Slack event handler:

[slack]

 enabled = true

 url = “SLACK_WEBHOOK_URL”

 channel = “CHANNEL_NAME”

 username = “kapacitor”

 icon-emoji = “”

 global = false

 state-changes-only = false

Once the tools have been configured, cd into root directory.The Sandbox repo includes a sandbox binary used to provision and manage the Sandbox’s containers and data.

Information Source – https://medium.com/@solve_today/getting-started-with-kapacitor-7b120fa1de78

CONTACT US