SlideShare una empresa de Scribd logo
1 de 24
Descargar para leer sin conexión
Prometheus as exposition
format for eBPF programs
running on k8s
Leonardo Di Donato. Open Source Software Engineer @ Sysdig.
2019.05.18 - Cloud_Native Rejekts EU - Barcelona, Spain
whoami
Leonardo Di Donato.
Maintainer of Falco.
Creator of kubectl-trace and go-syslog.
Reach me out @leodido.
@leodido
• Old buzzword.
• Is this SNMP? 😂
• Focus on collecting, persisting, and alerting
on just any data!
• It might also become simply garbage.
• Data lake.
• Doing it well requires a strategy.
• Uninformed monitoring equals hope.
Monitoring
The missing buzzwords
Wait, another really cool buzzword is Tracing!
• Ability of a system to give to humans
insights.
• Humans can observe, understand, and act on
the presented state of an observable system.
• Ability to make deductions about internal
state only looking at boundaries (inputs vs
outputs).
• Never truly achieved. Ongoing process and
mindset.
• Avoid black box data. Extract fine-grained
and meaningful data.
Observability
@leodido
• Monitoring landscape very fragmented
• Many solutions
• with ancient tech
• Proprietary data formats
• often not completely impl. or undocumented or ...
• Hierarchical data models
• Metrics? W00t?
Before Prometheus
But there’s a thing ...
• De-facto standard
• Cloud-native metric monitoring
• Ease of use
• Explosion of /metrics endpoints
After Prometheus
The journey so far
What if we could exploit Prometheus
(or OpenMetrics) exposition format’s
awesomeness without having to
punctually instrument applications?
Can we avoid to clog our applications
through eBPF superpowers?
eBFP superpowers
@leodido
What eBPF is
You can now write mini programs that run on events like disk I/O
which are run in a safe virtual machine in the kernel.
In-kernel verifier refuses to load eBPF programs with invalid
pointer dereferences, exceeding maximum call stack, or with loop
without an upper bound.
Imposes a stable Application Binary Interface (ABI).
BPF on steroids 🚀
A core part of the Linux kernel.
@leodido
@leodido
userspace
program
bpf() syscall
eBPF program ...
user-space
kernel
eBPF map
BPF_MAP_CREATE
BPF_MAP_LOOKUP_ELEM
BPF_MAP_UPDATE_ELEM
BPF_MAP_DELETE_ELEM
BPF_MAP_GET_NEXT_KEY
http://bit.ly/bpf_map_types 📎
BPF_PROG_TYPE_SOCKET_FILTER
BPF_PROG_TYPE_KPROBE
BPF_PROG_TYPE_TRACEPOINT
BPF_PROG_TYPE_RAW_TRACEPOINT
BPF_PROG_TYPE_XDP
BPF_PROG_TYPE_PERF_EVENT
BPF_PROG_TYPE_CGROUP_SKB
BPF_PROG_TYPE_CGROUP_SOCK
BPF_PROG_TYPE_SOCK_OPS
BPF_PROG_TYPE_SK_SKB
BPF_PROG_TYPE_SK_MSG
BPF_PROG_TYPE_SCHED_CLS
BPF_PROG_TYPE_SCHED_ACT
📎 http://bit.ly/bpf_prog_types
eBPF program
How does eBFP work?
• fully programmable
• can trace everything in a system
• not limited to a specific application
• unified tracing interface for both kernel and
userspace
• [k,u]probes, (dtrace)tracepoints and so on
are also used by other tools
• minimal (negligible) performance impact
• attach JIT native compiled instrumentation
code
• no long suspensions of execution
Advantages
• requires a fairly recent kernel
• definitely not for debugging
• no knowledge of the calling higher level
language implementation
• not fully running in user space
• kernel-user context (usually negligible)
switch when eBPF instrument a user process
• still not portable as other tracers
• VM primarily developer in the Linux kernel
(work-in-progress portings btw)
Disadvantages
Why use eBPF at all to trace userspace processes?
@leodido
BFP operator for
Kubernetes
Why don’t we make eBPF programs look
more YAML ✌✌✌
📎 http://bit.ly/k8s_crd
An extension of the
K8S API that let you
store and retrieve
structured data.
Custom resources
📎 http://bit.ly/k8s_shared_informers
The actual control
loop that watches the
shared state using the
workqueue.
Shared informers
📎
http://bit.ly/k8s_custom_controllers
It declares and
specifies the desired
state of your resource
continuously trying to
match it with the
actual state.
Controllers
Customize all the things
@leodido
BPF
runner
bpf()
syscall
eBPF
program
...
user-space
kernel
eBPF
map
eBPF
program
...
BPF
runner
bpf()
syscall
eBPF
program
...
user-space
kernel
eBPF
map
eBPF
program
BPF
CRD
Here’s the evil plan
:9387/metrics :9387/metrics
@leodido
Did y’all say
Y’AML?!
let’s put some ELF magic
in it...
🧝‍♂🤯🧙‍♂
@leodido
Count packets by protocol Count sys_enter_write by process ID
macro to generate sections inside the object file (later interpreted by the ELF BPF loader)
@leodido
Compile and inspect
This is important because communicates to set the
current running kernel version!
Tricky and controversial legal thing about
licenses ...
The bpf_prog_load() wrapper also has a license
parameter to provide the license that applies to
the eBPF program being loaded.
Not GPL-compatible license?
Kernel won’t load you eBPF!
Exceptions applies...
eBPF
Maps
@leodido
@leodido
@leodido
Demo time
Doing all the BPF things, with YAML 💦
@leodido
📎 asciinema
@leodido
# HELP test_packets No. of packets per protocol (key), node
# TYPE test_packets counter
test_packets{key="00001",node="127.0.0.1"} 8
test_packets{key="00002",node="127.0.0.1"} 1
test_packets{key="00006",node="127.0.0.1"} 551
test_packets{key="00008",node="127.0.0.1"} 1
test_packets{key="00017",node="127.0.0.1"} 15930
test_packets{key="00089",node="127.0.0.1"} 9
test_packets{key="00233",node="127.0.0.1"} 1
# EOF
It is a WIP project but already open source! 🎺
Check it out @ gh:bfptools/kube-bpf 🔗
ip-10-12-0-136.ec2.internal:9387/metrics
# <- ICMP
# <- IGMP
# <- TCP
# <- EGP
# <- UDP
# <- OSPF
# <- ?
@leodido
# HELP test_dummy No. sys_enter_write calls per PID (key), node
# TYPE test_dummy counter
test_dummy{key="00001",node="127.0.0.1"} ...
test_dummy{key="00001",node="127.0.0.1"} 8
test_dummy{key="00295",node="127.0.0.1"} 1
test_dummy{key="01278",node="127.0.0.1"} 1158
test_dummy{key="04690",node="127.0.0.1"} 209
test_dummy{key="04691",node="127.0.0.1"} 889
# EOF
It is a WIP project but already open source! 🎺
Check it out @ gh:bfptools/kube-bpf 🔗
ip-10-12-0-122.ec2.internal:9387/metrics
@leodido
It is a WIP project but already open source! 🎺
Check it out @ gh:bfptools/kube-bpf 🔗
@leodido
kubectl-trace
More eBPF + k8s
Run bpftrace program (from file)
Ctrl-C tells the
program to
plot the results
using hist()
The output histogram
Maps
@leodido
• Prometheus exposition format is here to stay given how simple it is 📊
• OpenMetrics will introduce improvements on such giant shoulders 📈
• We cannot monitor and observe everything from inside our applications 🎯
• We might want to have a look at the orchestrator (context) our apps live
and die in 🕸
• Kubernetes can be extended to achieve such levels of integrations 🔌
• ELF is cool 🧝
• We look for better tools (eBPF) for grabbing our metrics and even more 🔮
• Almost nullify footprint ⚡
• Enable a wider range of available data 🌊
• Do not touch our applications directly 👻
• There is a PoC doing some magic at gh:bfptools/kube-bpf 🧞
Key takeaways
Thanks.
Reach me out @leodido on twitter & github!
SEE Y’ALL AROUND AT KUBECON
http://bit.ly/prometheus_ebpf_k8s

