SlideShare ist ein Scribd-Unternehmen logo
1 von 29
Downloaden Sie, um offline zu lesen
Getting Started Series:
Introduction to Kapacito
© 2017 InfluxData. All rights reserved.2
Agenda
¨ What is Kapacitor
¨ How to Install it
¨ Understand TICKscript
¨ Quoting rules
¨ Create Stream Tasks
¨ Triggering alerts
¨ Create Batch Tasks
¨ Understand Batch vs Stream
¨ Use Kapacitor as a CQ engine
© 2017 InfluxData. All rights reserved.3
Key
Kapacitor
Capabilities
1
2
Alerting
Processing
ETL jobs
© 2017 InfluxData. All rights reserved.4
What is it?
¨ Native data processing engine
¨ Process stream and batch data from
InfluxDB
¨ Generates Alerts on dynamic criteria
¨ match metrics for patterns
¨ compute statistical anomalies
¨ perform specific actions
¨ Integrates with 15+ Alert Providers
¨ OpsGenie
¨ Sensu
¨ PagerDuty
¨ Slack
¨ and more.
© 2017 InfluxData. All rights reserved.5
Install
© 2017 InfluxData. All rights reserved.7
Installation
¨ Download
¨ GitHub
¨ https://portal.influxdata.com/downloads
¨ Pick your favorite package
¨ Install
© 2017 InfluxData. All rights reserved.8
Kapacitor Design
Server Daemon (kapacitord)
● Config for
inputs/outputs/services/ etc.
Tasks - units of work
● Defined by a TICKscript
● Stream or Batch
● DAG - pipeline
CLI (kapacitor)
● Calls for HTTP API or server
● Not interactive
Recordings - saved data
● Useful for isolated testing
Templates -
● Building many instances of a
templated task
Topics & topics handlers
● Generic rules for all alters
Defining Tasks
© 2017 InfluxData. All rights reserved.10
TICKScript
var measurement = 'requests'
var data = stream
|from()
.measurement(measurement)
|where(lambda: "is_up" == TRUE)
|where(lambda: "my_field" > 10)
|window()
.period(5m)
.every(5m)
// Count number of points in window
data
|count('value')
.as('the_count')
// Compute mean of data window
data
|mean('value')
.as('the_average')
● Chain invocation language
○ | chains together different nodes
○ . refers to specific attributes on a node
● Variables refer to values
○ Strings
○ Ints, Floats
○ Durations
○ Pipelines
© 2017 InfluxData. All rights reserved.11
TICKScript Syntax - Quoting Rules
// ' means the use the literal string value
var measurement = 'requests'
var data = stream
|from()
.measurement(measurement)
// " means use the reference value
|where(lambda: "is_up" == TRUE)
|where(lambda: "my_field" > 10)
|window()
.period(5m)
.every(5m)
// ' means the use the literal string value
data
|count('value')
.as('the_count')
● Double Quotes
○ References data in lambda expression
● Single Quotes
○ Literal String value
© 2017 InfluxData. All rights reserved.12
Create a Stream TICKscript
// cpu.tick
stream
|from()
.measurement('cpu')
|log()
● Logs all data from the measurement cpu
© 2017 InfluxData. All rights reserved.13
Create a Stream Task
$ kapacitor define cpu 
-tick cpu.tick 
-type stream 
-dbrp telegraf.autogen
// cpu.tick
stream
|from()
.measurement('cpu')
|log()
© 2017 InfluxData. All rights reserved.14
Show a Stream Task
$ kapacitor define cpu 
-tick cpu.tick 
-type stream 
-dbrp telegraf.autogen
$ kapacitor enable cpu
$ kapacitor show cpu
ID: cpu
Error:
Template:
Type: stream
Status: enabled
Executing: true
Created: 10 Oct 17 16:05 EDT
Modified: 10 Oct 17 16:05 EDT
LastEnabled: 01 Jan 01 00:00 UTC
Databases Retention Policies: ["telegraf"."autogen"]
TICKscript:
// cpu.tick
stream
|from()
.measurement('cpu')
|log()
DOT:
digraph cpu {
stream0 -> from1;
from1 -> log2;
}
© 2017 InfluxData. All rights reserved.15
Create a More Interesting Stream TICKscript
// cpu.tick
stream
|from()
.measurement('cpu')
|window()
.period(5m)
.every(1m)
|mean('usage_user')
.as('mean_usage_user')
|log()
● Create 5m windows of data that emit every 1m
● Compute the average of the field usage_user
● Log the result
© 2017 InfluxData. All rights reserved.16
An even more interesting TICKscript
// cpu.tick
stream
|from()
.measurement('cpu')
|where(lambda: "cpu" == 'cpu-total')
|window()
.period(5m)
.every(1m)
|mean('usage_user')
.as('mean_usage_user')
|log()
● Filter on the tag cpu=cpu-total
● Create 5m windows of data that emit every 1m
● Compute the average of the field usage_user
● Log the result
© 2017 InfluxData. All rights reserved.17
Adding Alerts
// cpu.tick
stream
|from()
.measurement('cpu')
|where(lambda: "cpu" == 'cpu-total')
|window()
.period(5m)
.every(1m)
|mean('usage_user')
.as('mean_usage_user')
|alert()
.crit(lambda: "mean_usage_user" > 80)
.message('cpu usage high!')
.slack()
.channel('alerts')
.email('oncall@example.com')
● Filter on the tag cpu=cpu-total
● Create 5m windows of data that emit every 1m
● Compute the average of the field usage_user
● Alert when mean_usage_user > 80
● Send alert to
○ Slack channel alerts
○ Email oncall@example.com
© 2017 InfluxData. All rights reserved.18
Create a Batch TICKscript
// batch_cpu.tick
batch
|query('''
SELECT mean("usage_user") AS mean_usage_user
FROM "telegraf"."autogen"."cpu"
''')
.period(5m)
.every(1m)
|log()
● Query 5m windows of data every 1m
● Compute the average of the field usage_user
● Log the result
© 2017 InfluxData. All rights reserved.19
Create a Stream Task
$ kapacitor define batch_cpu 
-tick batch_cpu.tick 
-type batch 
-dbrp telegraf.autogen
// cpu.tick
stream
|from()
.measurement('cpu')
|log()
// batch_cpu.tick
batch
|query('''
SELECT mean("usage_user") AS mean_usage_user
FROM "telegraf"."autogen"."cpu"
''')
.period(5m)
.every(1m)
|log()
© 2017 InfluxData. All rights reserved.20
Create a Batch TICKscript
// batch_cpu.tick
batch
|query('''
SELECT mean("usage_user") AS mean_usage_user
FROM "telegraf"."autogen"."cpu"
''')
.period(5m)
.every(1m)
|alert()
.crit(lambda: "mean_usage_user" > 80)
.message('cpu usage high!')
.slack()
.channel('alerts')
.email('oncall@example.com')
● Query 5m windows of data every 1m
● Compute the average of the field usage_user
● Alert when mean_usage_user > 80
● Send alert to
○ Slack channel alerts
○ Email oncall@example.com
© 2017 InfluxData. All rights reserved.21
Batching Streaming
● Queries InfluxDB periodically
● Does not buffer as much of data
in RAM
● Places additional query load on
InfluxDB
● Writes are mirrored onto the
InfluxDB instance
● Buffers all data in RAM
● Places additional write load on
Kapacitor
Using Kapacitor for
Downsampling
© 2017 InfluxData. All rights reserved.23
¨ Computing the average, max, min, etc of a window of data for a particular series
¨
What is Downsampling?
Downsampling is the process of reducing a sequence of points in a series to a single
data point
© 2017 InfluxData. All rights reserved.24
¨ Faster queries
¨ Store less data
Why Downsample?
© 2017 InfluxData. All rights reserved.25
¨ Create a task that aggregates your data
¨ Can be stream or batch depending on your use-case
¨ Writes data back into InfluxDB
¨ Typically back into another retention policy
Downsample using Kapacitor
Offload computation to a separate host
© 2017 InfluxData. All rights reserved.26
Example
// batch_cpu.tick
batch
|query('''
SELECT mean("usage_user") AS usage_user
FROM "telegraf"."autogen"."cpu"
''')
.period(5m)
.every(5m)
|influxDBOut()
.database('telegraf')
.retenionPolicy('5m')
.tag('source', 'kapacitor')
● Downsample the data into 5m windows
● Store that data back into a the 5m retention
policy in the telegraf database
© 2017 InfluxData. All rights reserved.27
Batching Streaming
● Queries InfluxDB periodically
● Does not buffer as much of data
in RAM
● Places additional query load on
InfluxDB
● Writes are mirrored onto the
InfluxDB instance
● Buffers all data in RAM
● Places additional write load on
Kapacitor
Questions?
Thank you

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (20)

