SlideShare ist ein Scribd-Unternehmen logo
1 von 19
Brian Brazil
Founder
An Exploration of the
Formal Properties
of PromQL
Who am I?
A Computer Scientist passionate about expanding the field of CS, with a particular
interest on the question of the power of operational monitoring.
Winner of the Victor W. Graham prize for Pure Mathematics, and Scholar of
Computer Science in Trinity College Dublin.
Google SRE for 7 years, working on expanding the horizons of what was
considered possible with monitoring tools.
I also contribute to some obscure monitoring system, that'll only ever be of
academic interest as it uses pull and we all know that can't scale.
You probably haven't heard of it.
What is PromQL
Three parts:
Data model
Query language
Execution environment
Data model
PromQL's data model is based on "labels" and "samples", combining into "time
series".
A "time series" comprises a unique set of "labels" and one or more "samples".
"labels" are a set of pairs of strings, where the first of the pair is unique.
A sample is a pair of (int64, float64), within a "time series" the first of the pair is
unique.
What can we describe with this model?
List
{item="1"} (0, 7)
{item="2"} (0, -Inf)
{item="3"} (0, 3)
Grid
{x="1", y="1"} (0, 13)
{x="2", y="1"} (0, NaN)
{x="1", y="2"} (0, 90)
{x="2", y="2"} (0, .7)
Query language
Can select time series based on existence/non-existence of one or more of their
labels. From there there's a few broad classes of operations and functions:
Relational algebra on labels across time series
Functions on the samples within a time series
Operations/Functions on single samples across time series
Type conversion functions (PromQL is strongly and statically typed)
Display related functions
...and one function to manipulate labels.
Label Manipulation
Normally you can only work with labels that are the same, e.g. {x="1", y="1"}
and {x="2", y="1"} both have y="1".
The label_replace() function allows us to change the 1 to a 2 via regular
expressions.
Execution environment
The environment has a counter, and when looking across time series only the
samples with the first value between this counter and 300,000 less than it are
available. Of these the sample with the highest first value will be available.
In each cycle this counter increases, typically by 1,000 to 60,000.
Output of expressions executed in a cycle can be added to the data set, with the
first value of samples set to that of the counter.
Expressions are evaluated simultaneously, may see output of other expressions
from this cycle.
So how powerful is this language?
If we can model a list, can do relational algebra and can record new results each
cycle then we can use the list as a tape and build a Finite State Machine.
Been there, done that.
What else can we do that's as powerful, but a little more aesthetically pleasing?
Could build a grid and run a simple 2-dimensional cellular automata on top of it.
Automata
Go for something simple, only two states - 0 and 1.
Decimal would be hard for grid positions, so use unary numbering:
1 = 1, 2 = 11, 3 = 111, 4 = 1111 etc.
We'll have a time series called {__name__="init"} that's the size of the grid,
and all with the value 1.
The grid will be stored in{__name__="grid"}
For the edges of the grid, we'll do simple manipulation of the counter value to
generate random-ish values as there's no RNG available in PromQL.
If exactly three neighbours are 1, become 1
(
(
(
(label_replace(grid, "x", "$1", "x", "^1(.*)$") or init * scalar(round((vector(time()) + 0) % 8 / 8)))
+ (label_replace(grid, "x", "1$1", "x", "^(.*)$") or init * scalar(round((vector(time()) + 1) % 8 / 8)))
+ (label_replace(grid, "y", "$1", "y", "^1(.*)$") or init * scalar(round((vector(time()) + 2) % 8 / 8)))
+ (label_replace(grid, "y", "1$1", "y", "^(.*)$") or init * scalar(round((vector(time()) + 3) % 8 / 8)))
+ (label_replace(label_replace(grid, "y", "$1", "y", "^1(.*)$"), "x", "$1", "x", "^1(.*)$")
or init * scalar(round((vector(time()) + 4) % 8 / 8)))
+ (label_replace(label_replace(grid, "y", "$1", "y", "^1(.*)$"), "x", "1$1", "x", "^(.*)$")
or init * scalar(round((vector(time()) + 5) % 8 / 8)))
+ (label_replace(label_replace(grid, "y", "1$1", "y", "^(.*)$"), "x", "$1", "x", "^1(.*)$")
or init * scalar(round((vector(time()) + 6) % 8 / 8)))
+ (label_replace(label_replace(grid, "y", "1$1", "y", "^(.*)$"), "x", "1$1", "x", "^(.*)$")
or init * scalar(round((vector(time()) + 7) % 8 / 8)))
) == 3
) * 0 + 1
)
Public Health Warning
If you feel uneasiness, headaches or existential dread as a result of this
presentation stop watching immediately and consult your local Computer
Numerologist for advice.
Do not look at the PromQL expressions in these slides with the remaining eye.
Do not attempt to create PromQL expressions of this complexity without
professional advice.
If you discard this advice and summon an elder abomination from another realm,
Robust Perception Ltd. accepts no responsibility for a) your meddling in higher
mathematics or b) Charlie Stross having to throw away yet another book due to
reality getting weirder than fiction.
If you are 1 and exactly two neighbours are 1, stay 1
(
(
(
(grid == 1) * 0
+ (label_replace(grid, "x", "$1", "x", "^1(.*)$") or init * scalar(round((vector(time()) + 0) % 8 / 8)))
+ (label_replace(grid, "x", "1$1", "x", "^(.*)$") or init * scalar(round((vector(time()) + 1) % 8 / 8)))
+ (label_replace(grid, "y", "$1", "y", "^1(.*)$") or init * scalar(round((vector(time()) + 2) % 8 / 8)))
+ (label_replace(grid, "y", "1$1", "y", "^(.*)$") or init * scalar(round((vector(time()) + 3) % 8 / 8)))
+ (label_replace(label_replace(grid, "y", "$1", "y", "^1(.*)$"), "x", "$1", "x", "^1(.*)$")
or init * scalar(round((vector(time()) + 4) % 8 / 8)))
+ (label_replace(label_replace(grid, "y", "$1", "y", "^1(.*)$"), "x", "1$1", "x", "^(.*)$")
or init * scalar(round((vector(time()) + 5) % 8 / 8)))
+ (label_replace(label_replace(grid, "y", "1$1", "y", "^(.*)$"), "x", "$1", "x", "^1(.*)$")
or init * scalar(round((vector(time()) + 6) % 8 / 8)))
+ (label_replace(label_replace(grid, "y", "1$1", "y", "^(.*)$"), "x", "1$1", "x", "^(.*)$")
or init * scalar(round((vector(time()) + 7) % 8 / 8)))
) == 2
) * 0 + 1
)
Otherwise, become 0
init * 0
Joining these together
The or operator joins these together.
It'd be nice to have each in separate expressions and then do the or, but there's
no guarantee which order the expressions run in.
And we would pick up data from the wrong cycle (have to always specify all points
in the grid so everything is always overwritten).
What does this make?
What does this make?
Conway's Life
A cellular automaton devised in 1970 by John Conway.
It is known to be Turing Capable, proved by Conway in 1982.
Full Turing Machines have been implemented by Paul Rendell (2000), Paul
Chapman (2002), and Adam P. Goucher (2009).
This means that if it's possible to compute it on a computer, you can computer it in
Conway's Life, and thus in PromQL.
No monitoring system can have a language more powerful than PromQL!
Resources
Blog Post: http://www.robustperception.io/conways-life-in-prometheus/
Demo: http://demo.robustperception.io:9090/consoles/life.html
Robust Perception Blog: www.robustperception.io/blog
Queries: prometheus@robustperception.io