Más contenido relacionado

Similar a Prometheus as exposition format for eBPF programs running on Kubernetes

Cats And Dogs Living Together: Langsec Is Also About Usability
Cats And Dogs Living Together: Langsec Is Also About UsabilityCats And Dogs Living Together: Langsec Is Also About Usability
Cats And Dogs Living Together: Langsec Is Also About UsabilityMeredith Patterson
 
Programando o ESP8266 com Python
Programando o ESP8266 com PythonProgramando o ESP8266 com Python
Programando o ESP8266 com PythonRelsi Maron
 
PyParis 2017 / Writing a C Python extension in 2017, Jean-Baptiste Aviat
PyParis 2017 / Writing a C Python extension in 2017, Jean-Baptiste Aviat PyParis 2017 / Writing a C Python extension in 2017, Jean-Baptiste Aviat
PyParis 2017 / Writing a C Python extension in 2017, Jean-Baptiste Aviat Pôle Systematic Paris-Region
 
NanoSec Conference 2019: Code Execution Analysis in Mobile Apps - Abdullah Jo...
NanoSec Conference 2019: Code Execution Analysis in Mobile Apps - Abdullah Jo...NanoSec Conference 2019: Code Execution Analysis in Mobile Apps - Abdullah Jo...
NanoSec Conference 2019: Code Execution Analysis in Mobile Apps - Abdullah Jo...Hafez Kamal
 