InfluxData Platform Future and Vision
InfluxData Platform Future and VisionInfluxData Platform Future and Vision
InfluxData Platform Future and Vision
 
WRITING QUERIES (INFLUXQL AND TICK)
WRITING QUERIES (INFLUXQL AND TICK)WRITING QUERIES (INFLUXQL AND TICK)
WRITING QUERIES (INFLUXQL AND TICK)
 
InfluxDB IOx Tech Talks: A Rusty Introduction to Apache Arrow and How it App...
InfluxDB IOx Tech Talks:  A Rusty Introduction to Apache Arrow and How it App...InfluxDB IOx Tech Talks:  A Rusty Introduction to Apache Arrow and How it App...
InfluxDB IOx Tech Talks: A Rusty Introduction to Apache Arrow and How it App...
 
Optimizing InfluxDB Performance in the Real World | Sam Dillard | InfluxData
Optimizing InfluxDB Performance in the Real World | Sam Dillard | InfluxDataOptimizing InfluxDB Performance in the Real World | Sam Dillard | InfluxData
Optimizing InfluxDB Performance in the Real World | Sam Dillard | InfluxData
 
InfluxDB 101 - Concepts and Architecture | Michael DeSa | InfluxData
InfluxDB 101 - Concepts and Architecture | Michael DeSa | InfluxDataInfluxDB 101 - Concepts and Architecture | Michael DeSa | InfluxData
InfluxDB 101 - Concepts and Architecture | Michael DeSa | InfluxData
 
