SlideShare a Scribd company logo
Docker Monitoring
Webinar
20% OFF 201509WNR20S 201509WNR20L
sematext.com/spm sematext.com/logsene
Housekeeping / Questions
Intro
SPM: Performance monitoring,
Anomaly Detection and Alerting
Logsene: Centralized Log Management
Search and Big Data Consulting
Support for Solr and Elasticsearch
Agenda
● Docker Monitoring
○ Docker Monitoring Basics
○ Deployment Options for Docker Agents
● Application Monitoring on Docker
○ Monitoring Containerized Applications
○ Deployment Options for
Application Monitoring Agents
Why we like Blue Whales
● Portable packaging
● Optimized resource usage
● Configurable resource limits
● Isolated environment for apps
What is Docker made of?
Docker Platforms
Docker Challenges
● New workflows for deployments
○ from developer laptop straight to the Cloud
● Orchestration of applications
● Logging
○ Webinars 29/30 September, @sematext
● Monitoring
Docker Monitoring Basics
Let’s understand what we monitor!
Why Docker Monitoring
You can’t fix problems you don’t see!
● Tuning
○ Resources / Container Limits
○ Application Performance
● Quality assurance
● Capacity planning
● Availability / SLA’s
What to monitor?
Cluster
Server 1
Container 1
Container 2
Container N
Container 1
Elasticsearch
Container 2
Node.js - web service
Container N
NGINX - reverse proxy
Server N
JVM Runtime Env
JS Runtime Env
The Metrics Stack Changed!
Server Metrics
Runtime Metrics
App Metrics
Server Metrics
Runtime Metrics
App Metrics
Container Metrics
Runtime Metrics = JVM Metrics or Node.js Metrics, …
Without Docker With Docker
Poll
What is the result of ‘vmstat’ when started in a
container?
A) OS Metrics limited to the container
B) OS Metrics from the docker host
Docker Stats Command
> docker stats $(docker ps -q)
CONTAINER CPU % MEM USAGE/LIMIT MEM % NET I/O
19a9f4c9ecb7 0.00% 1.421 MB/3.944 GB 0.04% 0 B/0 B
7f043a32307c 0.00% 1.413 MB/3.944 GB 0.04% 0 B/0 B
889646bd003f 0.11% 4.235 MB/3.944 GB 0.11% 0 B/0 B
9a29f494bf7d 0.27% 156.8 MB/3.944 GB 3.98% 0 B/0 B
Too simple!
Docker API for Metrics
> echo -e "GET /containers/3236f3328bbd/stats HTTP/1.0rn"
| nc -U /var/run/docker.sock
HTTP/1.0 200 OK
Date: Thu, 30 Jul 2015 08:37:31 GMT
Content-Type: text/plain; charset=utf-8
{"read":"2015-07-30T04:37:31.13789208-04:00","network":{"rx_bytes":636450,"rx_packets":1944,"
rx_errors":0,"rx_dropped":0,"tx_bytes":495897,"tx_packets":2415,"tx_errors":0,"tx_dropped":0},"
precpu_stats":{"cpu_usage":{"total_usage":0,"percpu_usage":null,"usage_in_kernelmode":0,"
usage_in_usermode":0},"system_cpu_usage":0,"throttling_data":{"periods":0,"throttled_periods":
0,"throttled_time":0}},"cpu_stats ...
Too verbose!
More than 70 Metrics
are exposed
Watching a Metric
> echo -e "GET /containers/3236f3328bbd/stats HTTP/1.0rn"
| nc -U /var/run/docker.sock
| logagent -y
| grep rx_bytes
rx_bytes: 667326
rx_bytes: 667354
rx_bytes: 667413
rx_bytes: 667538
github.com/sematext/logagent-js
Which Metrics are
most relevant?
Docker Key Metrics
Server Metrics
● CPU
● Memory Usage
● Disk Space
○ Docker Images consume a lot of disk space
Container Metrics
● Containers CPU
+ Throttled CPU time / CPU limits!
● Memory Limits
+ Memory Allocation Fail Counters
● Disk I/O + Wait Times
● Network I/O + Network Errors
Docker Key Metrics in SPM
Beyond Metrics: Events
● Docker Events
○ container auditing
○ create, destroy, die, export, kill,
pause, restart, start, stop,
unpause, oom
Beyond Metrics: Logs
● Logs
○ Docker collects console output
of each container
○ API or Log Drivers for forwarding
● Correlation with Metrics
○ Faster troubleshooting
blog.sematext.com/2015/08/11/docker-logging-webinar/
Docker
Logging
Webinar
Deploying Docker
Monitoring Agents
Directly on each Docker Host
● The traditional way!
● Full access to the operating system
● Limitations in ’Container only’ systems
- CoreOS
- RancherOS
- Many PaaS Solutions, e.g., DEIS
One Container on each Docker Host
● Yes. The Docker Way!
● Portable to any ‘Docker platform’
● Requirements:
- Access to the Host Metrics + Docker API
- Extended privileges (e.g., for SELinux, GCE,...)
Containerized Monitoring Agents
SPM for Docker Monitoring
apps.sematext.com/spm-reports/registerApplication.do
hub.docker.com/r/sematext/spm-agent-docker/
github.com/sematext/spm-agent-docker
Example 1: Run SPM for Docker
docker run -d --name spm-agent
-v /var/run/docker.sock:/var/run/docker.sock
-e SPM_TOKEN=fe31fc3a-xxxx-47c6-b83c-be376bfxxx
-e HOSTNAME=$HOSTNAME
-e SPM_MONITORING_TAGS="project:dev-test,role:demo"
-e LOGSENE_TOKEN=53a6c7e7-xxxx-4725-962e-ea47cebxxx
--privileged
sematext/spm-agent-docker
Example 2: CoreOS + DEIS
● CoreOS has no package manager
● systemd - init system
● fleet - as distributed init system
● etcd - for central configurations
How to distribute a Monitoring
Agent to all CoreOS servers in a cluster?
Example 2
Example 2: Distribute the Agent
# Configure SPM app token
etcdctl set /sematext.com/myapp/spm/token YOUR_SPM_TOKEN
# Download the fleet unit file for SPM
wget
https://raw.githubusercontent.com/sematext/spm-agent-docker/master/coreos/spm-agent.service 
-O spm-agent.service
# Start SPM Agent in the whole cluster
fleetctl load spm-agent.service
fleetctl start spm-agent.service
Example 3: RANCHER OS
● Minimalistic (~25 MB !)
● No package manager
● All system services are containers
● No cluster manager (by default)
● Use restart policy ‘always’ for services
docker run --restart=always … sematext/spm-agent-docker
Application Monitoring
layers.next()
Application Metrics
How are Applications monitored?
● Standalone Agents
○ Remote interface: JMX, MySQL, NGINX, Apache
○ No restart required, when agent gets updated
● In-Process Agents
○ Resource friendly
○ Node.js
○ JVM Apps (Elasticsearch, Solr, Kafka, ...)
- Function Transaction/Call Tracing possible
Transaction Tracing + AppMap
● Only possible with in-process monitoring
Deployment Options for
Application Monitoring
… on Docker
Everything in Each Container
Standalone in Separate Container
In-Process in Separate Container
Setup for Elasticsearch Image
spm-client:
image: sematext/spm-client # Exports Volume /opt/spm
container_name: spm-client
environment:
- SPM_CFG="${SPM_TOKEN} es javaagent jvmname:ES1"
ELASTICSEARCH:
image: elasticsearch
ports:
- "9200:9200"
volumes_from:
- spm-client
environment: # inject in-process monitor from SPM client volume /opt/spm
- ES_JAVA_OPTS="-Dcom.sun.management.jmxremote 
-javaagent:/opt/spm/spm-monitor/lib/spm-monitor-es.jar=${SPM_TOKEN}::ES1"
Setup for node.js Apps
Dockerfile:
FROM nodejs
RUN git clone my/app
RUN npm i
RUN npm i spm-agent-nodejs
CMD node -r spm-agent-nodejs app.js
---
docker build -t myapp .
docker run -e SPM_TOKEN=43A... myapp
Application + Docker Metrics
SPM Logsene
METRICS + LOGS ⇒ BETTER TOGETHER
Summary
Stefan Thies
Twitter: @seti321
stefan.thies@sematext.com
info@sematext.com
blog.sematext.com
sematext.com/spm
hub.docker.com/r/sematext/spm-agent-docker/
github.com/sematext/spm-agent-docker
Docker Monitoring
Webinar
20% OFF 201509WNR20S 201509WNR20L
sematext.com/spm sematext.com/logsene
Thank you for your attention

