SlideShare a Scribd company logo
How and why we got
Prometheus working with
Docker Swarm
Luke Marsden
@lmarsden
Luke’s goal:

Make Weave Cloud accessible to Docker
Swarm users. Let’s get Prometheus working
with Docker Swarm!
Justin’s goal:

Everyone kept asking me “how do I
Prometheus?”
So, how to integrate?
+
How and why we got Prometheus working with Docker Swarm
V1 architecture
Service A
prom-
wrapper
Network A
Service B
Network B
swarm API
Net A+B
V1 architecture
Service A
prom-
wrapper
Network A
Service B
Network B
swarm API
Net A+B
prom-wrapper writes service discovery
info to Prom config, starts Prom on
the right Docker networks…
V1 architecture
Service A
prom-
wrapper
Network A
Service B
Network B
swarm API
Net A+B
V1 architecture
Service A
prom-
wrapper
Network A
Service B
Network B
swarm API
Net A+B
Service C
Network C
V1 architecture
Service A
prom-
wrapper
Network A
Service B
Network B
Service C
Network C
swarm API
V1 architecture
Service A
prom-
wrapper
Network A
Service B
Network B
Service C
Network C
swarm API
Net A+B+C
Downsides to V1 design
• Assumption: can’t dynamically add container to new
networks
• Therefore, need to restart Prometheus every time a
service or network comes or goes
• Services & networks can be re-deployed frequently,
especially in a busy cluster + continuous delivery
• Means Prometheus can miss scrapes
• Losing data :-(
V2 architecture
Service A
Network A
Service B
Network B
swarm API
Net P
prom-
proxy
prom-
proxy
Net P+A
Net P+B
prom-
wrapper
Service AService A
Service BService B
V2 architecture
Service A
Network A
Service B
Network B
Service C
Network C
swarm API
Net P
prom-
proxy
prom-
proxy
Net P+A
Net P+B
prom-
wrapper
Service AService A
Service BService B
Service CService C
V2 architecture
Network A
Network B
Network C
swarm API
Net P
prom-
proxy
prom-
proxy
prom-
proxy
Net P+A
Net P+B
Net P+C
prom-
wrapper
Service AService A
Service BService B
Service CService C
What is prom-proxy?
prom-
proxy
• socat?
• No, needs to aggregate stats from
multiple instances, concatenate
them, discover them…
• Write a custom proxy?
• Hmm it’s starting to look a look like
Prometheus…
• Eureka! Use Prometheus in federated
mode!
V2 architecture
Service A
Network A
Service B
Network B
Service C
Network C
swarm API
Net P
Net P+A
Net P+B
Net P+C
prom-
wrapper
Service AService A
Service BService B
Service CService C
Downsides to V2 design
• It’s bloody complicated!
• “You’re not going to do that, are you?”
• Lots of moving parts
• Oh well, let’s give it a go
How and why we got Prometheus working with Docker Swarm
Containers can be dynamically
added to networks!
V3 architecture
Service A
prom-
wrapper
Network A
Service B
Network B
swarm API
Net A+B
V3 architecture
Service A
prom-
wrapper
Network A
Service B
Network B
swarm API
Net A+B
prom-wrapper writes service discovery
info to Prom config, starts Prom on
the right Docker networks…
V3 architecture
Service A
prom-
wrapper
Network A
Service B
Network B
swarm API
Net A+B
V3 architecture
Service A
prom-
wrapper
Network A
Service B
Network B
swarm API
Net A+B
Service C
Network C
V3 architecture
Service A
prom-
wrapper
Network A
Service B
Network B
Service C
Network C
swarm API
Net A+B+C
prom-wrapper dynamically adds
Prometheus to the right
networks, rewrites config which
Prom hot-reloads
So that’s what we did :-)
• github.com/containersolutions/
prometheus-swarm-discovery
• Now you can monitor Docker Swarm with
Weave Cloud :-)
• Demo!
Conclusion
• Weave Cloud is an ops platform for app devs,
help you go round the loop faster
• Includes hosted scalable Prometheus, works
with Swarm
• Try the prototype at github.com/
containersolutions/prometheus-swarm-discovery
• Try Weave Cloud at weave.works
Join the Weave user group for talks & trainings!
• Continuous delivery
• Network policy for security
• Deep dive on Prometheus monitoring
meetup.com/pro/Weave
and then we went to the pub!

More Related Content