Meet the Experts: InfluxDB Product Update
Meet the Experts: InfluxDB Product UpdateMeet the Experts: InfluxDB Product Update
Meet the Experts: InfluxDB Product Update
 
Setting up InfluxData for IoT
Setting up InfluxData for IoTSetting up InfluxData for IoT
Setting up InfluxData for IoT
 
INFLUXQL & TICKSCRIPT
INFLUXQL & TICKSCRIPTINFLUXQL & TICKSCRIPT
INFLUXQL & TICKSCRIPT
 
Virtual training optimizing the tick stack
Virtual training  optimizing the tick stackVirtual training  optimizing the tick stack
Virtual training optimizing the tick stack
 
InfluxDB & Kubernetes
InfluxDB & KubernetesInfluxDB & Kubernetes
InfluxDB & Kubernetes
 
Meet the Experts: Visualize Your Time-Stamped Data Using the React-Based Gira...
Meet the Experts: Visualize Your Time-Stamped Data Using the React-Based Gira...Meet the Experts: Visualize Your Time-Stamped Data Using the React-Based Gira...
Meet the Experts: Visualize Your Time-Stamped Data Using the React-Based Gira...
 
DOWNSAMPLING DATA
DOWNSAMPLING DATADOWNSAMPLING DATA
DOWNSAMPLING DATA
 
Observability of InfluxDB IOx: Tracing, Metrics and System Tables
Observability of InfluxDB IOx: Tracing, Metrics and System TablesObservability of InfluxDB IOx: Tracing, Metrics and System Tables
Observability of InfluxDB IOx: Tracing, Metrics and System Tables
 
tado° Makes Your Home Environment Smart with InfluxDB
tado° Makes Your Home Environment Smart with InfluxDBtado° Makes Your Home Environment Smart with InfluxDB
tado° Makes Your Home Environment Smart with InfluxDB
 
Introduction to InfluxDB
Introduction to InfluxDBIntroduction to InfluxDB
Introduction to InfluxDB
 
Downsampling your data October 2017
Downsampling your data October 2017Downsampling your data October 2017
Downsampling your data October 2017
 
Time series denver an introduction to prometheus
Time series denver   an introduction to prometheusTime series denver   an introduction to prometheus
Time series denver an introduction to prometheus
 
Extending Flux to Support Other Databases and Data Stores | Adam Anthony | In...
Extending Flux to Support Other Databases and Data Stores | Adam Anthony | In...Extending Flux to Support Other Databases and Data Stores | Adam Anthony | In...
Extending Flux to Support Other Databases and Data Stores | Adam Anthony | In...
 
Write your own telegraf plugin
Write your own telegraf pluginWrite your own telegraf plugin
Write your own telegraf plugin
 
Obtaining the Perfect Smoke By Monitoring Your BBQ with InfluxDB and Telegraf
Obtaining the Perfect Smoke By Monitoring Your BBQ with InfluxDB and TelegrafObtaining the Perfect Smoke By Monitoring Your BBQ with InfluxDB and Telegraf
Obtaining the Perfect Smoke By Monitoring Your BBQ with InfluxDB and Telegraf
 

Ähnlich wie Virtual training Intro to Kapacitor

Ähnlich wie Virtual training Intro to Kapacitor (20)

Intro to Kapacitor for Alerting and Anomaly Detection
Intro to Kapacitor for Alerting and Anomaly DetectionIntro to Kapacitor for Alerting and Anomaly Detection
Intro to Kapacitor for Alerting and Anomaly Detection
 
Monitoring InfluxEnterprise
Monitoring InfluxEnterpriseMonitoring InfluxEnterprise
Monitoring InfluxEnterprise
 
Virtual training Intro to InfluxDB & Telegraf
Virtual training  Intro to InfluxDB & TelegrafVirtual training  Intro to InfluxDB & Telegraf
Virtual training Intro to InfluxDB & Telegraf
 
Lessons Learned Running InfluxDB Cloud and Other Cloud Services at Scale by T...
Lessons Learned Running InfluxDB Cloud and Other Cloud Services at Scale by T...Lessons Learned Running InfluxDB Cloud and Other Cloud Services at Scale by T...
Lessons Learned Running InfluxDB Cloud and Other Cloud Services at Scale by T...
 
Beyond Breakpoints: A Tour of Dynamic Analysis
Beyond Breakpoints: A Tour of Dynamic AnalysisBeyond Breakpoints: A Tour of Dynamic Analysis
Beyond Breakpoints: A Tour of Dynamic Analysis
 