Weitere ähnliche Inhalte

Was ist angesagt?

Python 2.5 reference card (2009)
Python 2.5 reference card (2009)Python 2.5 reference card (2009)
Python 2.5 reference card (2009)
gekiaruj
 
Data structures in scala
Data structures in scalaData structures in scala
Data structures in scala
Meetu Maltiar
 
Bloom filter
Bloom filterBloom filter
Bloom filter
feng lee
 

Was ist angesagt? (20)

Functional Patterns for the non-mathematician
Functional Patterns for the non-mathematicianFunctional Patterns for the non-mathematician
Functional Patterns for the non-mathematician
 
Modern Algorithms and Data Structures - 1. Bloom Filters, Merkle Trees
Modern Algorithms and Data Structures - 1. Bloom Filters, Merkle TreesModern Algorithms and Data Structures - 1. Bloom Filters, Merkle Trees
Modern Algorithms and Data Structures - 1. Bloom Filters, Merkle Trees
 
(2015 06-16) Three Approaches to Monads
(2015 06-16) Three Approaches to Monads(2015 06-16) Three Approaches to Monads
(2015 06-16) Three Approaches to Monads
 
Python3 cheatsheet
Python3 cheatsheetPython3 cheatsheet
Python3 cheatsheet
 
Seminar psu 20.10.2013
Seminar psu 20.10.2013Seminar psu 20.10.2013
Seminar psu 20.10.2013
 
