SlideShare a Scribd company logo
2
Most read
4
Most read
Log Analysis and Visualization using ELK Stack
(Elasticsearch, Logstash, Kibana) and Filebeat
By
Vineet K Sabharwal
https://www.linkedin.com/in/vineetkanwal/
Agenda
Challenges in logging for Microservices
What is ELK stack or Elastic Stack?
Using Filebeat (Need and Advantages)
Spring Cloud Sleuth and Zipkin
Logback and Mapped Diagnostic Context (MDC)
Using Spring AOP to add Response time
Alerting and Notifications using Elastalert
Configuration demo and Example Microservices
Challenges in logging for Microservices
Microservices are all about breaking things down to individual components. As a side effect, ops
procedures and monitoring are also breaking down per service and lose their power for the
system as a whole. The challenge here is to centralize the Application Logs which will come from
several different Microservices from docker containers running on multiple hosts.
Traditional logging is ineffective because microservices are stateless, distributed and
independent — you would produce too many logs to easily locate a problem. Logging must be
able to correlate events across several platforms.
As the system becomes highly fragmented with more and more microservices added for
performing specific tasks, there will be stronger need for centralized monitoring and logging, to
have a fair shot at understanding what’s going on.
What is ELK stack or Elastic Stack?
The ELK stack consists of Elasticsearch, Logstash, and Kibana.
Main advantages with Elastic Stack
◦ Open source, no license cost
◦ A vital component for building scalable search driven solutions
◦ Not only a search tool, but a full fletched Document database, perfect for your database offloading needs
◦ Flexible expert support options thanks to different type of Subscriptions
◦ Can be used as Business Intelligence tool
Using Filebeat (Need and Advantages)
Filebeat acts as a lightweight agent
deployed on the edge host, pumping
data into Logstash for aggregation,
filtering and enrichment.
Feeding logs directly to logstash using
appender introduces performance
overhead.
Filebeat is lightweight, supports SSL
and TLS encryption, supports back
pressure with a good built-in recovery
mechanism, and is extremely reliable.
Filebeat cannot turn logs into easy-
to-analyze structured log messages
using filters for log enhancements.
That’s the role played by Logstash.
Spring Cloud Sleuth and ZipkinSpring Cloud Sleuth is a powerful tool for enhancing logs in any application, but especially in a system built up of multiple
services.
It introduces unique IDs to your logging which are consistent between microservice calls which makes it possible to find
how a single request travels from one microservice to the next.
Spring Cloud Sleuth adds two types of IDs to your logging, one called a trace ID and the other called a span ID. The span ID
represents a basic unit of work, for example sending an HTTP request. The trace ID contains a set of span IDs, forming a
tree-like structure. The trace ID will remain the same as one microservice calls the next.
Zipkin shows how long a request took from one microservice to the next.
Spring Cloud Sleuth will send tracing information to any Zipkin server you point it to when you include the dependency
spring-cloud-sleuth-zipkin in your project.
Logback and Mapped Diagnostic Context
(MDC)
• Logback (https://logback.qos.ch/) is successor to the popular log4j project.
• Logback brings a very large number of improvements over log4j like logback-
classic implements the SLF4J API natively reducing the work involved in switching
logging frameworks, Graceful recovery from I/O failures, Automatic compression
of archived log files, filters, etc.
• Mapped Diagnostic Context (MDC) is a feature which lets the developer place
information in a diagnostic context that can be subsequently retrieved. For
instance, it can be used to record response time for each API request in micro
services.
Using Spring AOP to add Response time
• Measuring and analysing the response time that APIs take is very important part of
monitoring performance.
• Spring AOP can be used to add response time around APIs as aspects with minimum
performance overhead.
• First, you need to include the spring-aop, aspectj and cglib libraries as dependencies.
• Next, identify the APIs that need monitoring and put the AOP hooks in place.
• Add the response time as MDC (Mapped Diagnostic Context) variable for analysing in
Kibana.
Alerting and Notifications using Elastalert
ELK stack does not natively have an alerting system.
ElastAlert (https://elastalert.readthedocs.io/) is open source library from Yelp built using python, which
can be used to create alerts on top of Elasticsearch. These alerts can be email, JIRA , slack, hipchat and
many more.
ElastAlert has a global configuration file, config.yaml, which defines several aspects of its operation.
Rules are defined in the rules folder set in the config file.
Every file that ends in .yaml in the rules_folder will be run by default.
Configuration demo and Example Microservices
Questions?

More Related Content

What's hot (20)

PDF
ksqlDB로 실시간 데이터 변환 및 스트림 처리
confluent
 
PDF
Creating Connector to Bridge the Worlds of Kafka and gRPC at Wework (Anoop Di...
confluent
 
PPTX
Apache Kafka Best Practices
DataWorks Summit/Hadoop Summit
 
PDF
MariaDB MaxScale monitor 매뉴얼
NeoClova
 
PPTX
Centralized Logging System Using ELK Stack
Rohit Sharma
 
PDF
Making Apache Spark Better with Delta Lake
Databricks
 
PPTX
Customer Intelligence: Using the ELK Stack to Analyze ForgeRock OpenAM Audit ...
ForgeRock
 
PDF
Fundamentals of Apache Kafka
Chhavi Parasher
 
PDF
Elastic Stack 을 이용한 게임 서비스 통합 로깅 플랫폼 - elastic{on} 2019 Seoul
SeungYong Oh
 
PDF
Introduction to elasticsearch
pmanvi
 
PDF
Naver속도의, 속도에 의한, 속도를 위한 몽고DB (네이버 컨텐츠검색과 몽고DB) [Naver]
MongoDB
 
PDF
AWS Batch를 통한 손쉬운 일괄 처리 작업 관리하기 - 윤석찬 (AWS 테크에반젤리스트)
Amazon Web Services Korea
 
PDF
Building an analytics workflow using Apache Airflow
Yohei Onishi
 
PDF
Postgresql database administration volume 1
Federico Campoli
 
PPTX
Convert single instance to RAC
Satishbabu Gunukula
 
ODP
Stream processing using Kafka
Knoldus Inc.
 
PPTX
ELK Stack
Phuc Nguyen
 
PPTX
Log management with ELK
Geert Pante
 
PPTX
Elk
Caleb Wang
 
PPTX
Getting started with postgresql
botsplash.com
 
ksqlDB로 실시간 데이터 변환 및 스트림 처리
confluent
 
Creating Connector to Bridge the Worlds of Kafka and gRPC at Wework (Anoop Di...
confluent
 
Apache Kafka Best Practices
DataWorks Summit/Hadoop Summit
 
MariaDB MaxScale monitor 매뉴얼
NeoClova
 
Centralized Logging System Using ELK Stack
Rohit Sharma
 
Making Apache Spark Better with Delta Lake
Databricks
 
Customer Intelligence: Using the ELK Stack to Analyze ForgeRock OpenAM Audit ...
ForgeRock
 
Fundamentals of Apache Kafka
Chhavi Parasher
 
Elastic Stack 을 이용한 게임 서비스 통합 로깅 플랫폼 - elastic{on} 2019 Seoul
SeungYong Oh
 
Introduction to elasticsearch
pmanvi
 
Naver속도의, 속도에 의한, 속도를 위한 몽고DB (네이버 컨텐츠검색과 몽고DB) [Naver]
MongoDB
 
AWS Batch를 통한 손쉬운 일괄 처리 작업 관리하기 - 윤석찬 (AWS 테크에반젤리스트)
Amazon Web Services Korea
 
Building an analytics workflow using Apache Airflow
Yohei Onishi
 
Postgresql database administration volume 1
Federico Campoli
 
Convert single instance to RAC
Satishbabu Gunukula
 
Stream processing using Kafka
Knoldus Inc.
 
ELK Stack
Phuc Nguyen
 
Log management with ELK
Geert Pante
 
Getting started with postgresql
botsplash.com
 

Similar to Logging using ELK Stack for Microservices (20)

PPTX
Latency analysis for your microservices using Spring Cloud & Zipkin
VMware Tanzu
 
PDF
Combining Logs, Metrics, and Traces for Unified Observability
Elasticsearch
 
PDF
Implementing microservices tracing with spring cloud and zipkin (spring one)
Reshmi Krishna
 
PDF
Combining logs, metrics, and traces for unified observability
Elasticsearch
 
DOCX
Log management with_logstash_and_elastic_search
Rishav Rohit
 
PDF
Combinación de logs, métricas y seguimiento para una visibilidad centralizada
Elasticsearch
 
PDF
Combinação de logs, métricas e rastreamentos para observabilidade unificada
Elasticsearch
 
DOCX
ESB APPLICTAION IMPROVEMENT -2024 - this
umabaskaran171094
 
PPTX
Micro services Architecture
Jenis Dharmadurai
 
PDF
Combinación de logs, métricas y seguimiento para una visibilidad centralizada
Elasticsearch
 
PDF
Analysis of Network Traffic and Security through Log Aggregation
IJCSIS Research Publications
 
PDF
Technology behind-real-time-log-analytics
Data Science Thailand
 
PPTX
Centralized log-management-with-elastic-stack
Rich Lee
 
PPTX
centralization of log systems pour suivis
Thierry Gayet
 
PDF
Monitoring&Logging - Stanislav Kolenkin
Kuberton
 
PPTX
ELK Solutions Enablement Session - 17th March'2020
Ashnikbiz
 
PDF
Distributed tracing - get a grasp on your production
nklmish
 
PPTX
System insight without Interference
Tony Tam
 
PDF
Combining Logs, Metrics, and Traces for Unified Observability
Elasticsearch
 
PDF
Les logs, traces et indicateurs au service d'une observabilité unifiée
Elasticsearch
 
Latency analysis for your microservices using Spring Cloud & Zipkin
VMware Tanzu
 
Combining Logs, Metrics, and Traces for Unified Observability
Elasticsearch
 
Implementing microservices tracing with spring cloud and zipkin (spring one)
Reshmi Krishna
 
Combining logs, metrics, and traces for unified observability
Elasticsearch
 
Log management with_logstash_and_elastic_search
Rishav Rohit
 
Combinación de logs, métricas y seguimiento para una visibilidad centralizada
Elasticsearch
 
Combinação de logs, métricas e rastreamentos para observabilidade unificada
Elasticsearch
 
ESB APPLICTAION IMPROVEMENT -2024 - this
umabaskaran171094
 
Micro services Architecture
Jenis Dharmadurai
 
Combinación de logs, métricas y seguimiento para una visibilidad centralizada
Elasticsearch
 
Analysis of Network Traffic and Security through Log Aggregation
IJCSIS Research Publications
 
Technology behind-real-time-log-analytics
Data Science Thailand
 
Centralized log-management-with-elastic-stack
Rich Lee
 
centralization of log systems pour suivis
Thierry Gayet
 
Monitoring&Logging - Stanislav Kolenkin
Kuberton
 
ELK Solutions Enablement Session - 17th March'2020
Ashnikbiz
 
Distributed tracing - get a grasp on your production
nklmish
 
System insight without Interference
Tony Tam
 
Combining Logs, Metrics, and Traces for Unified Observability
Elasticsearch
 
Les logs, traces et indicateurs au service d'une observabilité unifiée
Elasticsearch
 
Ad

Recently uploaded (20)

PPTX
Agentic Automation: Build & Deploy Your First UiPath Agent
klpathrudu
 
PPTX
OpenChain @ OSS NA - In From the Cold: Open Source as Part of Mainstream Soft...
Shane Coughlan
 
PPTX
AEM User Group: India Chapter Kickoff Meeting
jennaf3
 
PDF
iTop VPN With Crack Lifetime Activation Key-CODE
utfefguu
 
PPTX
Foundations of Marketo Engage - Powering Campaigns with Marketo Personalization
bbedford2
 
PDF
AI + DevOps = Smart Automation with devseccops.ai.pdf
Devseccops.ai
 
PPTX
Home Care Tools: Benefits, features and more
Third Rock Techkno
 
PPTX
ChiSquare Procedure in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PDF
Wondershare PDFelement Pro Crack for MacOS New Version Latest 2025
bashirkhan333g
 
PDF
Download Canva Pro 2025 PC Crack Full Latest Version
bashirkhan333g
 
PDF
MiniTool Partition Wizard Free Crack + Full Free Download 2025
bashirkhan333g
 
PDF
How to Hire AI Developers_ Step-by-Step Guide in 2025.pdf
DianApps Technologies
 
PDF
vMix Pro 28.0.0.42 Download vMix Registration key Bundle
kulindacore
 
PDF
Linux Certificate of Completion - LabEx Certificate
VICTOR MAESTRE RAMIREZ
 
PDF
Build It, Buy It, or Already Got It? Make Smarter Martech Decisions
bbedford2
 
PPTX
Agentic Automation Journey Series Day 2 – Prompt Engineering for UiPath Agents
klpathrudu
 
PPTX
Tally software_Introduction_Presentation
AditiBansal54083
 
PDF
Odoo CRM vs Zoho CRM: Honest Comparison 2025
Odiware Technologies Private Limited
 
PDF
Automate Cybersecurity Tasks with Python
VICTOR MAESTRE RAMIREZ
 
PDF
SciPy 2025 - Packaging a Scientific Python Project
Henry Schreiner
 
Agentic Automation: Build & Deploy Your First UiPath Agent
klpathrudu
 
OpenChain @ OSS NA - In From the Cold: Open Source as Part of Mainstream Soft...
Shane Coughlan
 
AEM User Group: India Chapter Kickoff Meeting
jennaf3
 
iTop VPN With Crack Lifetime Activation Key-CODE
utfefguu
 
Foundations of Marketo Engage - Powering Campaigns with Marketo Personalization
bbedford2
 
AI + DevOps = Smart Automation with devseccops.ai.pdf
Devseccops.ai
 
Home Care Tools: Benefits, features and more
Third Rock Techkno
 
ChiSquare Procedure in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
Wondershare PDFelement Pro Crack for MacOS New Version Latest 2025
bashirkhan333g
 
Download Canva Pro 2025 PC Crack Full Latest Version
bashirkhan333g
 
MiniTool Partition Wizard Free Crack + Full Free Download 2025
bashirkhan333g
 
How to Hire AI Developers_ Step-by-Step Guide in 2025.pdf
DianApps Technologies
 
vMix Pro 28.0.0.42 Download vMix Registration key Bundle
kulindacore
 
Linux Certificate of Completion - LabEx Certificate
VICTOR MAESTRE RAMIREZ
 
Build It, Buy It, or Already Got It? Make Smarter Martech Decisions
bbedford2
 
Agentic Automation Journey Series Day 2 – Prompt Engineering for UiPath Agents
klpathrudu
 
Tally software_Introduction_Presentation
AditiBansal54083
 
Odoo CRM vs Zoho CRM: Honest Comparison 2025
Odiware Technologies Private Limited
 
Automate Cybersecurity Tasks with Python
VICTOR MAESTRE RAMIREZ
 
SciPy 2025 - Packaging a Scientific Python Project
Henry Schreiner
 
Ad

Logging using ELK Stack for Microservices

  • 1. Log Analysis and Visualization using ELK Stack (Elasticsearch, Logstash, Kibana) and Filebeat By Vineet K Sabharwal https://www.linkedin.com/in/vineetkanwal/
  • 2. Agenda Challenges in logging for Microservices What is ELK stack or Elastic Stack? Using Filebeat (Need and Advantages) Spring Cloud Sleuth and Zipkin Logback and Mapped Diagnostic Context (MDC) Using Spring AOP to add Response time Alerting and Notifications using Elastalert Configuration demo and Example Microservices
  • 3. Challenges in logging for Microservices Microservices are all about breaking things down to individual components. As a side effect, ops procedures and monitoring are also breaking down per service and lose their power for the system as a whole. The challenge here is to centralize the Application Logs which will come from several different Microservices from docker containers running on multiple hosts. Traditional logging is ineffective because microservices are stateless, distributed and independent — you would produce too many logs to easily locate a problem. Logging must be able to correlate events across several platforms. As the system becomes highly fragmented with more and more microservices added for performing specific tasks, there will be stronger need for centralized monitoring and logging, to have a fair shot at understanding what’s going on.
  • 4. What is ELK stack or Elastic Stack? The ELK stack consists of Elasticsearch, Logstash, and Kibana. Main advantages with Elastic Stack ◦ Open source, no license cost ◦ A vital component for building scalable search driven solutions ◦ Not only a search tool, but a full fletched Document database, perfect for your database offloading needs ◦ Flexible expert support options thanks to different type of Subscriptions ◦ Can be used as Business Intelligence tool
  • 5. Using Filebeat (Need and Advantages) Filebeat acts as a lightweight agent deployed on the edge host, pumping data into Logstash for aggregation, filtering and enrichment. Feeding logs directly to logstash using appender introduces performance overhead. Filebeat is lightweight, supports SSL and TLS encryption, supports back pressure with a good built-in recovery mechanism, and is extremely reliable. Filebeat cannot turn logs into easy- to-analyze structured log messages using filters for log enhancements. That’s the role played by Logstash.
  • 6. Spring Cloud Sleuth and ZipkinSpring Cloud Sleuth is a powerful tool for enhancing logs in any application, but especially in a system built up of multiple services. It introduces unique IDs to your logging which are consistent between microservice calls which makes it possible to find how a single request travels from one microservice to the next. Spring Cloud Sleuth adds two types of IDs to your logging, one called a trace ID and the other called a span ID. The span ID represents a basic unit of work, for example sending an HTTP request. The trace ID contains a set of span IDs, forming a tree-like structure. The trace ID will remain the same as one microservice calls the next. Zipkin shows how long a request took from one microservice to the next. Spring Cloud Sleuth will send tracing information to any Zipkin server you point it to when you include the dependency spring-cloud-sleuth-zipkin in your project.
  • 7. Logback and Mapped Diagnostic Context (MDC) • Logback (https://logback.qos.ch/) is successor to the popular log4j project. • Logback brings a very large number of improvements over log4j like logback- classic implements the SLF4J API natively reducing the work involved in switching logging frameworks, Graceful recovery from I/O failures, Automatic compression of archived log files, filters, etc. • Mapped Diagnostic Context (MDC) is a feature which lets the developer place information in a diagnostic context that can be subsequently retrieved. For instance, it can be used to record response time for each API request in micro services.
  • 8. Using Spring AOP to add Response time • Measuring and analysing the response time that APIs take is very important part of monitoring performance. • Spring AOP can be used to add response time around APIs as aspects with minimum performance overhead. • First, you need to include the spring-aop, aspectj and cglib libraries as dependencies. • Next, identify the APIs that need monitoring and put the AOP hooks in place. • Add the response time as MDC (Mapped Diagnostic Context) variable for analysing in Kibana.
  • 9. Alerting and Notifications using Elastalert ELK stack does not natively have an alerting system. ElastAlert (https://elastalert.readthedocs.io/) is open source library from Yelp built using python, which can be used to create alerts on top of Elasticsearch. These alerts can be email, JIRA , slack, hipchat and many more. ElastAlert has a global configuration file, config.yaml, which defines several aspects of its operation. Rules are defined in the rules folder set in the config file. Every file that ends in .yaml in the rules_folder will be run by default.
  • 10. Configuration demo and Example Microservices