Accelerating Spark MLlib and DataFrame with Vector Processor “SX-Aurora TSUBASA”
Accelerating Spark MLlib and DataFrame with Vector Processor “SX-Aurora TSUBASA”Accelerating Spark MLlib and DataFrame with Vector Processor “SX-Aurora TSUBASA”
Accelerating Spark MLlib and DataFrame with Vector Processor “SX-Aurora TSUBASA”
 
Fabric - Realtime stream processing framework
Fabric - Realtime stream processing frameworkFabric - Realtime stream processing framework
Fabric - Realtime stream processing framework
 
Statsd introduction
Statsd introductionStatsd introduction
Statsd introduction
 
LSFMM 2019 BPF Observability
LSFMM 2019 BPF ObservabilityLSFMM 2019 BPF Observability
LSFMM 2019 BPF Observability
 
IBM Monitoring and Diagnostic Tools - GCMV 2.8
IBM Monitoring and Diagnostic Tools - GCMV 2.8IBM Monitoring and Diagnostic Tools - GCMV 2.8
IBM Monitoring and Diagnostic Tools - GCMV 2.8
 
Samantha Wang [InfluxData] | Best Practices on How to Transform Your Data Usi...
Samantha Wang [InfluxData] | Best Practices on How to Transform Your Data Usi...Samantha Wang [InfluxData] | Best Practices on How to Transform Your Data Usi...
Samantha Wang [InfluxData] | Best Practices on How to Transform Your Data Usi...
 
Use C++ and Intel® Threading Building Blocks (Intel® TBB) for Hardware Progra...
Use C++ and Intel® Threading Building Blocks (Intel® TBB) for Hardware Progra...Use C++ and Intel® Threading Building Blocks (Intel® TBB) for Hardware Progra...
Use C++ and Intel® Threading Building Blocks (Intel® TBB) for Hardware Progra...
 
How to make a high-quality Node.js app, Nikita Galkin
How to make a high-quality Node.js app, Nikita GalkinHow to make a high-quality Node.js app, Nikita Galkin
How to make a high-quality Node.js app, Nikita Galkin
 
Using eBPF to Measure the k8s Cluster Health
Using eBPF to Measure the k8s Cluster HealthUsing eBPF to Measure the k8s Cluster Health
Using eBPF to Measure the k8s Cluster Health
 
P4 Introduction
P4 Introduction P4 Introduction
P4 Introduction
 
10 things i wish i'd known before using spark in production
10 things i wish i'd known before using spark in production10 things i wish i'd known before using spark in production
10 things i wish i'd known before using spark in production
 
Finding OOMS in Legacy Systems with the Syslog Telegraf Plugin
Finding OOMS in Legacy Systems with the Syslog Telegraf PluginFinding OOMS in Legacy Systems with the Syslog Telegraf Plugin
Finding OOMS in Legacy Systems with the Syslog Telegraf Plugin
 
Getting Started: Intro to Telegraf - July 2021
Getting Started: Intro to Telegraf - July 2021Getting Started: Intro to Telegraf - July 2021
Getting Started: Intro to Telegraf - July 2021
 
Jacob Marble [InfluxData] | Observability with InfluxDB IOx and OpenTelemetry...
Jacob Marble [InfluxData] | Observability with InfluxDB IOx and OpenTelemetry...Jacob Marble [InfluxData] | Observability with InfluxDB IOx and OpenTelemetry...
Jacob Marble [InfluxData] | Observability with InfluxDB IOx and OpenTelemetry...
 
Elastic Stack @ Swisscom Application Cloud
Elastic Stack @ Swisscom Application CloudElastic Stack @ Swisscom Application Cloud
Elastic Stack @ Swisscom Application Cloud
 

Mehr von InfluxData

How Teréga Replaces Legacy Data Historians with InfluxDB, AWS and IO-Base
How Teréga Replaces Legacy Data Historians with InfluxDB, AWS and IO-Base How Teréga Replaces Legacy Data Historians with InfluxDB, AWS and IO-Base
How Teréga Replaces Legacy Data Historians with InfluxDB, AWS and IO-Base
InfluxData
 
How Delft University's Engineering Students Make Their EV Formula-Style Race ...
How Delft University's Engineering Students Make Their EV Formula-Style Race ...How Delft University's Engineering Students Make Their EV Formula-Style Race ...
How Delft University's Engineering Students Make Their EV Formula-Style Race ...
InfluxData
 
Steinkamp, Clifford [InfluxData] | Welcome to InfluxDays 2022 - Day 2 | Influ...
Steinkamp, Clifford [InfluxData] | Welcome to InfluxDays 2022 - Day 2 | Influ...Steinkamp, Clifford [InfluxData] | Welcome to InfluxDays 2022 - Day 2 | Influ...
Steinkamp, Clifford [InfluxData] | Welcome to InfluxDays 2022 - Day 2 | Influ...
InfluxData
 
