SlideShare a Scribd company logo
1
Timeseries - wizualizacja danych w Grafanie.
2
About me
About me:
Marek Szymeczko
Software Developer at msales Poland
Automation & Security Enthusiast
Contact:
marek.szymeczko@msales.com
szymeczkomarek@gmail.com
3
Agenda
Why even use of graphic logs?
InfluxDB
• purpose,
• pros & cons.
Telegraf
• statsd
Grafana
• purpose,
• pros & cons,
• golang code example
4
Why use Grafana?
Quality Assurance
5
Why use Grafana?
Anomaly Detection
6
Why use Grafana?
Monitoring
7
Why use Grafana?
Analytics
8
Monitoring process
Application StatsD Telegraf
Grafana InfluxDB
InfluxDB - introduction and purpose.
Written in Go without external
dependencies.
Time series, metrics and analytics
SQL like database system.
Contains a lot of already built-in
features like:
• aggregations,
• retention policies,
• alerting.
events,
visits,
exceptions,
MEASUREMENTs,
things that happen in time.
InfluxDB - pros.
Very high performance (for a valid job),
HTTPs interface for reading and writing the data,
SQL Syntax,
Built-in downsampling the data,
Continuous Queries,
Retention Policies.
InfluxDB - cons.
no updates, only overwrites
not a magical thing
performance issues when used not for valid job
Load
Writes per
second
Queries per
second
Unique series Req. CPUs Req. Memory
Low < 5k < 5 < 100k 2 - 4 2 - 4 GB
Medium < 250k < 25 < 1kk 4 - 6 8 - 32GB
High > 250k > 25 > 1kk 8+ 32+GB
Infeasible > 750k > 100 > 10kk probably
impossible
probably
impossible
https://github.com/msales/ocoderfest-monitoring
TIG Docker Stack
curl -i -XPOST ‘http://influxdb.ocoderfest.msales:
8888/write?db=metrics' --data-binary
‘page_visit,host=server01 value=1
1503987933000000000'
InfluxDB - basic queries
SHELLHTTP API
curl -i -XPOST http://influxdb.ocoderfest.msales:
8888/query --data-urlencode "q=CREATE DATABASE
metrics”
> CREATE DATABASE metrics
> INSERT page_visit,host=server01 value=1
1503987933000000000
http://influxdb.ocoderfest.msales:8888 docker exec -it $(docker ps -aqf “name=influxdb.container”) influx
> SHOW MEASUREMENTS
curl -i -XPOST http://influxdb.ocoderfest.msales:
8888/query --data-urlencode "q=SHOW MEASUREMENTS”
InfluxDB - structure of data point
key
coffeemaker,location=katowice,machineid=1 water=90,coffee=55 1486738421000000000
tags
values
timestamp
InfluxDB - structure of data point
key
coffeemaker,location=katowice,machineid=1 water=90,coffee=55 1486738421000000000
name of the measurements
"something like” the mysql table
can be dynamically created
InfluxDB - structure of data point
tags
coffeemaker,location=katowice,machineid=1 water=90,coffee=55 1486738421000000000
are present after key first comma
"something like” string indexed column in mysql
use tags if they will be commonly-queried meta data
use tags if you plan to use them with group by
tag values are always interpreted as strings
InfluxDB - structure of data point
values
coffeemaker,location=katowice,machineid=1 water=90,coffee=55 1486738421000000000
are present after key first space
"something like” number non-indexed column in mysql
better not be used with group by
are interpreted as numeric
InfluxDB - structure of data point
coffeemaker,location=katowice,machineid=1 water=90,coffee=55 1486738421000000000
by default nanosecond precision
“something like” mysql ID
there cannot be more entries with same timestamp
timestamp
InfluxDB - downsampling
name: page_visits
------------
time host value
2017-09-12T00:00:00Z foo.msales.com 271
2017-09-12T00:00:00Z bar.msales.com 233
2017-09-12T00:00:05Z foo.msales.com 212
2017-09-12T00:00:05Z bar.msales.com 312
2017-09-12T00:00:10Z foo.msales.com 237
2017-09-12T00:00:10Z bar.msales.com 162
Many hosts receive
many visits over
short period of time.
name: page_visits_cq_1m
------------
time host value
2017-09-12T00:00:00Z foo.msales.com 17423
2017-09-12T00:00:00Z bar.msales.com 19483
2017-09-12T00:01:00Z foo.msales.com 17329
2017-09-12T00:01:00Z bar.msales.com 19721
We can group
historical data
without losing
“much” information.
5s interval
1m interval
InfluxDB - retention policies and continuous queries
CREATE CONTINUOUS QUERY “cq_1m_visits" ON “metrics"
RESAMPLE FOR 2m
BEGIN
SELECT sum(value) AS visits
INTO "_internal"."page_visits".page_visits_cq_1m
FROM page_visits
GROUP BY time(1m), host
END
CREATE RETENTION POLICY "page_visits" ON “metrics" DURATION 30d
REPLICATION 1 DEFAULT
SHOW RETENTION POLICIES ON “metrics”
21
Monitoring process
Application StatsD Telegraf
Grafana InfluxDB
22
Telegraf
Written in Go.
Made by same company that developed InfluxDB.
Plugin driven concept:
• input plugins - collect metrics from system or apps (nginx, rabbitmq, statsd)
• processor plugins - decorate and prepare the data,
• aggregate plugins - create aggregate metrics (mean, max, percentiles)
• output plugins - writes to various destinations (influxdb, graphite, prometheus)
23
Telegraf
Processors plugins process metrics as
they pass and emit results based on the
values:
• ex. add tag to all metrics that pased.
Aggregator plugins are more complex,
they emit new aggregate metrics such
as:
• mean, min, max, quantile.
They need to be ran with period, so it
means they aggregate values of the
past: (now() - period)
24
Monitoring process
Application StatsD Telegraf
Grafana InfluxDB
Statsd
statsd - Telegraf input plugin that works on UDP (fast, fire and forget) port,
let’s us parses the messages and extracts metrics data,
periodically flushes the data,
client has a really light package, available for all modern languages:
• php: https://github.com/domnikl/statsd-php
• go: https://github.com/cactus/go-statsd-client
• nodejs: https://github.com/msiebuhr/node-statsd-client
Statsd - context
func (s Statsd) Inc(name string, value int64, rate float32, tags map[string]string) error {
name += formatTags(tags)
return s.client.Inc(name, value, rate)
}
Go ahead and use influxdb tags!
Statsd - metrics
func main() {
statsd, err := stats.NewStatsd("127.0.0.1:8125", "go")
if err != nil {
return;
}
}
connect to statsd deamon
only place when statsd can throw exception
func main() {
...
statsd.Inc("page_visit", 1, 1.0, nil)
}
Statsd - increment metric.
Translates to:
Image source: http://influxdb.ocoderfest.msales:8888
func main() {
...
tags := make(map[string]string)
tags["browser"] = "chrome"
statsd.Inc("page_visit", 1, 1.0, tags)
statsd.Inc("page_visit", 1, 1.0, tags)
statsd.Inc("page_visit", 1, 1.0, tags)
statsd.Inc("page_visit", 1, 1.0, tags)
statsd.Dec(“page_visit", 1, 1.0, tags)
}
Statsd - periodically flushed data.
Translates to:
Image source: http://influxdb.ocoderfest.msales:8888
func main() {
...
stamp := time.Now()
time.Sleep(time.Second * 5)
statsd.Timing("conversion_time", time.Since(stamp), 1.0, nil)
}
Statsd - timing metric.
Translates to:
Image source: http://influxdb.ocoderfest.msales:8888
func main() {
...
stamp := time.Now()
for j := 0; j < 10; j++ {
go func(client stats.Stats, j int, stamp time.Time) {
time.Sleep(time.Second * time.Duration(j))
client.Timing("conversion_time", time.Since(stamp), 1.0, nil)
}(client, j, stamp)
}
}
Statsd - timing metric.
Translates to:
Image source: http://influxdb.ocoderfest.msales:8888
func main() {
...
statsd.Gauge("happy_clients", 1, 1.0, nil)
statsd.Gauge("happy_clients", 2, 1.0, nil)
statsd.Gauge("happy_clients", 8, 1.0, nil)
statsd.Gauge("happy_clients", 3, 1.0, nil)
}
Statsd - gauge metric.
Translates to:
Image source: http://influxdb.ocoderfest.msales:8888
33
Monitoring process
Application StatsD Telegraf
Grafana InfluxDB
Grafana - introduction and purpose.
Open Sourced,
Suite used for data and applications
analytics and visualization,
Accepts multiple data sources,
“Query language and capabilities of
each Data Source are obviously very
different.”
Possible data sources:
Graphite,
InfluxDB,
OpenTSDB,
Prometheus,
Elasticsearch,
CloudWatch,
MySQL.
Grafana - pros.
free,
permission system to maintain user and team access,
multiple data sources,
easy, beautiful, fast and interactive,
built-in alerts.
Grafana - cons.
no built-in machine learning for alerts,
no search or data exploring,
data source defines the way panel must be created.
Grafana - structure
One or more (usually one) organization.
Each organization can have one or more data sources.
All dashboards are owned by perticular organization.
Dashboards contains rows that contain single panels (which might use different
data sources).
Single Panel uses query editor to query the data source for metrics to display on it.
Users can have access to dashboards, or organizations within many different
permissions.
https://github.com/m4r3x/go-event-simulation
TIG Stack Simulation + Dashboard Export
DEMO
Go Grafana
QUESTIONS?
41
Thanks.
msales Poland
Sobieskiego 2, 40-082 Katowice
Poland
follow us @msalestech
info@msales.com www.msales.com +48 32 630 40 76

More Related Content

PDF
Beautiful Monitoring With Grafana and InfluxDB
PDF
InfluxDB & Grafana
PDF
Grafana introduction
PDF
Introduction to InfluxDB and TICK Stack
PPTX
InfluxDb
PDF
Introduction to influx db
PPTX
Grafana Mimir and VictoriaMetrics_ Performance Tests.pptx
PPTX
Grafana
Beautiful Monitoring With Grafana and InfluxDB
InfluxDB & Grafana
Grafana introduction
Introduction to InfluxDB and TICK Stack
InfluxDb
Introduction to influx db
Grafana Mimir and VictoriaMetrics_ Performance Tests.pptx
Grafana

What's hot (20)

PDF
Monitoring with prometheus
PPTX
Grafana optimization for Prometheus
PDF
Getting Started Monitoring with Prometheus and Grafana
PDF
Cloud Monitoring tool Grafana
PDF
Infrastructure & System Monitoring using Prometheus
PPTX
Prometheus design and philosophy
PDF
Apache Iceberg: An Architectural Look Under the Covers
ODP
Monitoring With Prometheus
PPTX
Grafana.pptx
PDF
Introduce to Terraform
PDF
Time Series Data with InfluxDB
PDF
All about InfluxDB.
PPTX
Elastic stack Presentation
PDF
Intro to InfluxDB
PDF
ClickHouse Monitoring 101: What to monitor and how
PDF
How Robinhood Built a Real-Time Anomaly Detection System to Monitor and Mitig...
PDF
Trino: A Ludicrously Fast Query Engine - Pulsar Summit NA 2021
PDF
VictoriaLogs: Open Source Log Management System - Preview
PDF
Prometheus-Grafana-RahulSoni1584KnolX.pptx.pdf
PDF
Understanding Presto - Presto meetup @ Tokyo #1
Monitoring with prometheus
Grafana optimization for Prometheus
Getting Started Monitoring with Prometheus and Grafana
Cloud Monitoring tool Grafana
Infrastructure & System Monitoring using Prometheus
Prometheus design and philosophy
Apache Iceberg: An Architectural Look Under the Covers
Monitoring With Prometheus
Grafana.pptx
Introduce to Terraform
Time Series Data with InfluxDB
All about InfluxDB.
Elastic stack Presentation
Intro to InfluxDB
ClickHouse Monitoring 101: What to monitor and how
How Robinhood Built a Real-Time Anomaly Detection System to Monitor and Mitig...
Trino: A Ludicrously Fast Query Engine - Pulsar Summit NA 2021
VictoriaLogs: Open Source Log Management System - Preview
Prometheus-Grafana-RahulSoni1584KnolX.pptx.pdf
Understanding Presto - Presto meetup @ Tokyo #1
Ad

Similar to Timeseries - data visualization in Grafana (20)

PDF
Learnings Using Spark Streaming and DataFrames for Walmart Search: Spark Summ...
PDF
Data Platform at Twitter: Enabling Real-time & Batch Analytics at Scale
PDF
Deep learning and streaming in Apache Spark 2.2 by Matei Zaharia
PDF
M|18 Real-time Analytics with the New Streaming Data Adapters
PPTX
MySQL performance monitoring using Statsd and Graphite
PDF
Optimizing InfluxDB Performance in the Real World by Dean Sheehan, Senior Dir...
PPTX
AI與大數據數據處理 Spark實戰(20171216)
PPTX
WSO2Con USA 2015: WSO2 Analytics Platform - The One Stop Shop for All Your Da...
PDF
WSO2 Analytics Platform: The one stop shop for all your data needs
PPTX
Angular2 inter3
PDF
Introduction to Presto at Treasure Data
PDF
Deep dive into spark streaming
PDF
Strtio Spark Streaming + Siddhi CEP Engine
PDF
So you think you can stream.pptx
PPTX
ETL with SPARK - First Spark London meetup
PDF
SamzaSQL QCon'16 presentation
PDF
MySQL Performance Monitoring
PDF
Making sense of your data jug
PDF
Scylla Summit 2016: Analytics Show Time - Spark and Presto Powered by Scylla
PDF
Log everything! @DC13
Learnings Using Spark Streaming and DataFrames for Walmart Search: Spark Summ...
Data Platform at Twitter: Enabling Real-time & Batch Analytics at Scale
Deep learning and streaming in Apache Spark 2.2 by Matei Zaharia
M|18 Real-time Analytics with the New Streaming Data Adapters
MySQL performance monitoring using Statsd and Graphite
Optimizing InfluxDB Performance in the Real World by Dean Sheehan, Senior Dir...
AI與大數據數據處理 Spark實戰(20171216)
WSO2Con USA 2015: WSO2 Analytics Platform - The One Stop Shop for All Your Da...
WSO2 Analytics Platform: The one stop shop for all your data needs
Angular2 inter3
Introduction to Presto at Treasure Data
Deep dive into spark streaming
Strtio Spark Streaming + Siddhi CEP Engine
So you think you can stream.pptx
ETL with SPARK - First Spark London meetup
SamzaSQL QCon'16 presentation
MySQL Performance Monitoring
Making sense of your data jug
Scylla Summit 2016: Analytics Show Time - Spark and Presto Powered by Scylla
Log everything! @DC13
Ad

Recently uploaded (20)

PDF
Empathic Computing: Creating Shared Understanding
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
Cloud computing and distributed systems.
PDF
KodekX | Application Modernization Development
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPT
Teaching material agriculture food technology
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
Big Data Technologies - Introduction.pptx
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
cuic standard and advanced reporting.pdf
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Electronic commerce courselecture one. Pdf
Empathic Computing: Creating Shared Understanding
Encapsulation_ Review paper, used for researhc scholars
Unlocking AI with Model Context Protocol (MCP)
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Diabetes mellitus diagnosis method based random forest with bat algorithm
Mobile App Security Testing_ A Comprehensive Guide.pdf
Cloud computing and distributed systems.
KodekX | Application Modernization Development
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Teaching material agriculture food technology
NewMind AI Weekly Chronicles - August'25 Week I
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Big Data Technologies - Introduction.pptx
Network Security Unit 5.pdf for BCA BBA.
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Chapter 3 Spatial Domain Image Processing.pdf
cuic standard and advanced reporting.pdf
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Electronic commerce courselecture one. Pdf

Timeseries - data visualization in Grafana

  • 1. 1 Timeseries - wizualizacja danych w Grafanie.
  • 2. 2 About me About me: Marek Szymeczko Software Developer at msales Poland Automation & Security Enthusiast Contact: marek.szymeczko@msales.com szymeczkomarek@gmail.com
  • 3. 3 Agenda Why even use of graphic logs? InfluxDB • purpose, • pros & cons. Telegraf • statsd Grafana • purpose, • pros & cons, • golang code example
  • 8. 8 Monitoring process Application StatsD Telegraf Grafana InfluxDB
  • 9. InfluxDB - introduction and purpose. Written in Go without external dependencies. Time series, metrics and analytics SQL like database system. Contains a lot of already built-in features like: • aggregations, • retention policies, • alerting. events, visits, exceptions, MEASUREMENTs, things that happen in time.
  • 10. InfluxDB - pros. Very high performance (for a valid job), HTTPs interface for reading and writing the data, SQL Syntax, Built-in downsampling the data, Continuous Queries, Retention Policies.
  • 11. InfluxDB - cons. no updates, only overwrites not a magical thing performance issues when used not for valid job Load Writes per second Queries per second Unique series Req. CPUs Req. Memory Low < 5k < 5 < 100k 2 - 4 2 - 4 GB Medium < 250k < 25 < 1kk 4 - 6 8 - 32GB High > 250k > 25 > 1kk 8+ 32+GB Infeasible > 750k > 100 > 10kk probably impossible probably impossible
  • 13. curl -i -XPOST ‘http://influxdb.ocoderfest.msales: 8888/write?db=metrics' --data-binary ‘page_visit,host=server01 value=1 1503987933000000000' InfluxDB - basic queries SHELLHTTP API curl -i -XPOST http://influxdb.ocoderfest.msales: 8888/query --data-urlencode "q=CREATE DATABASE metrics” > CREATE DATABASE metrics > INSERT page_visit,host=server01 value=1 1503987933000000000 http://influxdb.ocoderfest.msales:8888 docker exec -it $(docker ps -aqf “name=influxdb.container”) influx > SHOW MEASUREMENTS curl -i -XPOST http://influxdb.ocoderfest.msales: 8888/query --data-urlencode "q=SHOW MEASUREMENTS”
  • 14. InfluxDB - structure of data point key coffeemaker,location=katowice,machineid=1 water=90,coffee=55 1486738421000000000 tags values timestamp
  • 15. InfluxDB - structure of data point key coffeemaker,location=katowice,machineid=1 water=90,coffee=55 1486738421000000000 name of the measurements "something like” the mysql table can be dynamically created
  • 16. InfluxDB - structure of data point tags coffeemaker,location=katowice,machineid=1 water=90,coffee=55 1486738421000000000 are present after key first comma "something like” string indexed column in mysql use tags if they will be commonly-queried meta data use tags if you plan to use them with group by tag values are always interpreted as strings
  • 17. InfluxDB - structure of data point values coffeemaker,location=katowice,machineid=1 water=90,coffee=55 1486738421000000000 are present after key first space "something like” number non-indexed column in mysql better not be used with group by are interpreted as numeric
  • 18. InfluxDB - structure of data point coffeemaker,location=katowice,machineid=1 water=90,coffee=55 1486738421000000000 by default nanosecond precision “something like” mysql ID there cannot be more entries with same timestamp timestamp
  • 19. InfluxDB - downsampling name: page_visits ------------ time host value 2017-09-12T00:00:00Z foo.msales.com 271 2017-09-12T00:00:00Z bar.msales.com 233 2017-09-12T00:00:05Z foo.msales.com 212 2017-09-12T00:00:05Z bar.msales.com 312 2017-09-12T00:00:10Z foo.msales.com 237 2017-09-12T00:00:10Z bar.msales.com 162 Many hosts receive many visits over short period of time. name: page_visits_cq_1m ------------ time host value 2017-09-12T00:00:00Z foo.msales.com 17423 2017-09-12T00:00:00Z bar.msales.com 19483 2017-09-12T00:01:00Z foo.msales.com 17329 2017-09-12T00:01:00Z bar.msales.com 19721 We can group historical data without losing “much” information. 5s interval 1m interval
  • 20. InfluxDB - retention policies and continuous queries CREATE CONTINUOUS QUERY “cq_1m_visits" ON “metrics" RESAMPLE FOR 2m BEGIN SELECT sum(value) AS visits INTO "_internal"."page_visits".page_visits_cq_1m FROM page_visits GROUP BY time(1m), host END CREATE RETENTION POLICY "page_visits" ON “metrics" DURATION 30d REPLICATION 1 DEFAULT SHOW RETENTION POLICIES ON “metrics”
  • 21. 21 Monitoring process Application StatsD Telegraf Grafana InfluxDB
  • 22. 22 Telegraf Written in Go. Made by same company that developed InfluxDB. Plugin driven concept: • input plugins - collect metrics from system or apps (nginx, rabbitmq, statsd) • processor plugins - decorate and prepare the data, • aggregate plugins - create aggregate metrics (mean, max, percentiles) • output plugins - writes to various destinations (influxdb, graphite, prometheus)
  • 23. 23 Telegraf Processors plugins process metrics as they pass and emit results based on the values: • ex. add tag to all metrics that pased. Aggregator plugins are more complex, they emit new aggregate metrics such as: • mean, min, max, quantile. They need to be ran with period, so it means they aggregate values of the past: (now() - period)
  • 24. 24 Monitoring process Application StatsD Telegraf Grafana InfluxDB
  • 25. Statsd statsd - Telegraf input plugin that works on UDP (fast, fire and forget) port, let’s us parses the messages and extracts metrics data, periodically flushes the data, client has a really light package, available for all modern languages: • php: https://github.com/domnikl/statsd-php • go: https://github.com/cactus/go-statsd-client • nodejs: https://github.com/msiebuhr/node-statsd-client
  • 26. Statsd - context func (s Statsd) Inc(name string, value int64, rate float32, tags map[string]string) error { name += formatTags(tags) return s.client.Inc(name, value, rate) } Go ahead and use influxdb tags!
  • 27. Statsd - metrics func main() { statsd, err := stats.NewStatsd("127.0.0.1:8125", "go") if err != nil { return; } } connect to statsd deamon only place when statsd can throw exception
  • 28. func main() { ... statsd.Inc("page_visit", 1, 1.0, nil) } Statsd - increment metric. Translates to: Image source: http://influxdb.ocoderfest.msales:8888
  • 29. func main() { ... tags := make(map[string]string) tags["browser"] = "chrome" statsd.Inc("page_visit", 1, 1.0, tags) statsd.Inc("page_visit", 1, 1.0, tags) statsd.Inc("page_visit", 1, 1.0, tags) statsd.Inc("page_visit", 1, 1.0, tags) statsd.Dec(“page_visit", 1, 1.0, tags) } Statsd - periodically flushed data. Translates to: Image source: http://influxdb.ocoderfest.msales:8888
  • 30. func main() { ... stamp := time.Now() time.Sleep(time.Second * 5) statsd.Timing("conversion_time", time.Since(stamp), 1.0, nil) } Statsd - timing metric. Translates to: Image source: http://influxdb.ocoderfest.msales:8888
  • 31. func main() { ... stamp := time.Now() for j := 0; j < 10; j++ { go func(client stats.Stats, j int, stamp time.Time) { time.Sleep(time.Second * time.Duration(j)) client.Timing("conversion_time", time.Since(stamp), 1.0, nil) }(client, j, stamp) } } Statsd - timing metric. Translates to: Image source: http://influxdb.ocoderfest.msales:8888
  • 32. func main() { ... statsd.Gauge("happy_clients", 1, 1.0, nil) statsd.Gauge("happy_clients", 2, 1.0, nil) statsd.Gauge("happy_clients", 8, 1.0, nil) statsd.Gauge("happy_clients", 3, 1.0, nil) } Statsd - gauge metric. Translates to: Image source: http://influxdb.ocoderfest.msales:8888
  • 33. 33 Monitoring process Application StatsD Telegraf Grafana InfluxDB
  • 34. Grafana - introduction and purpose. Open Sourced, Suite used for data and applications analytics and visualization, Accepts multiple data sources, “Query language and capabilities of each Data Source are obviously very different.” Possible data sources: Graphite, InfluxDB, OpenTSDB, Prometheus, Elasticsearch, CloudWatch, MySQL.
  • 35. Grafana - pros. free, permission system to maintain user and team access, multiple data sources, easy, beautiful, fast and interactive, built-in alerts.
  • 36. Grafana - cons. no built-in machine learning for alerts, no search or data exploring, data source defines the way panel must be created.
  • 37. Grafana - structure One or more (usually one) organization. Each organization can have one or more data sources. All dashboards are owned by perticular organization. Dashboards contains rows that contain single panels (which might use different data sources). Single Panel uses query editor to query the data source for metrics to display on it. Users can have access to dashboards, or organizations within many different permissions.
  • 41. 41 Thanks. msales Poland Sobieskiego 2, 40-082 Katowice Poland follow us @msalestech info@msales.com www.msales.com +48 32 630 40 76