DEF CON 27- BRIZENDINE STROSCHEIN - the jop rocket
DEF CON 27- BRIZENDINE STROSCHEIN - the jop rocketDEF CON 27- BRIZENDINE STROSCHEIN - the jop rocket
DEF CON 27- BRIZENDINE STROSCHEIN - the jop rocketFelipe Prado
 
Overview Of Parallel Development - Ericnel
Overview Of Parallel Development -  EricnelOverview Of Parallel Development -  Ericnel
Overview Of Parallel Development - Ericnelukdpe
 
Who pulls the strings?
Who pulls the strings?Who pulls the strings?
Who pulls the strings?Ronny
 
Writing Fast Code (JP) - PyCon JP 2015
Writing Fast Code (JP) - PyCon JP 2015Writing Fast Code (JP) - PyCon JP 2015
Writing Fast Code (JP) - PyCon JP 2015Younggun Kim
 
Performance Optimization of SPH Algorithms for Multi/Many-Core Architectures
Performance Optimization of SPH Algorithms for Multi/Many-Core ArchitecturesPerformance Optimization of SPH Algorithms for Multi/Many-Core Architectures
Performance Optimization of SPH Algorithms for Multi/Many-Core ArchitecturesDr. Fabio Baruffa
 
Practicing Python 3
Practicing Python 3Practicing Python 3
Practicing Python 3Mosky Liu
 
Tips And Tricks For Bioinformatics Software Engineering
Tips And Tricks For Bioinformatics Software EngineeringTips And Tricks For Bioinformatics Software Engineering
Tips And Tricks For Bioinformatics Software Engineeringjtdudley
 
Flash security past_present_future_final_en
Flash security past_present_future_final_enFlash security past_present_future_final_en
Flash security past_present_future_final_enSunghun Kim
 
Library Operating System for Linux #netdev01
Library Operating System for Linux #netdev01Library Operating System for Linux #netdev01
Library Operating System for Linux #netdev01Hajime Tazaki
 