PDF
How to install and use Kubernetes
PDF
Securing & Enforcing Network Policy and Encryption with Weave Net
PDF
Observability beyond logging for Java Microservices
PPTX
MicroServices at Netflix - challenges of scale
PDF
Overlay/Underlay - Betting on Container Networking
PDF
Kubernetes networking in AWS
PPTX
Building Micro-Services with Scala
PDF
Docker Online Meetup #22: Docker Networking
How to install and use Kubernetes
Securing & Enforcing Network Policy and Encryption with Weave Net
Observability beyond logging for Java Microservices
MicroServices at Netflix - challenges of scale
Overlay/Underlay - Betting on Container Networking
Kubernetes networking in AWS
Building Micro-Services with Scala
Docker Online Meetup #22: Docker Networking

What's hot (20)

PDF
Istio on Kubernetes
PDF
Locking down your Kubernetes cluster with Linkerd
PDF
Istio presentation jhug
PDF
What's New in Docker 1.12 (June 20, 2016) by Mike Goelzer & Andrea Luzzardi
PDF
Java Microservices with Netflix OSS & Spring
PPTX
Kubernetes101 - Pune Kubernetes Meetup 6
PDF
KubeCon NA 2017: Ambassador and Envoy (Envoy Salon)
PDF
Client Side Monitoring With Prometheus
PPTX
Linkerd – Service mesh with service Discovery backend
PDF
Keystone at openstack multi sites
PDF
Container Networking - State of the Ecosystem [ContainerConf, Mannheim, Nov 2...
PDF
TDC2017 | São Paulo - Trilha Containers How we figured out we had a SRE team ...
PDF
NYC Kubernetes Meetup: Ambassador and Istio - Flynn, Datawire
PDF
2017 Microservices Practitioner Virtual Summit: The Mechanics of Deploying En...
PPTX
Quantum essex summary
PPTX
GDL OpenStack Community - Openstack Introduction
PDF
Docker network performance in the public cloud
PPTX
Manchester MuleSoft Meetup #6 - Runtime Fabric with Mulesoft
PPTX
Multi-Clusters Made Easy with Liqo:
Getting Rid of Your Clusters Keeping Them...
PDF
Microservices with Spring Cloud and Netflix OSS
Istio on Kubernetes
Locking down your Kubernetes cluster with Linkerd
Istio presentation jhug
What's New in Docker 1.12 (June 20, 2016) by Mike Goelzer & Andrea Luzzardi
Java Microservices with Netflix OSS & Spring
Kubernetes101 - Pune Kubernetes Meetup 6
KubeCon NA 2017: Ambassador and Envoy (Envoy Salon)
Client Side Monitoring With Prometheus
Linkerd – Service mesh with service Discovery backend
Keystone at openstack multi sites
Container Networking - State of the Ecosystem [ContainerConf, Mannheim, Nov 2...
TDC2017 | São Paulo - Trilha Containers How we figured out we had a SRE team ...
NYC Kubernetes Meetup: Ambassador and Istio - Flynn, Datawire
2017 Microservices Practitioner Virtual Summit: The Mechanics of Deploying En...
Quantum essex summary
GDL OpenStack Community - Openstack Introduction
Docker network performance in the public cloud
Manchester MuleSoft Meetup #6 - Runtime Fabric with Mulesoft
Multi-Clusters Made Easy with Liqo:
Getting Rid of Your Clusters Keeping Them...
Microservices with Spring Cloud and Netflix OSS
Ad

Similar to How and why we got Prometheus working with Docker Swarm (20)

PDF
Managing microservices with istio on OpenShift - Meetup
PDF
Navigate Data Service using AWS
PDF
KubeCon London 2016 Ronana Cloud Native SDN
PPTX
Thunderstruck by serverless
PPTX
Building a Service Mesh with NGINX Owen Garrett.pptx
PDF
Docker Introduction
PDF
Polkadot encode club moonbeam
PDF
Build and Deploy Cloud Native Camel Quarkus routes with Tekton and Knative
ODP
Docker AWS TechCONNECT Boston, 28-July-2015
PPTX
End-to-End CI/CD at scale with Infrastructure-as-Code on AWS
PDF
How to Build a Big Data Application: Serverless Edition
PDF
How to Build a Big Data Application: Serverless Edition
PDF
Load Balancing in the Cloud using Nginx & Kubernetes
PDF
KubeVirt, its networking, and how we brought it to the next level
PDF
Platform as a Runtime - PaaR QCON 2024 - Final
PPTX
Openstack Quantum yahoo meetup 1 23-13
PDF
Builders' Day- Mastering Kubernetes on AWS
PDF
Personal robot industry v4
PDF
vidhi talk.pdf
PDF
What’s new in serverless - re:Invent 2020
Managing microservices with istio on OpenShift - Meetup
Navigate Data Service using AWS
KubeCon London 2016 Ronana Cloud Native SDN
Thunderstruck by serverless
Building a Service Mesh with NGINX Owen Garrett.pptx
Docker Introduction
Polkadot encode club moonbeam
Build and Deploy Cloud Native Camel Quarkus routes with Tekton and Knative
Docker AWS TechCONNECT Boston, 28-July-2015
End-to-End CI/CD at scale with Infrastructure-as-Code on AWS
How to Build a Big Data Application: Serverless Edition
How to Build a Big Data Application: Serverless Edition
Load Balancing in the Cloud using Nginx & Kubernetes
KubeVirt, its networking, and how we brought it to the next level
Platform as a Runtime - PaaR QCON 2024 - Final
Openstack Quantum yahoo meetup 1 23-13
Builders' Day- Mastering Kubernetes on AWS
Personal robot industry v4
vidhi talk.pdf
What’s new in serverless - re:Invent 2020
Ad

More from Luke Marsden (6)

PDF
Inextricably linked: reproducibility and productivity in data science and AI
PDF
Monitoring your App in Kubernetes with Prometheus
PDF
Continuous Delivery the hard way with Kubernetes
PDF
Istio Service Mesh
PDF
Docs at Weaveworks: DX from open source to SaaS and beyond
PPTX
Data focused docker clustering
Inextricably linked: reproducibility and productivity in data science and AI
Monitoring your App in Kubernetes with Prometheus
Continuous Delivery the hard way with Kubernetes
Istio Service Mesh
Docs at Weaveworks: DX from open source to SaaS and beyond
Data focused docker clustering

Recently uploaded (20)

PDF
Decoding a Decade: 10 Years of Applied CTI Discipline
PPTX
CHE NAA, , b,mn,mblblblbljb jb jlb ,j , ,C PPT.pptx
PDF
Automated vs Manual WooCommerce to Shopify Migration_ Pros & Cons.pdf
PPTX
Introuction about WHO-FIC in ICD-10.pptx
PDF
Paper PDF World Game (s) Great Redesign.pdf
PDF
APNIC Update, presented at PHNOG 2025 by Shane Hermoso
PDF
Best Practices for Testing and Debugging Shopify Third-Party API Integrations...
PDF
The New Creative Director: How AI Tools for Social Media Content Creation Are...
PPTX
INTERNET------BASICS-------UPDATED PPT PRESENTATION
PDF
Cloud-Scale Log Monitoring _ Datadog.pdf
PPTX
PptxGenJS_Demo_Chart_20250317130215833.pptx
PDF
WebRTC in SignalWire - troubleshooting media negotiation
PDF
SASE Traffic Flow - ZTNA Connector-1.pdf
PDF
RPKI Status Update, presented by Makito Lay at IDNOG 10
PPT
isotopes_sddsadsaadasdasdasdasdsa1213.ppt
PDF
Unit-1 introduction to cyber security discuss about how to secure a system
PDF
How to Ensure Data Integrity During Shopify Migration_ Best Practices for Sec...
PDF
An introduction to the IFRS (ISSB) Stndards.pdf
PDF
Vigrab.top – Online Tool for Downloading and Converting Social Media Videos a...
PPT
Design_with_Watersergyerge45hrbgre4top (1).ppt
Decoding a Decade: 10 Years of Applied CTI Discipline
CHE NAA, , b,mn,mblblblbljb jb jlb ,j , ,C PPT.pptx
Automated vs Manual WooCommerce to Shopify Migration_ Pros & Cons.pdf
Introuction about WHO-FIC in ICD-10.pptx
Paper PDF World Game (s) Great Redesign.pdf
APNIC Update, presented at PHNOG 2025 by Shane Hermoso
Best Practices for Testing and Debugging Shopify Third-Party API Integrations...
The New Creative Director: How AI Tools for Social Media Content Creation Are...
INTERNET------BASICS-------UPDATED PPT PRESENTATION
Cloud-Scale Log Monitoring _ Datadog.pdf
PptxGenJS_Demo_Chart_20250317130215833.pptx
WebRTC in SignalWire - troubleshooting media negotiation
SASE Traffic Flow - ZTNA Connector-1.pdf
RPKI Status Update, presented by Makito Lay at IDNOG 10
isotopes_sddsadsaadasdasdasdasdsa1213.ppt
Unit-1 introduction to cyber security discuss about how to secure a system
How to Ensure Data Integrity During Shopify Migration_ Best Practices for Sec...
An introduction to the IFRS (ISSB) Stndards.pdf
Vigrab.top – Online Tool for Downloading and Converting Social Media Videos a...
Design_with_Watersergyerge45hrbgre4top (1).ppt

How and why we got Prometheus working with Docker Swarm