SlideShare une entreprise Scribd logo
1  sur  40
Télécharger pour lire hors ligne
February 3, 2019
fosdem.org
Rob Skillington
Observability and M3, Uber NYC M3
M3 and a new age of metrics and
monitoring in an increasingly
complex world
● Working on monitoring “observability” running computers now at Uber for
3 continuous years.
● Member of OpenMetrics, a CNCF project standardizing metrics exposition.
See openmetrics.io for more info.
Why am I here?
San Francisco
Seattle
New York
Amsterdam
Aarhus
Vilnius
Sofia
Hyderabad
Agenda ● High dimensionality metrics and
monitoring in an increasingly complex
world
● M3, Prometheus, Graphite
“High dimensionality metrics”
Huh?
5
● Take a single metric, such as status code delivered by our frontends
○ http_status_code
● At Uber, we have roughly a few hundred important HTTP routes we want
to drill down into the status code with the following dimensions:
○ Route (few hundred)
○ Status code (less than a few common status codes)
○ Places of operation (few hundred)
■ failures sometimes isolated to place of operation
○ App device version (few hundred)
High dimensionality metrics
You can roll up metrics to make viewing fast. For example, view status codes
by route, but across all regions for all app versions.
High dimensionality metrics
status=2xx route=/request
region=eu-west client=v1.2 status=2xx ...
status=4xx route=/request
status=5xx route=/request
region=eu-north client=v1.3 status=2xx ...
region=us-west client=v2.0 status=2xx ...
region=eu-west client=v1.1 status=5xx ...
region=eu-north client=v1.4 status=5xx ...
region=us-west client=v2.3 status=5xx ...
region=eu-west client=v3.2 status=5xx ...
region=eu-north client=v3.1 status=5xx ...
However, it is still incredibly high dimensional, just to store the raw data if you
later want to drill down on.
● Routes (eg 500) * Status code (eg 5) * Region (eg 5) * Client version (eg 20)
= 250,000 unique time series
● Expensive but not too bad..? However add any other dimensions and it
gets out of control (any multiplier on 250k explodes to millions quickly).
High dimensionality metrics
status=5xx route=/request ...
region=eu-west client=v1.0 status=5xx ...
region=eu-north client=v1.3 status=5xx ...
region=us-west client=v2.0 status=5xx ...
High dimensionality metrics
eu-north
mysql
frontend app
redis
client
v1.3
client
v2.0
eu-north
mysql
frontend app
redis
client
v1.3
client
v2.0
High dimensionality metrics
eu-north
mysql
frontend app
redis
client
v1.3
client
v2.0
eu-north
mysql
frontend app
client
v1.3
client
v2.0
redis
redis
To determine what code path to
debug, need to detect failure and
isolate to:
● Region eu-north
● Client version v2.0
● A manageable way to scale out capacity
○ A single Prometheus instance can hold N million time series
(where N does not usually reach the double digits, even on big machines)
Ok great but what do I need?
”This is fine.. I’m
okay with the
events that are
unfolding currently”
● It’s a little like playing tetris, can I fit my high cardinality metrics into an
existing Prometheus instance or do I setup a new one, what happens
when it eclipses a single instance?
Ok great but what do I need?
Metrics and Monitoring at Uber
13
Uber Workload - Ingress
~700M Pre-aggregated Metrics/s
(~130Gbps)
Storage
~33M Metrics Stored/s
(not including Replica Factor = 3)
(~50Gbps)
Index
~ 11B Unique Metric IDs
(Equivalent of thousands of Prom instances)
Egress
~ 1.5B data points per second (spikes to 5B+)
powers dashboards and 150,000 scheduled
“realtime” alerts
(~20 gigabits/sec)
M3, Prometheus and Graphite
18
Prometheus Long Term Storage
Prometheus
Grafana
Long Term
Storage
TSDB
AlertManager
Client /
Endpoint
Remote
Read/Write
(and aggregation)
M3DB
M3DB
M3DB
Prometheus
Grafana
InfluxDB /
Cortex
AlertManager
TSDB
Index
etcd
Client /
Endpoint M3DB
M3
Coordinator
Remote
Read/Write
(and aggregation)
M3DB High-Level Architecture
Think Log Structured
Merge tree (LSM).. but with
almost zero compaction.
Typical LSM will have
levelled or size based
compaction, M3DB has
time window compaction
which by will avoid any
compaction of time series
data files. Also
downsampling is done as
data is streamed to the
aggregators.
● Each time series data block contains a bloom filter, an index summaries file, a
metadata per time series key and time series data file.
● The bloom filter is mmap’d and used for fast lookups to determine for large range
scan, which blocks for should be searched on disk for a given metric.
Bloom filter for each time series data block
Bloom filter API
Add([]byte)
MaybeExists([]byte) bool
Index File
Binary search in memory
Scan linearly starting at offset
provided by summaries file
binary search
Summaries File
Current value: dogCurrent value: barnCurrent value: boatCurrent value: cat
cat
Bloom Filter
for 2pm to 4pm block
Maybe exists
Data File
● The inverted index is similar to Lucene, it uses FST segments to built an efficient
and compressed structure for fast regexp, using Roaring Bitmaps to capture metric
IDs associated to a label value.
● Each metric’s label/tag has it’s own FST that when searched can find the Roaring
Bitmap mmap offset for the set of metric IDs associated with a label value.
Inverted Index
● For every term combination in the form of service=”foo” need to store a set of
metric IDs (integers) that match, this is called a “postings list”.
● {service=”foo”,endpoint=”bar”,client_version=”3”}
○ Do some index magic to find the 3 different sets that store service=”foo”,
endpoint=”bar”and client_version=”3”.
○ Calculate the intersection (AND) of those 3 sets, and then retrieve those
documents
● Index is broken into blocks and segments, so also need to be able to calculate
union (OR)
○ Find sets that store service=”foo” postings list in the 12PM->2PM block and
the 2PM->4 PM block and then calculate their union (OR)
Postings Lists
● Bitmap Container
○ Exactly the same as a regular bitmap, but always from 0 -> 2^16
○ (2^16) / 8 -> Always uses exactly 8KiB of memory
● Sorted Array Container
○ Sorted array of uint16 -> []uint16
○ Grows dynamically
○ 2 bytes of memory per value
■ Minimum size: 2 bytes!
■ Maximum size: 131 KiB :(
● “Run” Container
○ Optimized for long sequences of continuous values
○ Array of uint16 pairs -> []struct{start, length uint16}
○ Ideal scenario: all numbers in a 2^16 range exist in the set -> 4 bytes of memory!
Roaring Bitmap
Roaring Bitmap
? ? ? ? ? ? ? ?
0 1 2 3 4 5 6 7Key Prefix
Container
Only need keys/containers for chunks that have data in that
range, otherwise we can leave them out entirely.
0 -> 2^16 2^16 -> 2^17
2^17 -> 2^17
+ 2^16 ... ... ... ... ...Values Stored
● Same APIs as a normal bitmap, but adapts to your workload
● Break the 2^32 number space into chunks of size 2^16
○ (2^32) / (2^16) == 2^16 chunks of 2^16
● For each chunk, store the values in that range within a “container”
○ Use a different container type for each chunk based on data density
● Can imagine it as a: map[uint16]*Container
Roaring Bitmap
● Choose containers based on cardinality / presence of continuous sequences.
○ Can represent both sparse and dense sets efficiently.
○ Grows to very large integer spaces (uint64) due to the chunking mechanism.
● When union or intersection, stack the containers on top of each other and perform as
efficient as possible set operation based on container types.
Array Array Bitmap Bitmap Run Run null null
1 4095 4096 8000 65,536
0 ->
9,500
0 0Cardinality
Container
0 1 2 3 4 5 6 7Key Prefix
● M3DB can be deployed on premise without any dependencies.
● M3DB also can run on Kubernetes and the M3DB k8s operator
can manage your cluster.
○ See more at https://github.com/m3db/m3db-operator
● Just requires two roles M3DB and M3 Coordinator to get started.
● Clustered version open sourced and can scale to billions of time
series.
● Read more at https://eng.uber.com/m3
Powerful but also kinda easy to use
Graphite, Statsd, Carbon?
Host
Client
Client
Host
Client
Client
Host
Client
Client
M3 Query
EngineM3DB
PromQLProm
M3
Coordinator
Statsite
Prom
Statsd
Carbon
Relay
Carbon
Whisper
DB
Graphite
Web
Grafana
Graphite
Graphite, Statsd, Carbon?
Host
Client
Client
Host
Client
Client
Host
Client
Client
M3 Query
EngineM3DB
PromQLProm
M3
Coordinator
Statsite
M3
Coordinator
Prom
Statsd
Carbon
Relay
M3
Coordinator
Carbon
Whisper
DB
Graphite
Web
Grafana
Graphite
● Multi-language with support for PromQL and Graphite
● Written in Go and can sustain much higher QPS than graphite-web
● More here https://eng.uber.com/billion-data-point-challenge
M3 Query Engine
Parallelized Compressed Blocks
Series A
Series B
Series C
Block 1
t1 t10
Compressed TS
Compressed TS
Compressed TS
Block 2
t10 t20
Compressed TS
Compressed TS
Compressed TS
Block 3
t20 t30
Compressed TS
Compressed TS
Compressed TS
JIT Decompression + Lazy Function Evaluation
Series A
Series B
Series C
Block
t1 t2 t3 t4 t5 t6...…
Compressed TSCompressed TSRemaining Compressed TS368
Compressed TSCompressed TSRemaining Compressed TS
Compressed TSCompressed TSRemaining Compressed TS
250
102
72 = (368 + 250 + 102) / 10 - scaleToSeconds function lazily evaluated
after sum even though it precedes sum in the query.
Result:
Demo
● How to configure m3coordinator for ingesting Prometheus and Graphite metrics.
● Adding m3coordinator as a Prometheus and Graphite data source.
● Sending metrics and graphing them in Grafana.
● The setup for the demo is a gist on GitHub at http://bit.ly/m3fosdem.
Today
Host
Client
Client
Host
Client
Client
Host
Client
Client
M3
Query
Engine
M3DB
Graphite
PromQL
Prom
M3
Coordinator
Statsite
M3
Coordinator
Prom
Statsd
Carbon
Relay
M3
Coordinator
Carbon
H1 2019
1. Better guides, simpler to configure and use out of the box.
2. Horizontally scalable metrics collection with OpenMetrics scraping from
M3Collector and possibly M3Aggregator.
3. Horizontally Carbon and Statsd aggregation with M3Aggregator instead of manual
HA and sharding configuration of Graphite metrics with M3Coordinator.
H2 2019
Contribute and help discuss:
- Mail (m3db@googlegroups.com)
- Gitter (gitter.im/m3db)
- GitHub issues (github.com/m3db/proposal/issues)
Roadmap
Future
Host
Collector
Client
Client
Host
Client
Host
Client
Client
M3
Aggregator
M3
Query
Engine
M3DB
Prom
M3
Coordinator
Prom
Statsd
Carbon
Graphite
PromQL
Questions?
GitHub and Web
https://github.com/m3db/m3, https://m3db.io
Mailing List
https://groups.google.com/forum/#!topic/m3db
Gitter (like IRC, except.. it’s not IRC 😔)
https://gitter.im/m3db
M3 Eng Blog Post
https://eng.uber.com/m3
(we’re hiring)
M3
Thank you
Proprietary © 2018 Uber Technologies, Inc. All rights reserved. No part of this
document may be reproduced or utilized in any form or by any means,
electronic or mechanical, including photocopying, recording, or by any
information storage or retrieval systems, without permission in writing from
Uber. This document is intended only for the use of the individual or entity to
whom it is addressed. All recipients of this document are notified that the
information contained herein includes proprietary information of Uber, and
recipient may not make use of, disseminate, or in any way disclose this
document or any of the enclosed information to any person other than
employees of addressee to the extent necessary for consultations with
authorized personnel of Uber.
Questions: email ospo@uber.com
Follow our Facebook page:
www.facebook.com/uberopensource

Contenu connexe

Tendances

Tendances (20)

OpenTSDB 2.0
OpenTSDB 2.0OpenTSDB 2.0
OpenTSDB 2.0
 
Samza memory capacity_2015_ieee_big_data_data_quality_workshop
Samza memory capacity_2015_ieee_big_data_data_quality_workshopSamza memory capacity_2015_ieee_big_data_data_quality_workshop
Samza memory capacity_2015_ieee_big_data_data_quality_workshop
 
Ted Dunning – Very High Bandwidth Time Series Database Implementation - NoSQL...
Ted Dunning – Very High Bandwidth Time Series Database Implementation - NoSQL...Ted Dunning – Very High Bandwidth Time Series Database Implementation - NoSQL...
Ted Dunning – Very High Bandwidth Time Series Database Implementation - NoSQL...
 
The new time series kid on the block
The new time series kid on the blockThe new time series kid on the block
The new time series kid on the block
 
Update on OpenTSDB and AsyncHBase
Update on OpenTSDB and AsyncHBase Update on OpenTSDB and AsyncHBase
Update on OpenTSDB and AsyncHBase
 
Apache Flink Training Workshop @ HadoopCon2016 - #2 DataSet API Hands-On
Apache Flink Training Workshop @ HadoopCon2016 - #2 DataSet API Hands-OnApache Flink Training Workshop @ HadoopCon2016 - #2 DataSet API Hands-On
Apache Flink Training Workshop @ HadoopCon2016 - #2 DataSet API Hands-On
 
Gnocchi v4 - past and present
Gnocchi v4 - past and presentGnocchi v4 - past and present
Gnocchi v4 - past and present
 
Gnocchi v3
Gnocchi v3Gnocchi v3
Gnocchi v3
 
Monitoring MySQL with OpenTSDB
Monitoring MySQL with OpenTSDBMonitoring MySQL with OpenTSDB
Monitoring MySQL with OpenTSDB
 
Declarative Infrastructure Tools
Declarative Infrastructure Tools Declarative Infrastructure Tools
Declarative Infrastructure Tools
 
Chronix Poster for the Poster Session FAST 2017
Chronix Poster for the Poster Session FAST 2017Chronix Poster for the Poster Session FAST 2017
Chronix Poster for the Poster Session FAST 2017
 
Update on OpenTSDB and AsyncHBase
Update on OpenTSDB and AsyncHBase Update on OpenTSDB and AsyncHBase
Update on OpenTSDB and AsyncHBase
 
Goroutine stack and local variable allocation in Go
Goroutine stack and local variable allocation in GoGoroutine stack and local variable allocation in Go
Goroutine stack and local variable allocation in Go
 
Multimaster
MultimasterMultimaster
Multimaster
 
Porting an MPI application to hybrid MPI+OpenMP with Reveal tool on Shaheen II
Porting an MPI application to hybrid MPI+OpenMP with Reveal tool on Shaheen IIPorting an MPI application to hybrid MPI+OpenMP with Reveal tool on Shaheen II
Porting an MPI application to hybrid MPI+OpenMP with Reveal tool on Shaheen II
 
A Fast and Efficient Time Series Storage Based on Apache Solr
A Fast and Efficient Time Series Storage Based on Apache SolrA Fast and Efficient Time Series Storage Based on Apache Solr
A Fast and Efficient Time Series Storage Based on Apache Solr
 
First Flink Bay Area meetup
First Flink Bay Area meetupFirst Flink Bay Area meetup
First Flink Bay Area meetup
 
Accelerate Your Python* Code through Profiling, Tuning, and Compilation Part ...
Accelerate Your Python* Code through Profiling, Tuning, and Compilation Part ...Accelerate Your Python* Code through Profiling, Tuning, and Compilation Part ...
Accelerate Your Python* Code through Profiling, Tuning, and Compilation Part ...
 
Apache Flink internals
Apache Flink internalsApache Flink internals
Apache Flink internals
 
HBaseCon 2012 | Lessons learned from OpenTSDB - Benoit Sigoure, StumbleUpon
HBaseCon 2012 | Lessons learned from OpenTSDB - Benoit Sigoure, StumbleUponHBaseCon 2012 | Lessons learned from OpenTSDB - Benoit Sigoure, StumbleUpon
HBaseCon 2012 | Lessons learned from OpenTSDB - Benoit Sigoure, StumbleUpon
 

Similaire à FOSDEM 2019: M3, Prometheus and Graphite with metrics and monitoring in an increasingly complex world

mloc.js 2014 - JavaScript and the browser as a platform for game development
mloc.js 2014 - JavaScript and the browser as a platform for game developmentmloc.js 2014 - JavaScript and the browser as a platform for game development
mloc.js 2014 - JavaScript and the browser as a platform for game development
David Galeano
 
The state of Spark in the cloud
The state of Spark in the cloudThe state of Spark in the cloud
The state of Spark in the cloud
Nicolas Poggi
 

Similaire à FOSDEM 2019: M3, Prometheus and Graphite with metrics and monitoring in an increasingly complex world (20)

OSMC 2018 | Learnings, patterns and Uber’s metrics platform M3, open sourced ...
OSMC 2018 | Learnings, patterns and Uber’s metrics platform M3, open sourced ...OSMC 2018 | Learnings, patterns and Uber’s metrics platform M3, open sourced ...
OSMC 2018 | Learnings, patterns and Uber’s metrics platform M3, open sourced ...
 
Big data Argentina meetup 2020-09: Intro to presto on docker
Big data Argentina meetup 2020-09: Intro to presto on dockerBig data Argentina meetup 2020-09: Intro to presto on docker
Big data Argentina meetup 2020-09: Intro to presto on docker
 
Data Science in the Cloud @StitchFix
Data Science in the Cloud @StitchFixData Science in the Cloud @StitchFix
Data Science in the Cloud @StitchFix
 
Argus Production Monitoring at Salesforce
Argus Production Monitoring at SalesforceArgus Production Monitoring at Salesforce
Argus Production Monitoring at Salesforce
 
Argus Production Monitoring at Salesforce
Argus Production Monitoring at Salesforce Argus Production Monitoring at Salesforce
Argus Production Monitoring at Salesforce
 
Netflix Open Source Meetup Season 4 Episode 2
Netflix Open Source Meetup Season 4 Episode 2Netflix Open Source Meetup Season 4 Episode 2
Netflix Open Source Meetup Season 4 Episode 2
 
SOSCON 2016 JerryScript
SOSCON 2016 JerryScriptSOSCON 2016 JerryScript
SOSCON 2016 JerryScript
 
NetflixOSS Meetup season 3 episode 1
NetflixOSS Meetup season 3 episode 1NetflixOSS Meetup season 3 episode 1
NetflixOSS Meetup season 3 episode 1
 
mloc.js 2014 - JavaScript and the browser as a platform for game development
mloc.js 2014 - JavaScript and the browser as a platform for game developmentmloc.js 2014 - JavaScript and the browser as a platform for game development
mloc.js 2014 - JavaScript and the browser as a platform for game development
 
Large-Scale Automated Storage on Kubernetes - Matt Schallert OSCON 2019
Large-Scale Automated Storage on Kubernetes - Matt Schallert OSCON 2019Large-Scale Automated Storage on Kubernetes - Matt Schallert OSCON 2019
Large-Scale Automated Storage on Kubernetes - Matt Schallert OSCON 2019
 
Big data @ Hootsuite analtyics
Big data @ Hootsuite analtyicsBig data @ Hootsuite analtyics
Big data @ Hootsuite analtyics
 
Sorry - How Bieber broke Google Cloud at Spotify
Sorry - How Bieber broke Google Cloud at SpotifySorry - How Bieber broke Google Cloud at Spotify
Sorry - How Bieber broke Google Cloud at Spotify
 
Using a Fast Operational Database to Build Real-time Streaming Aggregations
Using a Fast Operational Database to Build Real-time Streaming AggregationsUsing a Fast Operational Database to Build Real-time Streaming Aggregations
Using a Fast Operational Database to Build Real-time Streaming Aggregations
 
ApacheCon BigData Europe 2015
ApacheCon BigData Europe 2015 ApacheCon BigData Europe 2015
ApacheCon BigData Europe 2015
 
#TwitterRealTime - Real time processing @twitter
#TwitterRealTime - Real time processing @twitter#TwitterRealTime - Real time processing @twitter
#TwitterRealTime - Real time processing @twitter
 
Kubernetes @ Squarespace: Kubernetes in the Datacenter
Kubernetes @ Squarespace: Kubernetes in the DatacenterKubernetes @ Squarespace: Kubernetes in the Datacenter
Kubernetes @ Squarespace: Kubernetes in the Datacenter
 
Interview with Anatoliy Kuznetsov, the author of BitMagic C++ library
Interview with Anatoliy Kuznetsov, the author of BitMagic C++ libraryInterview with Anatoliy Kuznetsov, the author of BitMagic C++ library
Interview with Anatoliy Kuznetsov, the author of BitMagic C++ library
 
Launching Your First Big Data Project on AWS
Launching Your First Big Data Project on AWSLaunching Your First Big Data Project on AWS
Launching Your First Big Data Project on AWS
 
Pulsar summit asia 2021 apache pulsar with mqtt for edge computing
Pulsar summit asia 2021   apache pulsar with mqtt for edge computingPulsar summit asia 2021   apache pulsar with mqtt for edge computing
Pulsar summit asia 2021 apache pulsar with mqtt for edge computing
 
The state of Spark in the cloud
The state of Spark in the cloudThe state of Spark in the cloud
The state of Spark in the cloud
 

Dernier

AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
VictorSzoltysek
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
mohitmore19
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
VishalKumarJha10
 

Dernier (20)

The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
 

FOSDEM 2019: M3, Prometheus and Graphite with metrics and monitoring in an increasingly complex world

  • 1. February 3, 2019 fosdem.org Rob Skillington Observability and M3, Uber NYC M3 M3 and a new age of metrics and monitoring in an increasingly complex world
  • 2. ● Working on monitoring “observability” running computers now at Uber for 3 continuous years. ● Member of OpenMetrics, a CNCF project standardizing metrics exposition. See openmetrics.io for more info. Why am I here?
  • 4. Agenda ● High dimensionality metrics and monitoring in an increasingly complex world ● M3, Prometheus, Graphite
  • 6. ● Take a single metric, such as status code delivered by our frontends ○ http_status_code ● At Uber, we have roughly a few hundred important HTTP routes we want to drill down into the status code with the following dimensions: ○ Route (few hundred) ○ Status code (less than a few common status codes) ○ Places of operation (few hundred) ■ failures sometimes isolated to place of operation ○ App device version (few hundred) High dimensionality metrics
  • 7. You can roll up metrics to make viewing fast. For example, view status codes by route, but across all regions for all app versions. High dimensionality metrics status=2xx route=/request region=eu-west client=v1.2 status=2xx ... status=4xx route=/request status=5xx route=/request region=eu-north client=v1.3 status=2xx ... region=us-west client=v2.0 status=2xx ... region=eu-west client=v1.1 status=5xx ... region=eu-north client=v1.4 status=5xx ... region=us-west client=v2.3 status=5xx ... region=eu-west client=v3.2 status=5xx ... region=eu-north client=v3.1 status=5xx ...
  • 8. However, it is still incredibly high dimensional, just to store the raw data if you later want to drill down on. ● Routes (eg 500) * Status code (eg 5) * Region (eg 5) * Client version (eg 20) = 250,000 unique time series ● Expensive but not too bad..? However add any other dimensions and it gets out of control (any multiplier on 250k explodes to millions quickly). High dimensionality metrics status=5xx route=/request ... region=eu-west client=v1.0 status=5xx ... region=eu-north client=v1.3 status=5xx ... region=us-west client=v2.0 status=5xx ...
  • 9. High dimensionality metrics eu-north mysql frontend app redis client v1.3 client v2.0 eu-north mysql frontend app redis client v1.3 client v2.0
  • 10. High dimensionality metrics eu-north mysql frontend app redis client v1.3 client v2.0 eu-north mysql frontend app client v1.3 client v2.0 redis redis To determine what code path to debug, need to detect failure and isolate to: ● Region eu-north ● Client version v2.0
  • 11. ● A manageable way to scale out capacity ○ A single Prometheus instance can hold N million time series (where N does not usually reach the double digits, even on big machines) Ok great but what do I need? ”This is fine.. I’m okay with the events that are unfolding currently”
  • 12. ● It’s a little like playing tetris, can I fit my high cardinality metrics into an existing Prometheus instance or do I setup a new one, what happens when it eclipses a single instance? Ok great but what do I need?
  • 14. Uber Workload - Ingress ~700M Pre-aggregated Metrics/s (~130Gbps)
  • 15. Storage ~33M Metrics Stored/s (not including Replica Factor = 3) (~50Gbps)
  • 16. Index ~ 11B Unique Metric IDs (Equivalent of thousands of Prom instances)
  • 17. Egress ~ 1.5B data points per second (spikes to 5B+) powers dashboards and 150,000 scheduled “realtime” alerts (~20 gigabits/sec)
  • 18. M3, Prometheus and Graphite 18
  • 19. Prometheus Long Term Storage Prometheus Grafana Long Term Storage TSDB AlertManager Client / Endpoint Remote Read/Write (and aggregation)
  • 21. M3DB High-Level Architecture Think Log Structured Merge tree (LSM).. but with almost zero compaction. Typical LSM will have levelled or size based compaction, M3DB has time window compaction which by will avoid any compaction of time series data files. Also downsampling is done as data is streamed to the aggregators.
  • 22. ● Each time series data block contains a bloom filter, an index summaries file, a metadata per time series key and time series data file. ● The bloom filter is mmap’d and used for fast lookups to determine for large range scan, which blocks for should be searched on disk for a given metric. Bloom filter for each time series data block Bloom filter API Add([]byte) MaybeExists([]byte) bool
  • 23. Index File Binary search in memory Scan linearly starting at offset provided by summaries file binary search Summaries File Current value: dogCurrent value: barnCurrent value: boatCurrent value: cat cat Bloom Filter for 2pm to 4pm block Maybe exists Data File
  • 24. ● The inverted index is similar to Lucene, it uses FST segments to built an efficient and compressed structure for fast regexp, using Roaring Bitmaps to capture metric IDs associated to a label value. ● Each metric’s label/tag has it’s own FST that when searched can find the Roaring Bitmap mmap offset for the set of metric IDs associated with a label value. Inverted Index
  • 25. ● For every term combination in the form of service=”foo” need to store a set of metric IDs (integers) that match, this is called a “postings list”. ● {service=”foo”,endpoint=”bar”,client_version=”3”} ○ Do some index magic to find the 3 different sets that store service=”foo”, endpoint=”bar”and client_version=”3”. ○ Calculate the intersection (AND) of those 3 sets, and then retrieve those documents ● Index is broken into blocks and segments, so also need to be able to calculate union (OR) ○ Find sets that store service=”foo” postings list in the 12PM->2PM block and the 2PM->4 PM block and then calculate their union (OR) Postings Lists
  • 26. ● Bitmap Container ○ Exactly the same as a regular bitmap, but always from 0 -> 2^16 ○ (2^16) / 8 -> Always uses exactly 8KiB of memory ● Sorted Array Container ○ Sorted array of uint16 -> []uint16 ○ Grows dynamically ○ 2 bytes of memory per value ■ Minimum size: 2 bytes! ■ Maximum size: 131 KiB :( ● “Run” Container ○ Optimized for long sequences of continuous values ○ Array of uint16 pairs -> []struct{start, length uint16} ○ Ideal scenario: all numbers in a 2^16 range exist in the set -> 4 bytes of memory! Roaring Bitmap
  • 27. Roaring Bitmap ? ? ? ? ? ? ? ? 0 1 2 3 4 5 6 7Key Prefix Container Only need keys/containers for chunks that have data in that range, otherwise we can leave them out entirely. 0 -> 2^16 2^16 -> 2^17 2^17 -> 2^17 + 2^16 ... ... ... ... ...Values Stored ● Same APIs as a normal bitmap, but adapts to your workload ● Break the 2^32 number space into chunks of size 2^16 ○ (2^32) / (2^16) == 2^16 chunks of 2^16 ● For each chunk, store the values in that range within a “container” ○ Use a different container type for each chunk based on data density ● Can imagine it as a: map[uint16]*Container
  • 28. Roaring Bitmap ● Choose containers based on cardinality / presence of continuous sequences. ○ Can represent both sparse and dense sets efficiently. ○ Grows to very large integer spaces (uint64) due to the chunking mechanism. ● When union or intersection, stack the containers on top of each other and perform as efficient as possible set operation based on container types. Array Array Bitmap Bitmap Run Run null null 1 4095 4096 8000 65,536 0 -> 9,500 0 0Cardinality Container 0 1 2 3 4 5 6 7Key Prefix
  • 29. ● M3DB can be deployed on premise without any dependencies. ● M3DB also can run on Kubernetes and the M3DB k8s operator can manage your cluster. ○ See more at https://github.com/m3db/m3db-operator ● Just requires two roles M3DB and M3 Coordinator to get started. ● Clustered version open sourced and can scale to billions of time series. ● Read more at https://eng.uber.com/m3 Powerful but also kinda easy to use
  • 30. Graphite, Statsd, Carbon? Host Client Client Host Client Client Host Client Client M3 Query EngineM3DB PromQLProm M3 Coordinator Statsite Prom Statsd Carbon Relay Carbon Whisper DB Graphite Web Grafana Graphite
  • 31. Graphite, Statsd, Carbon? Host Client Client Host Client Client Host Client Client M3 Query EngineM3DB PromQLProm M3 Coordinator Statsite M3 Coordinator Prom Statsd Carbon Relay M3 Coordinator Carbon Whisper DB Graphite Web Grafana Graphite
  • 32. ● Multi-language with support for PromQL and Graphite ● Written in Go and can sustain much higher QPS than graphite-web ● More here https://eng.uber.com/billion-data-point-challenge M3 Query Engine
  • 33. Parallelized Compressed Blocks Series A Series B Series C Block 1 t1 t10 Compressed TS Compressed TS Compressed TS Block 2 t10 t20 Compressed TS Compressed TS Compressed TS Block 3 t20 t30 Compressed TS Compressed TS Compressed TS
  • 34. JIT Decompression + Lazy Function Evaluation Series A Series B Series C Block t1 t2 t3 t4 t5 t6...… Compressed TSCompressed TSRemaining Compressed TS368 Compressed TSCompressed TSRemaining Compressed TS Compressed TSCompressed TSRemaining Compressed TS 250 102 72 = (368 + 250 + 102) / 10 - scaleToSeconds function lazily evaluated after sum even though it precedes sum in the query. Result:
  • 35. Demo ● How to configure m3coordinator for ingesting Prometheus and Graphite metrics. ● Adding m3coordinator as a Prometheus and Graphite data source. ● Sending metrics and graphing them in Grafana. ● The setup for the demo is a gist on GitHub at http://bit.ly/m3fosdem.
  • 37. H1 2019 1. Better guides, simpler to configure and use out of the box. 2. Horizontally scalable metrics collection with OpenMetrics scraping from M3Collector and possibly M3Aggregator. 3. Horizontally Carbon and Statsd aggregation with M3Aggregator instead of manual HA and sharding configuration of Graphite metrics with M3Coordinator. H2 2019 Contribute and help discuss: - Mail (m3db@googlegroups.com) - Gitter (gitter.im/m3db) - GitHub issues (github.com/m3db/proposal/issues) Roadmap
  • 39. Questions? GitHub and Web https://github.com/m3db/m3, https://m3db.io Mailing List https://groups.google.com/forum/#!topic/m3db Gitter (like IRC, except.. it’s not IRC 😔) https://gitter.im/m3db M3 Eng Blog Post https://eng.uber.com/m3 (we’re hiring) M3
  • 40. Thank you Proprietary © 2018 Uber Technologies, Inc. All rights reserved. No part of this document may be reproduced or utilized in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage or retrieval systems, without permission in writing from Uber. This document is intended only for the use of the individual or entity to whom it is addressed. All recipients of this document are notified that the information contained herein includes proprietary information of Uber, and recipient may not make use of, disseminate, or in any way disclose this document or any of the enclosed information to any person other than employees of addressee to the extent necessary for consultations with authorized personnel of Uber. Questions: email ospo@uber.com Follow our Facebook page: www.facebook.com/uberopensource