Python data structures
Python data structuresPython data structures
Python data structures
 
Coffee Scriptでenchant.js
Coffee Scriptでenchant.jsCoffee Scriptでenchant.js
Coffee Scriptでenchant.js
 
JAVA 8 : Migration et enjeux stratégiques en entreprise
JAVA 8 : Migration et enjeux stratégiques en entrepriseJAVA 8 : Migration et enjeux stratégiques en entreprise
JAVA 8 : Migration et enjeux stratégiques en entreprise
 
Collection and framework
Collection and frameworkCollection and framework
Collection and framework
 
NumPy Refresher
NumPy RefresherNumPy Refresher
NumPy Refresher
 
The Ring programming language version 1.10 book - Part 45 of 212
The Ring programming language version 1.10 book - Part 45 of 212The Ring programming language version 1.10 book - Part 45 of 212
The Ring programming language version 1.10 book - Part 45 of 212
 
Python 2.5 reference card (2009)
Python 2.5 reference card (2009)Python 2.5 reference card (2009)
Python 2.5 reference card (2009)
 
Data structures in scala
Data structures in scalaData structures in scala
Data structures in scala
 
Google collections api an introduction
Google collections api   an introductionGoogle collections api   an introduction
Google collections api an introduction
 
Python_ 3 CheatSheet
Python_ 3 CheatSheetPython_ 3 CheatSheet
Python_ 3 CheatSheet
 
Seminar PSU 10.10.2014 mme
Seminar PSU 10.10.2014 mmeSeminar PSU 10.10.2014 mme
Seminar PSU 10.10.2014 mme
 
Data import-cheatsheet
Data import-cheatsheetData import-cheatsheet
Data import-cheatsheet
 
Data transformation-cheatsheet
Data transformation-cheatsheetData transformation-cheatsheet
Data transformation-cheatsheet
 
Scala collections
Scala collectionsScala collections
Scala collections
 
Bloom filter
Bloom filterBloom filter
Bloom filter
 

Andere mochten auch

Andere mochten auch (20)

An Introduction to Prometheus (GrafanaCon 2016)
An Introduction to Prometheus (GrafanaCon 2016)An Introduction to Prometheus (GrafanaCon 2016)
An Introduction to Prometheus (GrafanaCon 2016)
 
What does "monitoring" mean? (FOSDEM 2017)
What does "monitoring" mean? (FOSDEM 2017)What does "monitoring" mean? (FOSDEM 2017)
What does "monitoring" mean? (FOSDEM 2017)
 
So You Want to Write an Exporter
So You Want to Write an ExporterSo You Want to Write an Exporter
So You Want to Write an Exporter
 
Microservices and Prometheus (Microservices NYC 2016)
Microservices and Prometheus (Microservices NYC 2016)Microservices and Prometheus (Microservices NYC 2016)
Microservices and Prometheus (Microservices NYC 2016)
 
Provisioning and Capacity Planning (Travel Meets Big Data)
Provisioning and Capacity Planning (Travel Meets Big Data)Provisioning and Capacity Planning (Travel Meets Big Data)
Provisioning and Capacity Planning (Travel Meets Big Data)
 