Steinkamp, Clifford [InfluxData] | Closing Thoughts Day 1 | InfluxDays 2022
Steinkamp, Clifford [InfluxData] | Closing Thoughts Day 1 | InfluxDays 2022Steinkamp, Clifford [InfluxData] | Closing Thoughts Day 1 | InfluxDays 2022
Steinkamp, Clifford [InfluxData] | Closing Thoughts Day 1 | InfluxDays 2022
InfluxData
 

Mehr von InfluxData (20)

Announcing InfluxDB Clustered
Announcing InfluxDB ClusteredAnnouncing InfluxDB Clustered
Announcing InfluxDB Clustered
 
Best Practices for Leveraging the Apache Arrow Ecosystem
Best Practices for Leveraging the Apache Arrow EcosystemBest Practices for Leveraging the Apache Arrow Ecosystem
Best Practices for Leveraging the Apache Arrow Ecosystem
 
How Bevi Uses InfluxDB and Grafana to Improve Predictive Maintenance and Redu...
How Bevi Uses InfluxDB and Grafana to Improve Predictive Maintenance and Redu...How Bevi Uses InfluxDB and Grafana to Improve Predictive Maintenance and Redu...
How Bevi Uses InfluxDB and Grafana to Improve Predictive Maintenance and Redu...
 
Power Your Predictive Analytics with InfluxDB
Power Your Predictive Analytics with InfluxDBPower Your Predictive Analytics with InfluxDB
Power Your Predictive Analytics with InfluxDB
 
How Teréga Replaces Legacy Data Historians with InfluxDB, AWS and IO-Base
How Teréga Replaces Legacy Data Historians with InfluxDB, AWS and IO-Base How Teréga Replaces Legacy Data Historians with InfluxDB, AWS and IO-Base
How Teréga Replaces Legacy Data Historians with InfluxDB, AWS and IO-Base
 
Build an Edge-to-Cloud Solution with the MING Stack
Build an Edge-to-Cloud Solution with the MING StackBuild an Edge-to-Cloud Solution with the MING Stack
Build an Edge-to-Cloud Solution with the MING Stack
 
Meet the Founders: An Open Discussion About Rewriting Using Rust
Meet the Founders: An Open Discussion About Rewriting Using RustMeet the Founders: An Open Discussion About Rewriting Using Rust
Meet the Founders: An Open Discussion About Rewriting Using Rust
 
Introducing InfluxDB Cloud Dedicated
Introducing InfluxDB Cloud DedicatedIntroducing InfluxDB Cloud Dedicated
Introducing InfluxDB Cloud Dedicated
 
Gain Better Observability with OpenTelemetry and InfluxDB
Gain Better Observability with OpenTelemetry and InfluxDB Gain Better Observability with OpenTelemetry and InfluxDB
Gain Better Observability with OpenTelemetry and InfluxDB
 
How a Heat Treating Plant Ensures Tight Process Control and Exceptional Quali...
How a Heat Treating Plant Ensures Tight Process Control and Exceptional Quali...How a Heat Treating Plant Ensures Tight Process Control and Exceptional Quali...
How a Heat Treating Plant Ensures Tight Process Control and Exceptional Quali...
 
How Delft University's Engineering Students Make Their EV Formula-Style Race ...
How Delft University's Engineering Students Make Their EV Formula-Style Race ...How Delft University's Engineering Students Make Their EV Formula-Style Race ...
How Delft University's Engineering Students Make Their EV Formula-Style Race ...
 
Introducing InfluxDB’s New Time Series Database Storage Engine
Introducing InfluxDB’s New Time Series Database Storage EngineIntroducing InfluxDB’s New Time Series Database Storage Engine
Introducing InfluxDB’s New Time Series Database Storage Engine
 
Start Automating InfluxDB Deployments at the Edge with balena
Start Automating InfluxDB Deployments at the Edge with balena Start Automating InfluxDB Deployments at the Edge with balena
Start Automating InfluxDB Deployments at the Edge with balena
 
Understanding InfluxDB’s New Storage Engine
Understanding InfluxDB’s New Storage EngineUnderstanding InfluxDB’s New Storage Engine
Understanding InfluxDB’s New Storage Engine
 
Streamline and Scale Out Data Pipelines with Kubernetes, Telegraf, and InfluxDB
Streamline and Scale Out Data Pipelines with Kubernetes, Telegraf, and InfluxDBStreamline and Scale Out Data Pipelines with Kubernetes, Telegraf, and InfluxDB
Streamline and Scale Out Data Pipelines with Kubernetes, Telegraf, and InfluxDB
 
Ward Bowman [PTC] | ThingWorx Long-Term Data Storage with InfluxDB | InfluxDa...
Ward Bowman [PTC] | ThingWorx Long-Term Data Storage with InfluxDB | InfluxDa...Ward Bowman [PTC] | ThingWorx Long-Term Data Storage with InfluxDB | InfluxDa...
Ward Bowman [PTC] | ThingWorx Long-Term Data Storage with InfluxDB | InfluxDa...
 