More Related Content

PDF
Elasticsearch for Logs & Metrics - a deep dive
PDF
Docker Logging Webinar
PDF
Tuning Solr & Pipeline for Logs
PPTX
MySQL Slow Query log Monitoring using Beats & ELK
PDF
How to Run Solr on Docker and Why
PPTX
Running High Performance & Fault-tolerant Elasticsearch Clusters on Docker
PPTX
Managing Your Security Logs with Elasticsearch
PPT
Logstash
Elasticsearch for Logs & Metrics - a deep dive
Docker Logging Webinar
Tuning Solr & Pipeline for Logs
MySQL Slow Query log Monitoring using Beats & ELK
How to Run Solr on Docker and Why
Running High Performance & Fault-tolerant Elasticsearch Clusters on Docker
Managing Your Security Logs with Elasticsearch
Logstash

What's hot (20)

PDF
Journée DevOps : Des dashboards pour tous avec ElasticSearch, Logstash et Kibana
PDF
On Centralizing Logs
PDF
Null Bachaav - May 07 Attack Monitoring workshop.
PDF
Advanced troubleshooting linux performance
PPT
ELK stack at weibo.com
PDF
DOD 2016 - Rafał Kuć - Building a Resilient Log Aggregation Pipeline Using El...
PDF
elk_stack_alexander_szalonnas
PDF
Solr on Docker - the Good, the Bad and the Ugly
PDF
Logging logs with Logstash - Devops MK 10-02-2016
PPT
{{more}} Kibana4
PPTX
Solr Search Engine: Optimize Is (Not) Bad for You
PDF
Solr for Indexing and Searching Logs
PDF
Move Over, Rsync
PDF
Open Source Logging and Monitoring Tools
PDF
Logstash family introduction
PPTX
More kibana
PPT
How ElasticSearch lives in my DevOps life
PDF
Scaling your logging infrastructure using syslog-ng
PDF
Logging with Elasticsearch, Logstash & Kibana
PDF
Tuning Solr for Logs
Journée DevOps : Des dashboards pour tous avec ElasticSearch, Logstash et Kibana
On Centralizing Logs
Null Bachaav - May 07 Attack Monitoring workshop.
Advanced troubleshooting linux performance
ELK stack at weibo.com
DOD 2016 - Rafał Kuć - Building a Resilient Log Aggregation Pipeline Using El...
elk_stack_alexander_szalonnas
Solr on Docker - the Good, the Bad and the Ugly
Logging logs with Logstash - Devops MK 10-02-2016
{{more}} Kibana4
Solr Search Engine: Optimize Is (Not) Bad for You
Solr for Indexing and Searching Logs
Move Over, Rsync
Open Source Logging and Monitoring Tools
Logstash family introduction
More kibana
How ElasticSearch lives in my DevOps life
Scaling your logging infrastructure using syslog-ng
Logging with Elasticsearch, Logstash & Kibana
Tuning Solr for Logs
Ad