Prometheus: A Next Generation Monitoring System (FOSDEM 2016)
Prometheus: A Next Generation Monitoring System (FOSDEM 2016)Prometheus: A Next Generation Monitoring System (FOSDEM 2016)
Prometheus: A Next Generation Monitoring System (FOSDEM 2016)
 
Prometheus Overview
Prometheus OverviewPrometheus Overview
Prometheus Overview
 
Ansible at FOSDEM (Ansible Dublin, 2016)
Ansible at FOSDEM (Ansible Dublin, 2016)Ansible at FOSDEM (Ansible Dublin, 2016)
Ansible at FOSDEM (Ansible Dublin, 2016)
 
Prometheus - Open Source Forum Japan
Prometheus  - Open Source Forum JapanPrometheus  - Open Source Forum Japan
Prometheus - Open Source Forum Japan
 
Prometheus and Docker (Docker Galway, November 2015)
Prometheus and Docker (Docker Galway, November 2015)Prometheus and Docker (Docker Galway, November 2015)
Prometheus and Docker (Docker Galway, November 2015)
 
Monitoring Hadoop with Prometheus (Hadoop User Group Ireland, December 2015)
Monitoring Hadoop with Prometheus (Hadoop User Group Ireland, December 2015)Monitoring Hadoop with Prometheus (Hadoop User Group Ireland, December 2015)
Monitoring Hadoop with Prometheus (Hadoop User Group Ireland, December 2015)
 