OSXCollector: Automated forensic evidence collection & analysis for OS X (Bru...
OSXCollector: Automated forensic evidence collection & analysis for OS X (Bru...OSXCollector: Automated forensic evidence collection & analysis for OS X (Bru...
OSXCollector: Automated forensic evidence collection & analysis for OS X (Bru...Jakub "Kuba" Sendor
 
BUD17-300: Journey of a packet
BUD17-300: Journey of a packetBUD17-300: Journey of a packet
BUD17-300: Journey of a packetLinaro
 
Python and Zope: An introduction (May 2004)
Python and Zope: An introduction (May 2004)Python and Zope: An introduction (May 2004)
Python and Zope: An introduction (May 2004)Kiran Jonnalagadda
 
How I Learned to Stop Worrying and Love Legacy Code - Ox:Agile 2018
How I Learned to Stop Worrying and Love Legacy Code - Ox:Agile 2018How I Learned to Stop Worrying and Love Legacy Code - Ox:Agile 2018
How I Learned to Stop Worrying and Love Legacy Code - Ox:Agile 2018Mike Harris
 

Similar a Prometheus as exposition format for eBPF programs running on Kubernetes (20)

Cats And Dogs Living Together: Langsec Is Also About Usability
Cats And Dogs Living Together: Langsec Is Also About UsabilityCats And Dogs Living Together: Langsec Is Also About Usability
Cats And Dogs Living Together: Langsec Is Also About Usability
 
Audit
AuditAudit
Audit
 
Programando o ESP8266 com Python
Programando o ESP8266 com PythonProgramando o ESP8266 com Python
Programando o ESP8266 com Python
 
PyParis 2017 / Writing a C Python extension in 2017, Jean-Baptiste Aviat
PyParis 2017 / Writing a C Python extension in 2017, Jean-Baptiste Aviat PyParis 2017 / Writing a C Python extension in 2017, Jean-Baptiste Aviat
PyParis 2017 / Writing a C Python extension in 2017, Jean-Baptiste Aviat
 
NanoSec Conference 2019: Code Execution Analysis in Mobile Apps - Abdullah Jo...
NanoSec Conference 2019: Code Execution Analysis in Mobile Apps - Abdullah Jo...NanoSec Conference 2019: Code Execution Analysis in Mobile Apps - Abdullah Jo...
NanoSec Conference 2019: Code Execution Analysis in Mobile Apps - Abdullah Jo...
 
DEF CON 27- BRIZENDINE STROSCHEIN - the jop rocket
DEF CON 27- BRIZENDINE STROSCHEIN - the jop rocketDEF CON 27- BRIZENDINE STROSCHEIN - the jop rocket
DEF CON 27- BRIZENDINE STROSCHEIN - the jop rocket
 
Overview Of Parallel Development - Ericnel
Overview Of Parallel Development -  EricnelOverview Of Parallel Development -  Ericnel
Overview Of Parallel Development - Ericnel
 
Who pulls the strings?
Who pulls the strings?Who pulls the strings?
Who pulls the strings?
 
Writing Fast Code (JP) - PyCon JP 2015
Writing Fast Code (JP) - PyCon JP 2015Writing Fast Code (JP) - PyCon JP 2015
Writing Fast Code (JP) - PyCon JP 2015
 
Performance Optimization of SPH Algorithms for Multi/Many-Core Architectures
Performance Optimization of SPH Algorithms for Multi/Many-Core ArchitecturesPerformance Optimization of SPH Algorithms for Multi/Many-Core Architectures
Performance Optimization of SPH Algorithms for Multi/Many-Core Architectures
 
Practicing Python 3
Practicing Python 3Practicing Python 3
Practicing Python 3
 
Tips And Tricks For Bioinformatics Software Engineering
Tips And Tricks For Bioinformatics Software EngineeringTips And Tricks For Bioinformatics Software Engineering
Tips And Tricks For Bioinformatics Software Engineering
 
Big data made easy with a Spark
Big data made easy with a SparkBig data made easy with a Spark
Big data made easy with a Spark
 
Flash security past_present_future_final_en
Flash security past_present_future_final_enFlash security past_present_future_final_en
Flash security past_present_future_final_en
 
Library Operating System for Linux #netdev01
Library Operating System for Linux #netdev01Library Operating System for Linux #netdev01
Library Operating System for Linux #netdev01
 
OSXCollector: Automated forensic evidence collection & analysis for OS X (Bru...
OSXCollector: Automated forensic evidence collection & analysis for OS X (Bru...OSXCollector: Automated forensic evidence collection & analysis for OS X (Bru...
OSXCollector: Automated forensic evidence collection & analysis for OS X (Bru...
 
Surge2012
Surge2012Surge2012
Surge2012
 
BUD17-300: Journey of a packet
BUD17-300: Journey of a packetBUD17-300: Journey of a packet
BUD17-300: Journey of a packet
 
Python and Zope: An introduction (May 2004)
Python and Zope: An introduction (May 2004)Python and Zope: An introduction (May 2004)
Python and Zope: An introduction (May 2004)
 
How I Learned to Stop Worrying and Love Legacy Code - Ox:Agile 2018
How I Learned to Stop Worrying and Love Legacy Code - Ox:Agile 2018How I Learned to Stop Worrying and Love Legacy Code - Ox:Agile 2018
How I Learned to Stop Worrying and Love Legacy Code - Ox:Agile 2018
 

Más de Leonardo Di Donato

Continuous Time Bayesian Network Classifiers, M.Sc Thesis
Continuous Time Bayesian Network Classifiers, M.Sc ThesisContinuous Time Bayesian Network Classifiers, M.Sc Thesis
Continuous Time Bayesian Network Classifiers, M.Sc ThesisLeonardo Di Donato
 
Topic Modeling for Information Retrieval and Word Sense Disambiguation tasks
Topic Modeling for Information Retrieval and Word Sense Disambiguation tasksTopic Modeling for Information Retrieval and Word Sense Disambiguation tasks
Topic Modeling for Information Retrieval and Word Sense Disambiguation tasksLeonardo Di Donato
 
Guida all'estrazione di dati dai Social Network
Guida all'estrazione di dati dai Social NetworkGuida all'estrazione di dati dai Social Network
Guida all'estrazione di dati dai Social NetworkLeonardo Di Donato
 
A Location Based Mobile Social Network
A Location Based Mobile Social NetworkA Location Based Mobile Social Network
A Location Based Mobile Social NetworkLeonardo Di Donato
 
Sistema Rilevamento Transiti (SRT) - Software Analysis and Design
Sistema Rilevamento Transiti (SRT) - Software Analysis and DesignSistema Rilevamento Transiti (SRT) - Software Analysis and Design
Sistema Rilevamento Transiti (SRT) - Software Analysis and DesignLeonardo Di Donato
 
CRADLE: Clustering by RAndom minimization Dispersion based LEarning - Un algo...
CRADLE: Clustering by RAndom minimization Dispersion based LEarning - Un algo...CRADLE: Clustering by RAndom minimization Dispersion based LEarning - Un algo...
CRADLE: Clustering by RAndom minimization Dispersion based LEarning - Un algo...Leonardo Di Donato
 

Más de Leonardo Di Donato (8)

From logs to metrics
From logs to metricsFrom logs to metrics
From logs to metrics
 
Continuous Time Bayesian Network Classifiers, M.Sc Thesis
Continuous Time Bayesian Network Classifiers, M.Sc ThesisContinuous Time Bayesian Network Classifiers, M.Sc Thesis
Continuous Time Bayesian Network Classifiers, M.Sc Thesis
 
Topic Modeling for Information Retrieval and Word Sense Disambiguation tasks
Topic Modeling for Information Retrieval and Word Sense Disambiguation tasksTopic Modeling for Information Retrieval and Word Sense Disambiguation tasks
Topic Modeling for Information Retrieval and Word Sense Disambiguation tasks
 
Guida all'estrazione di dati dai Social Network
Guida all'estrazione di dati dai Social NetworkGuida all'estrazione di dati dai Social Network
Guida all'estrazione di dati dai Social Network
 
Virtual Worlds
Virtual WorldsVirtual Worlds
Virtual Worlds
 
A Location Based Mobile Social Network
A Location Based Mobile Social NetworkA Location Based Mobile Social Network
A Location Based Mobile Social Network
 
Sistema Rilevamento Transiti (SRT) - Software Analysis and Design
Sistema Rilevamento Transiti (SRT) - Software Analysis and DesignSistema Rilevamento Transiti (SRT) - Software Analysis and Design
Sistema Rilevamento Transiti (SRT) - Software Analysis and Design
 
CRADLE: Clustering by RAndom minimization Dispersion based LEarning - Un algo...
CRADLE: Clustering by RAndom minimization Dispersion based LEarning - Un algo...CRADLE: Clustering by RAndom minimization Dispersion based LEarning - Un algo...
CRADLE: Clustering by RAndom minimization Dispersion based LEarning - Un algo...
 

Último

Vip Model Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...
Vip Model  Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...Vip Model  Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...
Vip Model Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...shivangimorya083
 
April 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's AnalysisApril 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's Analysismanisha194592
 
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130Suhani Kapoor
 
Smarteg dropshipping via API with DroFx.pptx
Smarteg dropshipping via API with DroFx.pptxSmarteg dropshipping via API with DroFx.pptx
Smarteg dropshipping via API with DroFx.pptxolyaivanovalion
 
FESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfFESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfMarinCaroMartnezBerg
 
CebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptxCebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptxolyaivanovalion
 
Mature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptxMature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptxolyaivanovalion
 
Capstone Project on IBM Data Analytics Program
Capstone Project on IBM Data Analytics ProgramCapstone Project on IBM Data Analytics Program
Capstone Project on IBM Data Analytics ProgramMoniSankarHazra
 
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 nightCheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 nightDelhi Call girls
 
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptx
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptxBPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptx
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptxMohammedJunaid861692
 
BabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptxBabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptxolyaivanovalion
 
CALL ON ➥8923113531 🔝Call Girls Chinhat Lucknow best sexual service Online
CALL ON ➥8923113531 🔝Call Girls Chinhat Lucknow best sexual service OnlineCALL ON ➥8923113531 🔝Call Girls Chinhat Lucknow best sexual service Online
CALL ON ➥8923113531 🔝Call Girls Chinhat Lucknow best sexual service Onlineanilsa9823
 
100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptx100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptxAnupama Kate
 
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Callshivangimorya083
 
Determinants of health, dimensions of health, positive health and spectrum of...
Determinants of health, dimensions of health, positive health and spectrum of...Determinants of health, dimensions of health, positive health and spectrum of...
Determinants of health, dimensions of health, positive health and spectrum of...shambhavirathore45
 
Invezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signalsInvezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signalsInvezz1
 
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAl Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAroojKhan71
 
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdfMarket Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdfRachmat Ramadhan H
 

Último (20)

Vip Model Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...
Vip Model  Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...Vip Model  Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...
Vip Model Call Girls (Delhi) Karol Bagh 9711199171✔️Body to body massage wit...
 
April 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's AnalysisApril 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's Analysis
 
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
VIP Call Girls Service Miyapur Hyderabad Call +91-8250192130
 
Smarteg dropshipping via API with DroFx.pptx
Smarteg dropshipping via API with DroFx.pptxSmarteg dropshipping via API with DroFx.pptx
Smarteg dropshipping via API with DroFx.pptx
 
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get CytotecAbortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
 
FESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfFESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdf
 
Sampling (random) method and Non random.ppt
Sampling (random) method and Non random.pptSampling (random) method and Non random.ppt
Sampling (random) method and Non random.ppt
 
CebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptxCebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptx
 
Mature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptxMature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptx
 
Capstone Project on IBM Data Analytics Program
Capstone Project on IBM Data Analytics ProgramCapstone Project on IBM Data Analytics Program
Capstone Project on IBM Data Analytics Program
 
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 nightCheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
 
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptx
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptxBPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptx
BPAC WITH UFSBI GENERAL PRESENTATION 18_05_2017-1.pptx
 
BabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptxBabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptx
 
CALL ON ➥8923113531 🔝Call Girls Chinhat Lucknow best sexual service Online
CALL ON ➥8923113531 🔝Call Girls Chinhat Lucknow best sexual service OnlineCALL ON ➥8923113531 🔝Call Girls Chinhat Lucknow best sexual service Online
CALL ON ➥8923113531 🔝Call Girls Chinhat Lucknow best sexual service Online
 
100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptx100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptx
 
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 
Determinants of health, dimensions of health, positive health and spectrum of...
Determinants of health, dimensions of health, positive health and spectrum of...Determinants of health, dimensions of health, positive health and spectrum of...
Determinants of health, dimensions of health, positive health and spectrum of...
 
Invezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signalsInvezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signals
 
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAl Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
 
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdfMarket Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
 

Prometheus as exposition format for eBPF programs running on Kubernetes

  • 1. Prometheus as exposition format for eBPF programs running on k8s Leonardo Di Donato. Open Source Software Engineer @ Sysdig. 2019.05.18 - Cloud_Native Rejekts EU - Barcelona, Spain
  • 2. whoami Leonardo Di Donato. Maintainer of Falco. Creator of kubectl-trace and go-syslog. Reach me out @leodido.
  • 3. @leodido • Old buzzword. • Is this SNMP? 😂 • Focus on collecting, persisting, and alerting on just any data! • It might also become simply garbage. • Data lake. • Doing it well requires a strategy. • Uninformed monitoring equals hope. Monitoring The missing buzzwords Wait, another really cool buzzword is Tracing! • Ability of a system to give to humans insights. • Humans can observe, understand, and act on the presented state of an observable system. • Ability to make deductions about internal state only looking at boundaries (inputs vs outputs). • Never truly achieved. Ongoing process and mindset. • Avoid black box data. Extract fine-grained and meaningful data. Observability
  • 4. @leodido • Monitoring landscape very fragmented • Many solutions • with ancient tech • Proprietary data formats • often not completely impl. or undocumented or ... • Hierarchical data models • Metrics? W00t? Before Prometheus But there’s a thing ... • De-facto standard • Cloud-native metric monitoring • Ease of use • Explosion of /metrics endpoints After Prometheus The journey so far
  • 5. What if we could exploit Prometheus (or OpenMetrics) exposition format’s awesomeness without having to punctually instrument applications? Can we avoid to clog our applications through eBPF superpowers? eBFP superpowers @leodido
  • 6. What eBPF is You can now write mini programs that run on events like disk I/O which are run in a safe virtual machine in the kernel. In-kernel verifier refuses to load eBPF programs with invalid pointer dereferences, exceeding maximum call stack, or with loop without an upper bound. Imposes a stable Application Binary Interface (ABI). BPF on steroids 🚀 A core part of the Linux kernel. @leodido
  • 7. @leodido userspace program bpf() syscall eBPF program ... user-space kernel eBPF map BPF_MAP_CREATE BPF_MAP_LOOKUP_ELEM BPF_MAP_UPDATE_ELEM BPF_MAP_DELETE_ELEM BPF_MAP_GET_NEXT_KEY http://bit.ly/bpf_map_types 📎 BPF_PROG_TYPE_SOCKET_FILTER BPF_PROG_TYPE_KPROBE BPF_PROG_TYPE_TRACEPOINT BPF_PROG_TYPE_RAW_TRACEPOINT BPF_PROG_TYPE_XDP BPF_PROG_TYPE_PERF_EVENT BPF_PROG_TYPE_CGROUP_SKB BPF_PROG_TYPE_CGROUP_SOCK BPF_PROG_TYPE_SOCK_OPS BPF_PROG_TYPE_SK_SKB BPF_PROG_TYPE_SK_MSG BPF_PROG_TYPE_SCHED_CLS BPF_PROG_TYPE_SCHED_ACT 📎 http://bit.ly/bpf_prog_types eBPF program How does eBFP work?
  • 8. • fully programmable • can trace everything in a system • not limited to a specific application • unified tracing interface for both kernel and userspace • [k,u]probes, (dtrace)tracepoints and so on are also used by other tools • minimal (negligible) performance impact • attach JIT native compiled instrumentation code • no long suspensions of execution Advantages • requires a fairly recent kernel • definitely not for debugging • no knowledge of the calling higher level language implementation • not fully running in user space • kernel-user context (usually negligible) switch when eBPF instrument a user process • still not portable as other tracers • VM primarily developer in the Linux kernel (work-in-progress portings btw) Disadvantages Why use eBPF at all to trace userspace processes?
  • 9. @leodido BFP operator for Kubernetes Why don’t we make eBPF programs look more YAML ✌✌✌
  • 10. 📎 http://bit.ly/k8s_crd An extension of the K8S API that let you store and retrieve structured data. Custom resources 📎 http://bit.ly/k8s_shared_informers The actual control loop that watches the shared state using the workqueue. Shared informers 📎 http://bit.ly/k8s_custom_controllers It declares and specifies the desired state of your resource continuously trying to match it with the actual state. Controllers Customize all the things
  • 12. @leodido Did y’all say Y’AML?! let’s put some ELF magic in it... 🧝‍♂🤯🧙‍♂
  • 13. @leodido Count packets by protocol Count sys_enter_write by process ID macro to generate sections inside the object file (later interpreted by the ELF BPF loader)
  • 14. @leodido Compile and inspect This is important because communicates to set the current running kernel version! Tricky and controversial legal thing about licenses ... The bpf_prog_load() wrapper also has a license parameter to provide the license that applies to the eBPF program being loaded. Not GPL-compatible license? Kernel won’t load you eBPF! Exceptions applies... eBPF Maps
  • 17. @leodido Demo time Doing all the BPF things, with YAML 💦
  • 19. @leodido # HELP test_packets No. of packets per protocol (key), node # TYPE test_packets counter test_packets{key="00001",node="127.0.0.1"} 8 test_packets{key="00002",node="127.0.0.1"} 1 test_packets{key="00006",node="127.0.0.1"} 551 test_packets{key="00008",node="127.0.0.1"} 1 test_packets{key="00017",node="127.0.0.1"} 15930 test_packets{key="00089",node="127.0.0.1"} 9 test_packets{key="00233",node="127.0.0.1"} 1 # EOF It is a WIP project but already open source! 🎺 Check it out @ gh:bfptools/kube-bpf 🔗 ip-10-12-0-136.ec2.internal:9387/metrics # <- ICMP # <- IGMP # <- TCP # <- EGP # <- UDP # <- OSPF # <- ?
  • 20. @leodido # HELP test_dummy No. sys_enter_write calls per PID (key), node # TYPE test_dummy counter test_dummy{key="00001",node="127.0.0.1"} ... test_dummy{key="00001",node="127.0.0.1"} 8 test_dummy{key="00295",node="127.0.0.1"} 1 test_dummy{key="01278",node="127.0.0.1"} 1158 test_dummy{key="04690",node="127.0.0.1"} 209 test_dummy{key="04691",node="127.0.0.1"} 889 # EOF It is a WIP project but already open source! 🎺 Check it out @ gh:bfptools/kube-bpf 🔗 ip-10-12-0-122.ec2.internal:9387/metrics
  • 21. @leodido It is a WIP project but already open source! 🎺 Check it out @ gh:bfptools/kube-bpf 🔗
  • 22. @leodido kubectl-trace More eBPF + k8s Run bpftrace program (from file) Ctrl-C tells the program to plot the results using hist() The output histogram Maps
  • 23. @leodido • Prometheus exposition format is here to stay given how simple it is 📊 • OpenMetrics will introduce improvements on such giant shoulders 📈 • We cannot monitor and observe everything from inside our applications 🎯 • We might want to have a look at the orchestrator (context) our apps live and die in 🕸 • Kubernetes can be extended to achieve such levels of integrations 🔌 • ELF is cool 🧝 • We look for better tools (eBPF) for grabbing our metrics and even more 🔮 • Almost nullify footprint ⚡ • Enable a wider range of available data 🌊 • Do not touch our applications directly 👻 • There is a PoC doing some magic at gh:bfptools/kube-bpf 🧞 Key takeaways
  • 24. Thanks. Reach me out @leodido on twitter & github! SEE Y’ALL AROUND AT KUBECON http://bit.ly/prometheus_ebpf_k8s