Viewers also liked (20)

PDF
Using Elastic to Monitor Anything
PDF
Using Elastic to Monitor Everything - Christoph Wurm, Elastic - DevOpsDays Te...
PDF
Top Node.js Metrics to Watch
PPTX
Container Monitoring with Sysdig
PPTX
MongoDB and Apache HBase: Benchmarking
PPTX
Musings on Secondary Indexing in HBase
ODP
Search Analytics with Flume and HBase
PPTX
Apache HBase Application Archetypes
PDF
Solr Anti Patterns
PDF
From Zero to Production Hero: Log Analysis with Elasticsearch (from Velocity ...
PDF
Large Scale Log Analytics with Solr (from Lucene Revolution 2015)
PDF
Improvements to Flink & it's Applications in Alibaba Search
PDF
Introduction to solr
PDF
From Zero to Hero - Centralized Logging with Logstash & Elasticsearch
PPTX
Sysdig Monitorama Slides
PDF
Using Morphlines for On-the-Fly ETL
PDF
Metrics, Logs, Transaction Traces, Anomaly Detection at Scale
PPTX
Tuning Elasticsearch Indexing Pipeline for Logs
PDF
Side by Side with Elasticsearch & Solr, Part 2
PPTX
Large scale near real-time log indexing with Flume and SolrCloud
Using Elastic to Monitor Anything
Using Elastic to Monitor Everything - Christoph Wurm, Elastic - DevOpsDays Te...
Top Node.js Metrics to Watch
Container Monitoring with Sysdig
MongoDB and Apache HBase: Benchmarking
Musings on Secondary Indexing in HBase
Search Analytics with Flume and HBase
Apache HBase Application Archetypes
Solr Anti Patterns
From Zero to Production Hero: Log Analysis with Elasticsearch (from Velocity ...
Large Scale Log Analytics with Solr (from Lucene Revolution 2015)
Improvements to Flink & it's Applications in Alibaba Search
Introduction to solr
From Zero to Hero - Centralized Logging with Logstash & Elasticsearch
Sysdig Monitorama Slides
Using Morphlines for On-the-Fly ETL
Metrics, Logs, Transaction Traces, Anomaly Detection at Scale
Tuning Elasticsearch Indexing Pipeline for Logs
Side by Side with Elasticsearch & Solr, Part 2
Large scale near real-time log indexing with Flume and SolrCloud
Ad

Similar to Docker Monitoring Webinar (20)

PPTX
How to build a container monitoring solution - David Gildeh, CEO and Co-Found...
PPTX
DOD 2016 - Stefan Thies - Monitoring and Log Management for Docker Swarm and...
PDF
Docker Usage Patterns - Meetup Docker Paris - November, 10th 2015
PDF
Monitoring and Log Management for
PDF
Monitoring Docker at Scale - Docker San Francisco Meetup - August 11, 2015
PPTX
It's What's Inside that Counts!
PDF
DockerCon EU 2015: Monitoring Docker
PDF
Performance Monitoring for Docker Environments - Docker Amsterdam June Meetup
PDF
Challenges in a Microservices Age: Monitoring, Logging and Tracing on Red Hat...
PDF
Lessons Learned From Running Spark On Docker
PDF
Docker Swarm & Machine
PPTX
A docker love story
PDF
Dockerizing OpenStack for High Availability
PPTX
Monitoring docker-container-and-dockerized-applications
PPTX
Monitoring docker container and dockerized applications
PPTX
Monitoring-Docker-Container-and-Dockerized-Applications
PDF
Alex Dias: how to build a docker monitoring solution
PDF
Running & Monitoring Docker at Scale
PPTX
Docker Orchestration: Welcome to the Jungle! Devoxx & Docker Meetup Tour Nov ...
PDF
Monitoring kubernetes across data center and cloud
How to build a container monitoring solution - David Gildeh, CEO and Co-Found...
DOD 2016 - Stefan Thies - Monitoring and Log Management for Docker Swarm and...
Docker Usage Patterns - Meetup Docker Paris - November, 10th 2015
Monitoring and Log Management for
Monitoring Docker at Scale - Docker San Francisco Meetup - August 11, 2015
It's What's Inside that Counts!
DockerCon EU 2015: Monitoring Docker
Performance Monitoring for Docker Environments - Docker Amsterdam June Meetup
Challenges in a Microservices Age: Monitoring, Logging and Tracing on Red Hat...
Lessons Learned From Running Spark On Docker
Docker Swarm & Machine
A docker love story
Dockerizing OpenStack for High Availability
Monitoring docker-container-and-dockerized-applications
Monitoring docker container and dockerized applications
Monitoring-Docker-Container-and-Dockerized-Applications
Alex Dias: how to build a docker monitoring solution
Running & Monitoring Docker at Scale
Docker Orchestration: Welcome to the Jungle! Devoxx & Docker Meetup Tour Nov ...
Monitoring kubernetes across data center and cloud

More from Sematext Group, Inc. (12)

PDF
Tweaking the Base Score: Lucene/Solr Similarities Explained
PDF
OOPs, OOMs, oh my! Containerizing JVM apps
PPTX
Is observability good for your brain?
PDF
Introducing log analysis to your organization
PDF
Building Resilient Log Aggregation Pipeline with Elasticsearch & Kafka
PPT
Running High Performance and Fault Tolerant Elasticsearch Clusters on Docker
PDF
(Elastic)search in big data
PDF
Side by Side with Elasticsearch and Solr
PDF
Open Source Search Evolution
PDF
Elasticsearch and Solr for Logs
PDF
Introduction to Elasticsearch
PPTX
Administering and Monitoring SolrCloud Clusters
Tweaking the Base Score: Lucene/Solr Similarities Explained
OOPs, OOMs, oh my! Containerizing JVM apps
Is observability good for your brain?
Introducing log analysis to your organization
Building Resilient Log Aggregation Pipeline with Elasticsearch & Kafka
Running High Performance and Fault Tolerant Elasticsearch Clusters on Docker
(Elastic)search in big data
Side by Side with Elasticsearch and Solr
Open Source Search Evolution
Elasticsearch and Solr for Logs
Introduction to Elasticsearch
Administering and Monitoring SolrCloud Clusters

Recently uploaded (20)

PPT
Chapter 2 METAL FORMINGhhhhhhhjjjjmmmmmmmmm
PPTX
Bharatiya Antariksh Hackathon 2025 Idea Submission PPT.pptx
PPTX
Business Acumen Training GuidePresentation.pptx
PDF
Lecture1 pattern recognition............
PPTX
Introduction to machine learning and Linear Models
PPT
Chapter 3 METAL JOINING.pptnnnnnnnnnnnnn
PDF
.pdf is not working space design for the following data for the following dat...
PPTX
Computer network topology notes for revision
PPTX
Database Infoormation System (DBIS).pptx
PDF
“Getting Started with Data Analytics Using R – Concepts, Tools & Case Studies”
PPTX
climate analysis of Dhaka ,Banglades.pptx
PDF
Foundation of Data Science unit number two notes
PDF
Galatica Smart Energy Infrastructure Startup Pitch Deck
PDF
Mega Projects Data Mega Projects Data
PDF
22.Patil - Early prediction of Alzheimer’s disease using convolutional neural...
PDF
Fluorescence-microscope_Botany_detailed content
PPTX
05. PRACTICAL GUIDE TO MICROSOFT EXCEL.pptx
PPTX
Introduction-to-Cloud-ComputingFinal.pptx
PPTX
MODULE 8 - DISASTER risk PREPAREDNESS.pptx
PPTX
Introduction to Basics of Ethical Hacking and Penetration Testing -Unit No. 1...
Chapter 2 METAL FORMINGhhhhhhhjjjjmmmmmmmmm
Bharatiya Antariksh Hackathon 2025 Idea Submission PPT.pptx
Business Acumen Training GuidePresentation.pptx
Lecture1 pattern recognition............
Introduction to machine learning and Linear Models
Chapter 3 METAL JOINING.pptnnnnnnnnnnnnn
.pdf is not working space design for the following data for the following dat...
Computer network topology notes for revision
Database Infoormation System (DBIS).pptx
“Getting Started with Data Analytics Using R – Concepts, Tools & Case Studies”
climate analysis of Dhaka ,Banglades.pptx
Foundation of Data Science unit number two notes
Galatica Smart Energy Infrastructure Startup Pitch Deck
Mega Projects Data Mega Projects Data
22.Patil - Early prediction of Alzheimer’s disease using convolutional neural...
Fluorescence-microscope_Botany_detailed content
05. PRACTICAL GUIDE TO MICROSOFT EXCEL.pptx
Introduction-to-Cloud-ComputingFinal.pptx
MODULE 8 - DISASTER risk PREPAREDNESS.pptx
Introduction to Basics of Ethical Hacking and Penetration Testing -Unit No. 1...

Docker Monitoring Webinar

  • 1. Docker Monitoring Webinar 20% OFF 201509WNR20S 201509WNR20L sematext.com/spm sematext.com/logsene
  • 3. Intro SPM: Performance monitoring, Anomaly Detection and Alerting Logsene: Centralized Log Management Search and Big Data Consulting Support for Solr and Elasticsearch
  • 4. Agenda ● Docker Monitoring ○ Docker Monitoring Basics ○ Deployment Options for Docker Agents ● Application Monitoring on Docker ○ Monitoring Containerized Applications ○ Deployment Options for Application Monitoring Agents
  • 5. Why we like Blue Whales ● Portable packaging ● Optimized resource usage ● Configurable resource limits ● Isolated environment for apps
  • 6. What is Docker made of?
  • 8. Docker Challenges ● New workflows for deployments ○ from developer laptop straight to the Cloud ● Orchestration of applications ● Logging ○ Webinars 29/30 September, @sematext ● Monitoring
  • 9. Docker Monitoring Basics Let’s understand what we monitor!
  • 10. Why Docker Monitoring You can’t fix problems you don’t see! ● Tuning ○ Resources / Container Limits ○ Application Performance ● Quality assurance ● Capacity planning ● Availability / SLA’s
  • 11. What to monitor? Cluster Server 1 Container 1 Container 2 Container N Container 1 Elasticsearch Container 2 Node.js - web service Container N NGINX - reverse proxy Server N JVM Runtime Env JS Runtime Env
  • 12. The Metrics Stack Changed! Server Metrics Runtime Metrics App Metrics Server Metrics Runtime Metrics App Metrics Container Metrics Runtime Metrics = JVM Metrics or Node.js Metrics, … Without Docker With Docker
  • 13. Poll What is the result of ‘vmstat’ when started in a container? A) OS Metrics limited to the container B) OS Metrics from the docker host
  • 14. Docker Stats Command > docker stats $(docker ps -q) CONTAINER CPU % MEM USAGE/LIMIT MEM % NET I/O 19a9f4c9ecb7 0.00% 1.421 MB/3.944 GB 0.04% 0 B/0 B 7f043a32307c 0.00% 1.413 MB/3.944 GB 0.04% 0 B/0 B 889646bd003f 0.11% 4.235 MB/3.944 GB 0.11% 0 B/0 B 9a29f494bf7d 0.27% 156.8 MB/3.944 GB 3.98% 0 B/0 B Too simple!
  • 15. Docker API for Metrics > echo -e "GET /containers/3236f3328bbd/stats HTTP/1.0rn" | nc -U /var/run/docker.sock HTTP/1.0 200 OK Date: Thu, 30 Jul 2015 08:37:31 GMT Content-Type: text/plain; charset=utf-8 {"read":"2015-07-30T04:37:31.13789208-04:00","network":{"rx_bytes":636450,"rx_packets":1944," rx_errors":0,"rx_dropped":0,"tx_bytes":495897,"tx_packets":2415,"tx_errors":0,"tx_dropped":0}," precpu_stats":{"cpu_usage":{"total_usage":0,"percpu_usage":null,"usage_in_kernelmode":0," usage_in_usermode":0},"system_cpu_usage":0,"throttling_data":{"periods":0,"throttled_periods": 0,"throttled_time":0}},"cpu_stats ... Too verbose! More than 70 Metrics are exposed
  • 16. Watching a Metric > echo -e "GET /containers/3236f3328bbd/stats HTTP/1.0rn" | nc -U /var/run/docker.sock | logagent -y | grep rx_bytes rx_bytes: 667326 rx_bytes: 667354 rx_bytes: 667413 rx_bytes: 667538 github.com/sematext/logagent-js Which Metrics are most relevant?
  • 18. Server Metrics ● CPU ● Memory Usage ● Disk Space ○ Docker Images consume a lot of disk space
  • 19. Container Metrics ● Containers CPU + Throttled CPU time / CPU limits! ● Memory Limits + Memory Allocation Fail Counters ● Disk I/O + Wait Times ● Network I/O + Network Errors
  • 21. Beyond Metrics: Events ● Docker Events ○ container auditing ○ create, destroy, die, export, kill, pause, restart, start, stop, unpause, oom
  • 22. Beyond Metrics: Logs ● Logs ○ Docker collects console output of each container ○ API or Log Drivers for forwarding ● Correlation with Metrics ○ Faster troubleshooting blog.sematext.com/2015/08/11/docker-logging-webinar/ Docker Logging Webinar
  • 24. Directly on each Docker Host ● The traditional way! ● Full access to the operating system ● Limitations in ’Container only’ systems - CoreOS - RancherOS - Many PaaS Solutions, e.g., DEIS
  • 25. One Container on each Docker Host ● Yes. The Docker Way! ● Portable to any ‘Docker platform’ ● Requirements: - Access to the Host Metrics + Docker API - Extended privileges (e.g., for SELinux, GCE,...)
  • 27. SPM for Docker Monitoring apps.sematext.com/spm-reports/registerApplication.do hub.docker.com/r/sematext/spm-agent-docker/ github.com/sematext/spm-agent-docker
  • 28. Example 1: Run SPM for Docker docker run -d --name spm-agent -v /var/run/docker.sock:/var/run/docker.sock -e SPM_TOKEN=fe31fc3a-xxxx-47c6-b83c-be376bfxxx -e HOSTNAME=$HOSTNAME -e SPM_MONITORING_TAGS="project:dev-test,role:demo" -e LOGSENE_TOKEN=53a6c7e7-xxxx-4725-962e-ea47cebxxx --privileged sematext/spm-agent-docker
  • 29. Example 2: CoreOS + DEIS ● CoreOS has no package manager ● systemd - init system ● fleet - as distributed init system ● etcd - for central configurations How to distribute a Monitoring Agent to all CoreOS servers in a cluster?
  • 31. Example 2: Distribute the Agent # Configure SPM app token etcdctl set /sematext.com/myapp/spm/token YOUR_SPM_TOKEN # Download the fleet unit file for SPM wget https://raw.githubusercontent.com/sematext/spm-agent-docker/master/coreos/spm-agent.service -O spm-agent.service # Start SPM Agent in the whole cluster fleetctl load spm-agent.service fleetctl start spm-agent.service
  • 32. Example 3: RANCHER OS ● Minimalistic (~25 MB !) ● No package manager ● All system services are containers ● No cluster manager (by default) ● Use restart policy ‘always’ for services docker run --restart=always … sematext/spm-agent-docker
  • 35. How are Applications monitored? ● Standalone Agents ○ Remote interface: JMX, MySQL, NGINX, Apache ○ No restart required, when agent gets updated ● In-Process Agents ○ Resource friendly ○ Node.js ○ JVM Apps (Elasticsearch, Solr, Kafka, ...) - Function Transaction/Call Tracing possible
  • 36. Transaction Tracing + AppMap ● Only possible with in-process monitoring
  • 37. Deployment Options for Application Monitoring … on Docker
  • 38. Everything in Each Container
  • 41. Setup for Elasticsearch Image spm-client: image: sematext/spm-client # Exports Volume /opt/spm container_name: spm-client environment: - SPM_CFG="${SPM_TOKEN} es javaagent jvmname:ES1" ELASTICSEARCH: image: elasticsearch ports: - "9200:9200" volumes_from: - spm-client environment: # inject in-process monitor from SPM client volume /opt/spm - ES_JAVA_OPTS="-Dcom.sun.management.jmxremote -javaagent:/opt/spm/spm-monitor/lib/spm-monitor-es.jar=${SPM_TOKEN}::ES1"
  • 42. Setup for node.js Apps Dockerfile: FROM nodejs RUN git clone my/app RUN npm i RUN npm i spm-agent-nodejs CMD node -r spm-agent-nodejs app.js --- docker build -t myapp . docker run -e SPM_TOKEN=43A... myapp
  • 44. SPM Logsene METRICS + LOGS ⇒ BETTER TOGETHER
  • 46. Docker Monitoring Webinar 20% OFF 201509WNR20S 201509WNR20L sematext.com/spm sematext.com/logsene
  • 47. Thank you for your attention