Scott Anderson [InfluxData] | New & Upcoming Flux Features | InfluxDays 2022
Scott Anderson [InfluxData] | New & Upcoming Flux Features | InfluxDays 2022Scott Anderson [InfluxData] | New & Upcoming Flux Features | InfluxDays 2022
Scott Anderson [InfluxData] | New & Upcoming Flux Features | InfluxDays 2022
 
Steinkamp, Clifford [InfluxData] | Closing Thoughts | InfluxDays 2022
Steinkamp, Clifford [InfluxData] | Closing Thoughts | InfluxDays 2022Steinkamp, Clifford [InfluxData] | Closing Thoughts | InfluxDays 2022
Steinkamp, Clifford [InfluxData] | Closing Thoughts | InfluxDays 2022
 
Steinkamp, Clifford [InfluxData] | Welcome to InfluxDays 2022 - Day 2 | Influ...
Steinkamp, Clifford [InfluxData] | Welcome to InfluxDays 2022 - Day 2 | Influ...Steinkamp, Clifford [InfluxData] | Welcome to InfluxDays 2022 - Day 2 | Influ...
Steinkamp, Clifford [InfluxData] | Welcome to InfluxDays 2022 - Day 2 | Influ...
 
Steinkamp, Clifford [InfluxData] | Closing Thoughts Day 1 | InfluxDays 2022
Steinkamp, Clifford [InfluxData] | Closing Thoughts Day 1 | InfluxDays 2022Steinkamp, Clifford [InfluxData] | Closing Thoughts Day 1 | InfluxDays 2022
Steinkamp, Clifford [InfluxData] | Closing Thoughts Day 1 | InfluxDays 2022
 

Kürzlich hochgeladen

一比一原版(Dundee毕业证书)英国爱丁堡龙比亚大学毕业证如何办理
一比一原版(Dundee毕业证书)英国爱丁堡龙比亚大学毕业证如何办理一比一原版(Dundee毕业证书)英国爱丁堡龙比亚大学毕业证如何办理
一比一原版(Dundee毕业证书)英国爱丁堡龙比亚大学毕业证如何办理
AS
 
Russian Escort Abu Dhabi 0503464457 Abu DHabi Escorts
Russian Escort Abu Dhabi 0503464457 Abu DHabi EscortsRussian Escort Abu Dhabi 0503464457 Abu DHabi Escorts
Russian Escort Abu Dhabi 0503464457 Abu DHabi Escorts
Monica Sydney
 
Abu Dhabi Escorts Service 0508644382 Escorts in Abu Dhabi
Abu Dhabi Escorts Service 0508644382 Escorts in Abu DhabiAbu Dhabi Escorts Service 0508644382 Escorts in Abu Dhabi
Abu Dhabi Escorts Service 0508644382 Escorts in Abu Dhabi
Monica Sydney
 
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girlsRussian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Monica Sydney
 
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
gajnagarg
 
一比一原版奥兹学院毕业证如何办理
一比一原版奥兹学院毕业证如何办理一比一原版奥兹学院毕业证如何办理
一比一原版奥兹学院毕业证如何办理
F
 
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdfpdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
JOHNBEBONYAP1
 
call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7
call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7
call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
一比一原版田纳西大学毕业证如何办理
一比一原版田纳西大学毕业证如何办理一比一原版田纳西大学毕业证如何办理
一比一原版田纳西大学毕业证如何办理
F
 

Kürzlich hochgeladen (20)

一比一原版(Dundee毕业证书)英国爱丁堡龙比亚大学毕业证如何办理
一比一原版(Dundee毕业证书)英国爱丁堡龙比亚大学毕业证如何办理一比一原版(Dundee毕业证书)英国爱丁堡龙比亚大学毕业证如何办理
一比一原版(Dundee毕业证书)英国爱丁堡龙比亚大学毕业证如何办理
 
Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...
Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...
Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...
 
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
 
💚 Call Girls Bahraich 9332606886 High Profile Call Girls You Can Get The S...
💚 Call Girls Bahraich   9332606886  High Profile Call Girls You Can Get The S...💚 Call Girls Bahraich   9332606886  High Profile Call Girls You Can Get The S...
💚 Call Girls Bahraich 9332606886 High Profile Call Girls You Can Get The S...
 
Local Call Girls in Seoni 9332606886 HOT & SEXY Models beautiful and charmin...
Local Call Girls in Seoni  9332606886 HOT & SEXY Models beautiful and charmin...Local Call Girls in Seoni  9332606886 HOT & SEXY Models beautiful and charmin...
Local Call Girls in Seoni 9332606886 HOT & SEXY Models beautiful and charmin...
 
Vip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac Room
Vip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac RoomVip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac Room
Vip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac Room
 
Russian Escort Abu Dhabi 0503464457 Abu DHabi Escorts
Russian Escort Abu Dhabi 0503464457 Abu DHabi EscortsRussian Escort Abu Dhabi 0503464457 Abu DHabi Escorts
Russian Escort Abu Dhabi 0503464457 Abu DHabi Escorts
 