Monitoring What Matters: The Prometheus Approach to Whitebox Monitoring (Berl...
Monitoring What Matters: The Prometheus Approach to Whitebox Monitoring (Berl...Monitoring What Matters: The Prometheus Approach to Whitebox Monitoring (Berl...
Monitoring What Matters: The Prometheus Approach to Whitebox Monitoring (Berl...
 
Systems Monitoring with Prometheus (Devops Ireland April 2015)
Systems Monitoring with Prometheus (Devops Ireland April 2015)Systems Monitoring with Prometheus (Devops Ireland April 2015)
Systems Monitoring with Prometheus (Devops Ireland April 2015)
 
Prometheus (Microsoft, 2016)
Prometheus (Microsoft, 2016)Prometheus (Microsoft, 2016)
Prometheus (Microsoft, 2016)
 
Better Monitoring for Python: Inclusive Monitoring with Prometheus (Pycon Ire...
Better Monitoring for Python: Inclusive Monitoring with Prometheus (Pycon Ire...Better Monitoring for Python: Inclusive Monitoring with Prometheus (Pycon Ire...
Better Monitoring for Python: Inclusive Monitoring with Prometheus (Pycon Ire...
 
Your data is in Prometheus, now what? (CurrencyFair Engineering Meetup, 2016)
Your data is in Prometheus, now what? (CurrencyFair Engineering Meetup, 2016)Your data is in Prometheus, now what? (CurrencyFair Engineering Meetup, 2016)
Your data is in Prometheus, now what? (CurrencyFair Engineering Meetup, 2016)
 
Monitoring Kubernetes with Prometheus (Kubernetes Ireland, 2016)
Monitoring Kubernetes with Prometheus (Kubernetes Ireland, 2016)Monitoring Kubernetes with Prometheus (Kubernetes Ireland, 2016)
Monitoring Kubernetes with Prometheus (Kubernetes Ireland, 2016)
 
Life of a Label (PromCon2016, Berlin)
Life of a Label (PromCon2016, Berlin)Life of a Label (PromCon2016, Berlin)
Life of a Label (PromCon2016, Berlin)
 
Prometheus (Prometheus London, 2016)
Prometheus (Prometheus London, 2016)Prometheus (Prometheus London, 2016)
Prometheus (Prometheus London, 2016)
 
Kubernetes and Prometheus
Kubernetes and PrometheusKubernetes and Prometheus
Kubernetes and Prometheus
 

Ähnlich wie An Exploration of the Formal Properties of PromQL

Underscore.js
Underscore.jsUnderscore.js
Underscore.js
timourian
 
Useful javascript
Useful javascriptUseful javascript
Useful javascript
Lei Kang
 
Introduction to MatLab programming
Introduction to MatLab programmingIntroduction to MatLab programming
Introduction to MatLab programming
Damian T. Gordon
 

Ähnlich wie An Exploration of the Formal Properties of PromQL (20)

Google Guava for cleaner code
Google Guava for cleaner codeGoogle Guava for cleaner code
Google Guava for cleaner code
 
Underscore.js
Underscore.jsUnderscore.js
Underscore.js
 
Spark_Documentation_Template1
Spark_Documentation_Template1Spark_Documentation_Template1
Spark_Documentation_Template1
 
Table of Useful R commands.
Table of Useful R commands.Table of Useful R commands.
Table of Useful R commands.
 
Beginning Scala Svcc 2009
Beginning Scala Svcc 2009Beginning Scala Svcc 2009
Beginning Scala Svcc 2009
 
C++ STL (quickest way to learn, even for absolute beginners).pptx
C++ STL (quickest way to learn, even for absolute beginners).pptxC++ STL (quickest way to learn, even for absolute beginners).pptx
C++ STL (quickest way to learn, even for absolute beginners).pptx
 
C++ STL (quickest way to learn, even for absolute beginners).pptx
C++ STL (quickest way to learn, even for absolute beginners).pptxC++ STL (quickest way to learn, even for absolute beginners).pptx
C++ STL (quickest way to learn, even for absolute beginners).pptx
 
Useful javascript
Useful javascriptUseful javascript
Useful javascript
 
Learn Matlab
Learn MatlabLearn Matlab
Learn Matlab
 
An introduction to Google test framework
An introduction to Google test frameworkAn introduction to Google test framework
An introduction to Google test framework
 
Lambda? You Keep Using that Letter
Lambda? You Keep Using that LetterLambda? You Keep Using that Letter
Lambda? You Keep Using that Letter
 
Monads and Monoids by Oleksiy Dyagilev
Monads and Monoids by Oleksiy DyagilevMonads and Monoids by Oleksiy Dyagilev
Monads and Monoids by Oleksiy Dyagilev
 
Introduction to Scala
Introduction to ScalaIntroduction to Scala
Introduction to Scala
 
Into Clojure
Into ClojureInto Clojure
Into Clojure
 
Introduction to MatLab programming
Introduction to MatLab programmingIntroduction to MatLab programming
Introduction to MatLab programming
 
Stata Programming Cheat Sheet
Stata Programming Cheat SheetStata Programming Cheat Sheet
Stata Programming Cheat Sheet
 
Introduction to parallel and distributed computation with spark
Introduction to parallel and distributed computation with sparkIntroduction to parallel and distributed computation with spark
Introduction to parallel and distributed computation with spark
 
Scala Collections
Scala CollectionsScala Collections
Scala Collections
 
Scala collections api expressivity and brevity upgrade from java
Scala collections api  expressivity and brevity upgrade from javaScala collections api  expressivity and brevity upgrade from java
Scala collections api expressivity and brevity upgrade from java
 
Intoduction to numpy
Intoduction to numpyIntoduction to numpy
Intoduction to numpy
 

Mehr von Brian Brazil

Mehr von Brian Brazil (13)

OpenMetrics: What Does It Mean for You (PromCon 2019, Munich)
OpenMetrics: What Does It Mean for You (PromCon 2019, Munich)OpenMetrics: What Does It Mean for You (PromCon 2019, Munich)
OpenMetrics: What Does It Mean for You (PromCon 2019, Munich)
 
Evolution of Monitoring and Prometheus (Dublin 2018)
Evolution of Monitoring and Prometheus (Dublin 2018)Evolution of Monitoring and Prometheus (Dublin 2018)
Evolution of Monitoring and Prometheus (Dublin 2018)
 
Evaluating Prometheus Knowledge in Interviews (PromCon 2018)
Evaluating Prometheus Knowledge in Interviews (PromCon 2018)Evaluating Prometheus Knowledge in Interviews (PromCon 2018)
Evaluating Prometheus Knowledge in Interviews (PromCon 2018)
 
Anatomy of a Prometheus Client Library (PromCon 2018)
Anatomy of a Prometheus Client Library (PromCon 2018)Anatomy of a Prometheus Client Library (PromCon 2018)
Anatomy of a Prometheus Client Library (PromCon 2018)
 
Prometheus for Monitoring Metrics (Fermilab 2018)
Prometheus for Monitoring Metrics (Fermilab 2018)Prometheus for Monitoring Metrics (Fermilab 2018)
Prometheus for Monitoring Metrics (Fermilab 2018)
 
Evolving Prometheus for the Cloud Native World (FOSDEM 2018)
Evolving Prometheus for the Cloud Native World (FOSDEM 2018)Evolving Prometheus for the Cloud Native World (FOSDEM 2018)
Evolving Prometheus for the Cloud Native World (FOSDEM 2018)
 
Prometheus for Monitoring Metrics (Percona Live Europe 2017)
Prometheus for Monitoring Metrics (Percona Live Europe 2017)Prometheus for Monitoring Metrics (Percona Live Europe 2017)
Prometheus for Monitoring Metrics (Percona Live Europe 2017)
 
Evolution of the Prometheus TSDB (Percona Live Europe 2017)
Evolution of the Prometheus TSDB  (Percona Live Europe 2017)Evolution of the Prometheus TSDB  (Percona Live Europe 2017)
Evolution of the Prometheus TSDB (Percona Live Europe 2017)
 
Staleness and Isolation in Prometheus 2.0 (PromCon 2017)
Staleness and Isolation in Prometheus 2.0 (PromCon 2017)Staleness and Isolation in Prometheus 2.0 (PromCon 2017)
Staleness and Isolation in Prometheus 2.0 (PromCon 2017)
 
Rule 110 for Prometheus (PromCon 2017)
Rule 110 for Prometheus (PromCon 2017)Rule 110 for Prometheus (PromCon 2017)
Rule 110 for Prometheus (PromCon 2017)
 
Counting with Prometheus (CloudNativeCon+Kubecon Europe 2017)
Counting with Prometheus (CloudNativeCon+Kubecon Europe 2017)Counting with Prometheus (CloudNativeCon+Kubecon Europe 2017)
Counting with Prometheus (CloudNativeCon+Kubecon Europe 2017)
 
Prometheus: From Berlin to Bonanza (Keynote CloudNativeCon+Kubecon Europe 2017)
Prometheus:  From Berlin to Bonanza (Keynote CloudNativeCon+Kubecon Europe 2017)Prometheus:  From Berlin to Bonanza (Keynote CloudNativeCon+Kubecon Europe 2017)
Prometheus: From Berlin to Bonanza (Keynote CloudNativeCon+Kubecon Europe 2017)
 
Prometheus (Monitorama 2016)
Prometheus (Monitorama 2016)Prometheus (Monitorama 2016)
Prometheus (Monitorama 2016)
 

Kürzlich hochgeladen

Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝
soniya singh
 
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
Call Girls In Delhi Whatsup 9873940964 Enjoy Unlimited Pleasure
 
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRLLucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
imonikaupta
 
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptxAWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
ellan12
 
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
soniya singh
 
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Chandigarh Call girls 9053900678 Call girls in Chandigarh
 

Kürzlich hochgeladen (20)

Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
 
On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024
 
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...
 
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝
 
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
 
VVVIP Call Girls In Connaught Place ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
VVVIP Call Girls In Connaught Place ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...VVVIP Call Girls In Connaught Place ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
VVVIP Call Girls In Connaught Place ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
 
Russian Call Girls Pune (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...
Russian Call Girls Pune  (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...Russian Call Girls Pune  (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...
Russian Call Girls Pune (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...
 
(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7
(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7
(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7
 
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providersMoving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
 
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
 
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
 
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service AvailableCall Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
 
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRLLucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
 
Russian Call girl in Ajman +971563133746 Ajman Call girl Service
Russian Call girl in Ajman +971563133746 Ajman Call girl ServiceRussian Call girl in Ajman +971563133746 Ajman Call girl Service
Russian Call girl in Ajman +971563133746 Ajman Call girl Service
 
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptxAWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
 
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
 
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubai
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls DubaiDubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubai
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubai
 
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
 
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
 
(+971568250507 ))# Young Call Girls in Ajman By Pakistani Call Girls in ...
(+971568250507  ))#  Young Call Girls  in Ajman  By Pakistani Call Girls  in ...(+971568250507  ))#  Young Call Girls  in Ajman  By Pakistani Call Girls  in ...
(+971568250507 ))# Young Call Girls in Ajman By Pakistani Call Girls in ...
 

An Exploration of the Formal Properties of PromQL

  • 1. Brian Brazil Founder An Exploration of the Formal Properties of PromQL
  • 2. Who am I? A Computer Scientist passionate about expanding the field of CS, with a particular interest on the question of the power of operational monitoring. Winner of the Victor W. Graham prize for Pure Mathematics, and Scholar of Computer Science in Trinity College Dublin. Google SRE for 7 years, working on expanding the horizons of what was considered possible with monitoring tools. I also contribute to some obscure monitoring system, that'll only ever be of academic interest as it uses pull and we all know that can't scale. You probably haven't heard of it.
  • 3. What is PromQL Three parts: Data model Query language Execution environment
  • 4. Data model PromQL's data model is based on "labels" and "samples", combining into "time series". A "time series" comprises a unique set of "labels" and one or more "samples". "labels" are a set of pairs of strings, where the first of the pair is unique. A sample is a pair of (int64, float64), within a "time series" the first of the pair is unique.
  • 5. What can we describe with this model? List {item="1"} (0, 7) {item="2"} (0, -Inf) {item="3"} (0, 3) Grid {x="1", y="1"} (0, 13) {x="2", y="1"} (0, NaN) {x="1", y="2"} (0, 90) {x="2", y="2"} (0, .7)
  • 6. Query language Can select time series based on existence/non-existence of one or more of their labels. From there there's a few broad classes of operations and functions: Relational algebra on labels across time series Functions on the samples within a time series Operations/Functions on single samples across time series Type conversion functions (PromQL is strongly and statically typed) Display related functions ...and one function to manipulate labels.
  • 7. Label Manipulation Normally you can only work with labels that are the same, e.g. {x="1", y="1"} and {x="2", y="1"} both have y="1". The label_replace() function allows us to change the 1 to a 2 via regular expressions.
  • 8. Execution environment The environment has a counter, and when looking across time series only the samples with the first value between this counter and 300,000 less than it are available. Of these the sample with the highest first value will be available. In each cycle this counter increases, typically by 1,000 to 60,000. Output of expressions executed in a cycle can be added to the data set, with the first value of samples set to that of the counter. Expressions are evaluated simultaneously, may see output of other expressions from this cycle.
  • 9. So how powerful is this language? If we can model a list, can do relational algebra and can record new results each cycle then we can use the list as a tape and build a Finite State Machine. Been there, done that. What else can we do that's as powerful, but a little more aesthetically pleasing? Could build a grid and run a simple 2-dimensional cellular automata on top of it.
  • 10. Automata Go for something simple, only two states - 0 and 1. Decimal would be hard for grid positions, so use unary numbering: 1 = 1, 2 = 11, 3 = 111, 4 = 1111 etc. We'll have a time series called {__name__="init"} that's the size of the grid, and all with the value 1. The grid will be stored in{__name__="grid"} For the edges of the grid, we'll do simple manipulation of the counter value to generate random-ish values as there's no RNG available in PromQL.
  • 11. If exactly three neighbours are 1, become 1 ( ( ( (label_replace(grid, "x", "$1", "x", "^1(.*)$") or init * scalar(round((vector(time()) + 0) % 8 / 8))) + (label_replace(grid, "x", "1$1", "x", "^(.*)$") or init * scalar(round((vector(time()) + 1) % 8 / 8))) + (label_replace(grid, "y", "$1", "y", "^1(.*)$") or init * scalar(round((vector(time()) + 2) % 8 / 8))) + (label_replace(grid, "y", "1$1", "y", "^(.*)$") or init * scalar(round((vector(time()) + 3) % 8 / 8))) + (label_replace(label_replace(grid, "y", "$1", "y", "^1(.*)$"), "x", "$1", "x", "^1(.*)$") or init * scalar(round((vector(time()) + 4) % 8 / 8))) + (label_replace(label_replace(grid, "y", "$1", "y", "^1(.*)$"), "x", "1$1", "x", "^(.*)$") or init * scalar(round((vector(time()) + 5) % 8 / 8))) + (label_replace(label_replace(grid, "y", "1$1", "y", "^(.*)$"), "x", "$1", "x", "^1(.*)$") or init * scalar(round((vector(time()) + 6) % 8 / 8))) + (label_replace(label_replace(grid, "y", "1$1", "y", "^(.*)$"), "x", "1$1", "x", "^(.*)$") or init * scalar(round((vector(time()) + 7) % 8 / 8))) ) == 3 ) * 0 + 1 )
  • 12. Public Health Warning If you feel uneasiness, headaches or existential dread as a result of this presentation stop watching immediately and consult your local Computer Numerologist for advice. Do not look at the PromQL expressions in these slides with the remaining eye. Do not attempt to create PromQL expressions of this complexity without professional advice. If you discard this advice and summon an elder abomination from another realm, Robust Perception Ltd. accepts no responsibility for a) your meddling in higher mathematics or b) Charlie Stross having to throw away yet another book due to reality getting weirder than fiction.
  • 13. If you are 1 and exactly two neighbours are 1, stay 1 ( ( ( (grid == 1) * 0 + (label_replace(grid, "x", "$1", "x", "^1(.*)$") or init * scalar(round((vector(time()) + 0) % 8 / 8))) + (label_replace(grid, "x", "1$1", "x", "^(.*)$") or init * scalar(round((vector(time()) + 1) % 8 / 8))) + (label_replace(grid, "y", "$1", "y", "^1(.*)$") or init * scalar(round((vector(time()) + 2) % 8 / 8))) + (label_replace(grid, "y", "1$1", "y", "^(.*)$") or init * scalar(round((vector(time()) + 3) % 8 / 8))) + (label_replace(label_replace(grid, "y", "$1", "y", "^1(.*)$"), "x", "$1", "x", "^1(.*)$") or init * scalar(round((vector(time()) + 4) % 8 / 8))) + (label_replace(label_replace(grid, "y", "$1", "y", "^1(.*)$"), "x", "1$1", "x", "^(.*)$") or init * scalar(round((vector(time()) + 5) % 8 / 8))) + (label_replace(label_replace(grid, "y", "1$1", "y", "^(.*)$"), "x", "$1", "x", "^1(.*)$") or init * scalar(round((vector(time()) + 6) % 8 / 8))) + (label_replace(label_replace(grid, "y", "1$1", "y", "^(.*)$"), "x", "1$1", "x", "^(.*)$") or init * scalar(round((vector(time()) + 7) % 8 / 8))) ) == 2 ) * 0 + 1 )
  • 15. Joining these together The or operator joins these together. It'd be nice to have each in separate expressions and then do the or, but there's no guarantee which order the expressions run in. And we would pick up data from the wrong cycle (have to always specify all points in the grid so everything is always overwritten).
  • 16. What does this make?
  • 17. What does this make?
  • 18. Conway's Life A cellular automaton devised in 1970 by John Conway. It is known to be Turing Capable, proved by Conway in 1982. Full Turing Machines have been implemented by Paul Rendell (2000), Paul Chapman (2002), and Adam P. Goucher (2009). This means that if it's possible to compute it on a computer, you can computer it in Conway's Life, and thus in PromQL. No monitoring system can have a language more powerful than PromQL!
  • 19. Resources Blog Post: http://www.robustperception.io/conways-life-in-prometheus/ Demo: http://demo.robustperception.io:9090/consoles/life.html Robust Perception Blog: www.robustperception.io/blog Queries: prometheus@robustperception.io