@rawkode
Sharding First βdocumentedβ example was in ~150 AD, invented and described by Polybius.
Slide 15
@rawkode
We take the alphabet and divide it into five parts, each consisting of five letters.
Slide 16
@rawkode
Slide 17
@rawkode
Slide 18
History of Time Series
Slide 19
@rawkode
The Romans Did It The earliest form of a company which issued public shares was the case of the publicani during the Roman Republic.
Slide 20
@rawkode
Like modern joint-stock companies, the publicani were legal bodies independent of their members whose ownership was divided into shares, or partes. There is evidence that these shares were sold to public investors and traded in a type of over-the-counter market in the Forum, near the Temple of Castor and Pollux. The shares fluctuated in value, encouraging the activity of speculators, or quaestors.
Slide 21
@rawkode
In 1602 β¦ First IPO: Dutch East India Company
Slide 22
@rawkode
In 1873 β¦ First US IPO: Bank of North America
Slide 23
@rawkode
In 1884 β¦ What was the price of wheat?
Slide 24
@rawkode
First Documented Time Series A Comparison of the Fluctuations in the Price of Wheat and in the Cotton and Silk Imports into Great Britain
J. H. Poynting Journal of the Statistical Society of London Vol. 47, No. 1 (Mar., 1884), pp. 34-74
Slide 25
@rawkode
What is all this? This is the first (or one of) paper that added the dimension of time to statistical mathematics
Slide 26
@rawkode
Most data is best understood in the dimension of time @pauldix, CTO
Slide 27
Introduction to Time Series
Slide 28
@rawkode
What Will We Cover? β β β β β
Time Series Data Time Series Databases Getting to Know InfluxDB Value of Time Series Data Advancing Monitoring with Time Series
Slide 29
Time Series Data What is it?
Slide 30
@rawkode
Time Series Data Data with a timestamp
Slide 31
@rawkode Mem 100%
Healthcheck Failed
Pod Killed By OOM
V1.1.3 Deployed
Git Commit
Pod Restarted
CPU 12%
Scotland Qualify for World Cup
DB Migration Run
CI Passed
CI Started
Slide 32
@rawkode Mem 100%
Healthcheck Failed
Pod Killed By OOM
V1.1.3 Deployed
Git Commit
Pod Restarted
CPU 12%
Scotland Qualify for World Cup
DB Migration Run
CI Passed
CI Started
Slide 33
@rawkode Mem 100%
Healthcheck Failed
Pod Killed By OOM
V1.1.3 Deployed
Git Commit
Pod Restarted
CPU 12%
Scotland Qualify for World Cup
DB Migration Run
CI Passed
CI Started
Slide 34
@rawkode Mem 100%
Healthcheck Failed
Pod Killed By OOM
V1.1.3 Deployed
Git Commit
Pod Restarted
CPU 12%
Scotland Qualify for World Cup
DB Migration Run
CI Passed
CI Started
Slide 35
@rawkode Mem 100%
Healthcheck Failed
Pod Killed By OOM
V1.1.3 Deployed
Git Commit
Pod Restarted
CPU 12%
Scotland Qualify for World Cup
DB Migration Run
CI Passed
CI Started
Slide 36
@rawkode
Mem 100%
Pod Killed By OOM
V1.1.3 Deployed
Time
DB Migration Run
Healthcheck Failed
Slide 37
Slide 38
@rawkode
What is Time Series Data?
Slide 39
@rawkode
What is Time Series Data? Regular (Metrics) β Predictable β Evenly Distributed
Irregular (Events) β Unpredictable β Inconsistent Intervals
Slide 40
@rawkode
Regular / Metrics β β β β
CPU Usage Memory Usage Ping Time for Google.com Number of Processes
Slide 41
@rawkode
Irregular / Events β β β β
User Clicked Login Authentication Failed CI Published v1.3.1 Network Cable Unplugged
Slide 42
Slide 43
@rawkode
Metrics vs. Events All Metrics are an aggregation of events
Slide 44
@rawkode
Collecting Metrics & Events With Prometheus Exporters or Telegraf
@rawkode
Push AND Pull Metrics are pulled at a regular interval
Events NEED to be pushed as they happen
Consistent and reliable intervals
Inconsistent intervals
Slide 48
@rawkode
Time Series Data Use Cases
Slide 49
@rawkode
Use Cases for Time Series Monitoring β β β
Infrastructure Applications Third Party Services
IoT / Sensor β β β β β
Thermostats Electric Engines Smart Things GPS Fitbits
Real Time Analytics β β β
Website Tracking Stock Prices Currency Exchange Rates
Slide 50
Time Series Databases TSDBβs
Slide 51
@rawkode
Time Series Databases Time Series databases are optimized for collecting, storing, retrieving, and processing of Time Series data.
Slide 52
@rawkode
Time Series Databases β
High Write Frequency
β
Reads are range scans
β
TTL / Lifecycle Management
β
Time Sensitive
Slide 53
Slide 54
@rawkode
12% Are you in the 88%?
Slide 55
Slide 56
Slide 57
Slide 58
Slide 59
Slide 60
Slide 61
@rawkode
13% Itβs Not Too Late!
Slide 62
@rawkode
Slide 63
@rawkode
Disclaimer Most of this isnβt unique to InfluxDB
@rawkode
Points At any point in time, this value was N
Slide 67
@rawkode
Point
β Series β Fields β Timestamp
load,host=vm1 1m=6.32,5m=8.20,15m=9.55 123456789
Slide 68
@rawkode
Series
β Name β Tag Keys β Tag Values
β load,host=vm1 β stock_price,market=NASDAQ,ticker=GOOG β users,service=comments
Slide 69
@rawkode
Series
β Name β Tag Keys β Tag Values
stock_price,market=NASDAQ,ticker=GOOG stock_price,market=NASDAQ,ticker=APPL
Slide 70
@rawkode
Tags & Fields Tags β Indexed β String Types
Fields β Not Indexed β Multiple Data Types
Slide 71
Value of Time Series Data Isnβt It Valuable Forever?
Slide 72
@rawkode
Resolution
The predictable interval at which we will collect our time series data
Slide 73
@rawkode
Value of Time Series Data
The value of all time series data is directly correlated with the resolution that the data is available
Slide 74
Cost of Time Series Data Wait, Isnβt It Free?!
Slide 75
@rawkode
Example cpu,machine=abc1 usage=1.66 timestamp
Slide 76
@rawkode
Resolution β 1 Measurement β 1 Series β 1s Resolution
86400 Points Per Day
Slide 77
@rawkode
Resolution β 1 Measurement β 2 Series β 1s Resolution
172800 Points Per Day
Slide 78
@rawkode
Resolution β 5 Measurement β 10 Series β 1s Resolution
4320000 Points Per Day
Slide 79
@rawkode
Nasdaq β 1 Measurement β 3300 Series β 1ms Resolution
28512000 0000 Points Per Day
Slide 80
@rawkode
Nasdaq β 1 Measurement β 3300 Series β 1m Resolution
4752000 Points Per Day
Slide 81
@rawkode
Nasdaq β 1 Measurement β 3300 Series β 1h Resolution
79200 Points Per Day
Slide 82
@rawkode
Nasdaq β 1 Measurement β 3300 Series β 6h Resolution
13200 Points Per Day
Slide 83
Slide 84
@rawkode
Downsampling Lowering the Resolution
Slide 85
@rawkode
Rollups with Continuous Queries CREATE CONTINUOUS QUERY βrollup_1hβ ON βnasdaqβ BEGIN SELECT mean(price) INTO yearly FROM weekly GROUP BY time(1h) END
Advancing Monitoring with Time Series Taking Small Steps for Giant Leaps
Slide 88
CPU > 80%
MEM > 80% Application
Database Response Time > 300ms
Black Friday
Slide 89
Application
When the application fails the health-check
How do we know when to send a page to SRE / Ops?
Database
Slide 90
Application
How do we know when to send a page to SRE / Ops?
Application
Database
Application
When we get more than 100 [ 5xx | Exceptions ] within a 5 minute period
Slide 91
Service A
Service B
Service B
Service C Canary
Virtual Network
Service Mesh
Ummm?
Database A
Database B
Database C
Slide 92
@rawkode
Cloud Native Architectures Convenience Vs. Cost You can treat the symptoms for a while β¦ Upgrade Your Monitoring
Slide 93
@rawkode
Causality Treating the Disease
Slide 94
@rawkode
Causality β Look at last weeks, months, and years of data β Use tags to build correlation β Get Statistical β β β β β β
INTEGRAL() LINEAR_PREDICTION() DERIVATIVE() MAD() MOVING_AVERAGE() HOLT_WINTERS()
Slide 95
@rawkode
Causality Have you ever been paged at 4am because the disk usage of a machine went above 85%? Could this have been determined during office hours? (Linear Growth) Can we use correlations to determine the cause during anomalies?
Slide 96
@rawkode
Causality In our distributed application, our p99 reports that our users are being served healthy responses in under 2ms. Our pager is going off because weβve getting too many exceptions in the code histogram(bins: [β¦])
@rawkode
Causality In our distributed application, our p99 reports that our users are being served healthy responses in under 2ms. Our pager is going off because weβve getting too many exceptions in the code histogram() |> mode(*)
Slide 99
@rawkode
Proactive Ops We run Big News Corp and we need to reduce our cloud costs. Instead of running at 30% utilisation, can we run at 80% utilisation? HOLT_WINTERS
Slide 100
@rawkode
Build Automation Through Causality, Historical Data, Prediction, and ML
Slide 101
@rawkode
Summary β Use a TSDB
β Rollup metrics
β Understand Cost / Select Tags Wisely
β Perform outlier detection on events
β Understand the resolution you need for 1m, 6m, > 12m
β Build automation, dashboarding, and reporting around your data (past, present, and future)
Slide 102
@rawkode
Cheers! David McKay @rawkode Developer Advocate @InfluxDB | #InfluxDB
Thatβs All Folks!