Abu Dhabi Escorts Service 0508644382 Escorts in Abu Dhabi
Abu Dhabi Escorts Service 0508644382 Escorts in Abu DhabiAbu Dhabi Escorts Service 0508644382 Escorts in Abu Dhabi
Abu Dhabi Escorts Service 0508644382 Escorts in Abu Dhabi
 
Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoil
Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime NagercoilNagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoil
Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoil
 
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
 
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girlsRussian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
 
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
 
Call girls Service in Ajman 0505086370 Ajman call girls
Call girls Service in Ajman 0505086370 Ajman call girlsCall girls Service in Ajman 0505086370 Ajman call girls
Call girls Service in Ajman 0505086370 Ajman call girls
 
Local Call Girls in Gomati 9332606886 HOT & SEXY Models beautiful and charmi...
Local Call Girls in Gomati  9332606886 HOT & SEXY Models beautiful and charmi...Local Call Girls in Gomati  9332606886 HOT & SEXY Models beautiful and charmi...
Local Call Girls in Gomati 9332606886 HOT & SEXY Models beautiful and charmi...
 
一比一原版奥兹学院毕业证如何办理
一比一原版奥兹学院毕业证如何办理一比一原版奥兹学院毕业证如何办理
一比一原版奥兹学院毕业证如何办理
 
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdfpdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
 
call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7
call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7
call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7
 
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
 
APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53
 
一比一原版田纳西大学毕业证如何办理
一比一原版田纳西大学毕业证如何办理一比一原版田纳西大学毕业证如何办理
一比一原版田纳西大学毕业证如何办理
 

Virtual training Intro to Kapacitor

  • 2. © 2017 InfluxData. All rights reserved.2 Agenda ¨ What is Kapacitor ¨ How to Install it ¨ Understand TICKscript ¨ Quoting rules ¨ Create Stream Tasks ¨ Triggering alerts ¨ Create Batch Tasks ¨ Understand Batch vs Stream ¨ Use Kapacitor as a CQ engine
  • 3. © 2017 InfluxData. All rights reserved.3 Key Kapacitor Capabilities 1 2 Alerting Processing ETL jobs
  • 4. © 2017 InfluxData. All rights reserved.4 What is it? ¨ Native data processing engine ¨ Process stream and batch data from InfluxDB ¨ Generates Alerts on dynamic criteria ¨ match metrics for patterns ¨ compute statistical anomalies ¨ perform specific actions ¨ Integrates with 15+ Alert Providers ¨ OpsGenie ¨ Sensu ¨ PagerDuty ¨ Slack ¨ and more.
  • 5. © 2017 InfluxData. All rights reserved.5
  • 7. © 2017 InfluxData. All rights reserved.7 Installation ¨ Download ¨ GitHub ¨ https://portal.influxdata.com/downloads ¨ Pick your favorite package ¨ Install
  • 8. © 2017 InfluxData. All rights reserved.8 Kapacitor Design Server Daemon (kapacitord) ● Config for inputs/outputs/services/ etc. Tasks - units of work ● Defined by a TICKscript ● Stream or Batch ● DAG - pipeline CLI (kapacitor) ● Calls for HTTP API or server ● Not interactive Recordings - saved data ● Useful for isolated testing Templates - ● Building many instances of a templated task Topics & topics handlers ● Generic rules for all alters
  • 10. © 2017 InfluxData. All rights reserved.10 TICKScript var measurement = 'requests' var data = stream |from() .measurement(measurement) |where(lambda: "is_up" == TRUE) |where(lambda: "my_field" > 10) |window() .period(5m) .every(5m) // Count number of points in window data |count('value') .as('the_count') // Compute mean of data window data |mean('value') .as('the_average') ● Chain invocation language ○ | chains together different nodes ○ . refers to specific attributes on a node ● Variables refer to values ○ Strings ○ Ints, Floats ○ Durations ○ Pipelines
  • 11. © 2017 InfluxData. All rights reserved.11 TICKScript Syntax - Quoting Rules // ' means the use the literal string value var measurement = 'requests' var data = stream |from() .measurement(measurement) // " means use the reference value |where(lambda: "is_up" == TRUE) |where(lambda: "my_field" > 10) |window() .period(5m) .every(5m) // ' means the use the literal string value data |count('value') .as('the_count') ● Double Quotes ○ References data in lambda expression ● Single Quotes ○ Literal String value
  • 12. © 2017 InfluxData. All rights reserved.12 Create a Stream TICKscript // cpu.tick stream |from() .measurement('cpu') |log() ● Logs all data from the measurement cpu
  • 13. © 2017 InfluxData. All rights reserved.13 Create a Stream Task $ kapacitor define cpu -tick cpu.tick -type stream -dbrp telegraf.autogen // cpu.tick stream |from() .measurement('cpu') |log()
  • 14. © 2017 InfluxData. All rights reserved.14 Show a Stream Task $ kapacitor define cpu -tick cpu.tick -type stream -dbrp telegraf.autogen $ kapacitor enable cpu $ kapacitor show cpu ID: cpu Error: Template: Type: stream Status: enabled Executing: true Created: 10 Oct 17 16:05 EDT Modified: 10 Oct 17 16:05 EDT LastEnabled: 01 Jan 01 00:00 UTC Databases Retention Policies: ["telegraf"."autogen"] TICKscript: // cpu.tick stream |from() .measurement('cpu') |log() DOT: digraph cpu { stream0 -> from1; from1 -> log2; }
  • 15. © 2017 InfluxData. All rights reserved.15 Create a More Interesting Stream TICKscript // cpu.tick stream |from() .measurement('cpu') |window() .period(5m) .every(1m) |mean('usage_user') .as('mean_usage_user') |log() ● Create 5m windows of data that emit every 1m ● Compute the average of the field usage_user ● Log the result
  • 16. © 2017 InfluxData. All rights reserved.16 An even more interesting TICKscript // cpu.tick stream |from() .measurement('cpu') |where(lambda: "cpu" == 'cpu-total') |window() .period(5m) .every(1m) |mean('usage_user') .as('mean_usage_user') |log() ● Filter on the tag cpu=cpu-total ● Create 5m windows of data that emit every 1m ● Compute the average of the field usage_user ● Log the result
  • 17. © 2017 InfluxData. All rights reserved.17 Adding Alerts // cpu.tick stream |from() .measurement('cpu') |where(lambda: "cpu" == 'cpu-total') |window() .period(5m) .every(1m) |mean('usage_user') .as('mean_usage_user') |alert() .crit(lambda: "mean_usage_user" > 80) .message('cpu usage high!') .slack() .channel('alerts') .email('oncall@example.com') ● Filter on the tag cpu=cpu-total ● Create 5m windows of data that emit every 1m ● Compute the average of the field usage_user ● Alert when mean_usage_user > 80 ● Send alert to ○ Slack channel alerts ○ Email oncall@example.com
  • 18. © 2017 InfluxData. All rights reserved.18 Create a Batch TICKscript // batch_cpu.tick batch |query(''' SELECT mean("usage_user") AS mean_usage_user FROM "telegraf"."autogen"."cpu" ''') .period(5m) .every(1m) |log() ● Query 5m windows of data every 1m ● Compute the average of the field usage_user ● Log the result
  • 19. © 2017 InfluxData. All rights reserved.19 Create a Stream Task $ kapacitor define batch_cpu -tick batch_cpu.tick -type batch -dbrp telegraf.autogen // cpu.tick stream |from() .measurement('cpu') |log() // batch_cpu.tick batch |query(''' SELECT mean("usage_user") AS mean_usage_user FROM "telegraf"."autogen"."cpu" ''') .period(5m) .every(1m) |log()
  • 20. © 2017 InfluxData. All rights reserved.20 Create a Batch TICKscript // batch_cpu.tick batch |query(''' SELECT mean("usage_user") AS mean_usage_user FROM "telegraf"."autogen"."cpu" ''') .period(5m) .every(1m) |alert() .crit(lambda: "mean_usage_user" > 80) .message('cpu usage high!') .slack() .channel('alerts') .email('oncall@example.com') ● Query 5m windows of data every 1m ● Compute the average of the field usage_user ● Alert when mean_usage_user > 80 ● Send alert to ○ Slack channel alerts ○ Email oncall@example.com
  • 21. © 2017 InfluxData. All rights reserved.21 Batching Streaming ● Queries InfluxDB periodically ● Does not buffer as much of data in RAM ● Places additional query load on InfluxDB ● Writes are mirrored onto the InfluxDB instance ● Buffers all data in RAM ● Places additional write load on Kapacitor
  • 23. © 2017 InfluxData. All rights reserved.23 ¨ Computing the average, max, min, etc of a window of data for a particular series ¨ What is Downsampling? Downsampling is the process of reducing a sequence of points in a series to a single data point
  • 24. © 2017 InfluxData. All rights reserved.24 ¨ Faster queries ¨ Store less data Why Downsample?
  • 25. © 2017 InfluxData. All rights reserved.25 ¨ Create a task that aggregates your data ¨ Can be stream or batch depending on your use-case ¨ Writes data back into InfluxDB ¨ Typically back into another retention policy Downsample using Kapacitor Offload computation to a separate host
  • 26. © 2017 InfluxData. All rights reserved.26 Example // batch_cpu.tick batch |query(''' SELECT mean("usage_user") AS usage_user FROM "telegraf"."autogen"."cpu" ''') .period(5m) .every(5m) |influxDBOut() .database('telegraf') .retenionPolicy('5m') .tag('source', 'kapacitor') ● Downsample the data into 5m windows ● Store that data back into a the 5m retention policy in the telegraf database
  • 27. © 2017 InfluxData. All rights reserved.27 Batching Streaming ● Queries InfluxDB periodically ● Does not buffer as much of data in RAM ● Places additional query load on InfluxDB ● Writes are mirrored onto the InfluxDB instance ● Buffers all data in RAM ● Places additional write load on Kapacitor