All Projects → kuldeepsingh99 → microservice-elk

kuldeepsingh99 / microservice-elk

Licence: other
Creating microservice using Spring Boot, Eureka, Zuul, Sleuth, Zipkin and ELK Stack

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to microservice-elk

Microservice Scaffold
基于Spring Cloud(Greenwich.SR2)搭建的微服务脚手架(适用于在线系统),已集成注册中心(Nacos Config)、配置中心(Nacos Discovery)、认证授权(Oauth 2 + JWT)、日志处理(ELK + Kafka)、限流熔断(AliBaba Sentinel)、应用指标监控(Prometheus + Grafana)、调用链监控(Pinpoint)、以及Spring Boot Admin。
Stars: ✭ 211 (+1010.53%)
Mutual labels:  kibana, logstash, spring-cloud, zuul
Spring Cloud Microservices Development
Spring Cloud Microservices Development.《Spring Cloud 微服务架构开发实战》
Stars: ✭ 106 (+457.89%)
Mutual labels:  kibana, logstash, spring-cloud, zuul
Sample Spring Microservices
Many samples in different branches that shows how to create microservices with Spring Boot, Spring Cloud, Zipkin, Zuul, Eureka, Hystrix, Kubernetes, Elastic Stack and many more tools
Stars: ✭ 368 (+1836.84%)
Mutual labels:  kibana, logstash, spring-cloud, zuul
elk-stack
ELK Stack (Elasticsearch, Logstash & Kibana)
Stars: ✭ 13 (-31.58%)
Mutual labels:  kibana, logstash, elk-stack
Spring Boot Microservice Eureka Zuul Docker
Spring-Boot rest microservices using Eureka, Zuul, Docker. Monitoring with logstash, logback, elasticsearch, kibana
Stars: ✭ 45 (+136.84%)
Mutual labels:  kibana, logstash, zuul
Elastic
Elastic Stack (6.2.4) 을 활용한 Dashboard 만들기 Project
Stars: ✭ 121 (+536.84%)
Mutual labels:  kibana, logstash, elk-stack
Elk Hole
elasticsearch, logstash and kibana configuration for pi-hole visualiziation
Stars: ✭ 136 (+615.79%)
Mutual labels:  kibana, logstash, elk-stack
Json Logging Python
Python logging library to emit JSON log that can be easily indexed and searchable by logging infrastructure such as ELK, EFK, AWS Cloudwatch, GCP Stackdriver
Stars: ✭ 143 (+652.63%)
Mutual labels:  kibana, logstash, elk-stack
Microservices Sample
Sample project to create an application using microservices architecture
Stars: ✭ 167 (+778.95%)
Mutual labels:  kibana, logstash, zuul
k8s-elk
Kubernetes ELK - ElasticSearch, Kibana, Logstash, and all the trimmings
Stars: ✭ 37 (+94.74%)
Mutual labels:  kibana, logstash, elk-stack
ELK-Hunting
Threat Hunting with ELK Workshop (InfoSecWorld 2017)
Stars: ✭ 58 (+205.26%)
Mutual labels:  kibana, logstash, elk-stack
spring-boot-elk
An sample todo app demonstrating centralised logging using ELK stack
Stars: ✭ 20 (+5.26%)
Mutual labels:  kibana, logstash, elk-stack
spring-boot-microservice-eureka-zuul-docker-gateway-kubernetes
Spring Boot rest microservices using Kubernetes, ConfigMap, Eureka, Zuul / Spring Boot Gateway, Docker. Monitoring with logstash, logback, elasticsearch, kibana.
Stars: ✭ 86 (+352.63%)
Mutual labels:  kibana, logstash, zuul
skalogs-bundle
Open Source data and event driven real time Monitoring and Analytics Platform
Stars: ✭ 16 (-15.79%)
Mutual labels:  kibana, logstash, elk-stack
Helk
The Hunting ELK
Stars: ✭ 3,097 (+16200%)
Mutual labels:  kibana, logstash, elk-stack
tutorials
Tutorials
Stars: ✭ 80 (+321.05%)
Mutual labels:  kibana, logstash, elk-stack
MeetU
Application that build on Elasticsearch and Spring Boot Microservices (Synchronous Service)
Stars: ✭ 22 (+15.79%)
Mutual labels:  logstash, spring-cloud, elk-stack
eslog tutorial
From Raw Logs to Real Insights - A tutorial for getting started with log analytics using Elastic Stack.
Stars: ✭ 28 (+47.37%)
Mutual labels:  kibana, logstash, elk-stack
docker-elk-stack
The ELK stack Docker containerization (Elasticsearch, Logstash and Kibana)
Stars: ✭ 20 (+5.26%)
Mutual labels:  kibana, logstash
aws-elb-logs-to-logstash
Consumes ELB & ALB logs and sends them to logstash for ingestion. Kibana dashboard included.
Stars: ✭ 26 (+36.84%)
Mutual labels:  kibana, logstash

Creating microservice using Spring Boot, Eureka, Zuul, Sleuth, Zipkin and ELK Stack

Spring framework provides set of libraries for creating microservices in Java.

  • Zuul - gateway service that provides dynamic routing, monitoring, resiliency, security, and more
  • Eureka - service registration and discovery
  • Sleuth - distributed tracing via logs
  • Zipkin - distributed tracing system with request visualization
  • ELK Stack - We are using Logstash, Elastics Search and Kibana to index logs

About the example

  1. account :- Its a microservice, spring boot and sleuth is used to implement the same
  2. product :- its a microservice, spring boot and sleuth is used to implement the same
  3. apigateway :- its a API Gateway, spring Zuul is used to implement the same
  4. eureka-service :- its for service discovery and registration, spring Eureka is used to implement the same
  5. zipkin-service :- its for log tracking, spring zipkin is used to implement the same

Technologies/dependencies

  1. Java 8
  2. Spring boot, sleuth, zipkin, eureka
  3. ELK - Elastics search, logstash and Kibana

Why do we need ELK Stack

With use of microservices, we are able to create stable distributed applications. But it has also introduced few challenges in other areas e.g. distributed log management and ability to view logs of full transaction distributed among many services and distributed debugging in general.

As the number of microservice increases and we enable cloud deployment with automated continuous integration tools, it is very much necessary to have some provision of debugging the components when we have any problem, we have a tool called Elastics Search, Logstash and Kibana

ELK Stack

  1. Elastics Search is a distributed, JSON-based search and analytics engine designed for horizontal scalability, maximum reliability, and easy management.
  2. Logstash is a dynamic data collection pipeline with an extensible plugin ecosystem and strong Elasticsearch synergy.
  3. Kibana gives the visualization of data through a UI.

ELK Stack Architecture

alt text

ELK Configuration

We will use Docker container to run the ELK Stack

  1. Run this command on the docker terminal.

    • docker run -d -it --name es -p 9200:9200 -p 9300:9300 -e ES_JAVA_OPTS="-Xms1g -Xmx1g" -m 1500m elasticsearch

    This command will start elastics search container on 9200/9300 port

    • docker run -d -it --name kibanak --link es:elasticsearch -p 5601:5601 kibana

    This command will start Kibana on 5601 port and it will also link it with elastics search container

    • docker run -d -it --name logstash -p 5000:5000 logstash -e 'input { tcp { port => 5000 codec => "json" } } output { elasticsearch { hosts => ["192.168.99.100"] index => "micro-%{serviceName}"} }'

    This command will start Logstash container on 5000 port and it will also create an index with name micro-*

  2. Checking with docker ps command, all their container should be running alt text

  3. Default port used for docker container is 192.168.99.100

Creating Micro Service

Spring Zuul, eureka flow

alt text

These are the default ports used for the services in this example

  1. account :- 8080
  2. product :- 9090
  3. apigateway :- 8765
  4. eureka-service :- 8761
  5. zipkin-service :- 9411

Download the the services and import it to Eclipse or any Id

Run all the services one by one and make sure all the services are running, you need to run product and account microservice with multiple ports e.g. spring-boot:run -Dserver.port=8080, spring-boot:run -Dserver.port=8081

  1. Open the Eureka Service (its running on port 8761)

    • Here we observed that two microservice (Account and Product) is registered with different ports alt text
  2. Try to Access to access account service http://localhost:8765/api/account/greeting

    • We will get response from Account Service
  3. Checking the log Traces on zipkin server http://localhost:9411/

    • here we can check all the log traces, in our example account microservice calls product microservice, so we can check here that which service took how much time etc. alt text
  4. Finally check logs on Kibana

    • In Kibana we can check every log from our microserivices
    • with simple Log.info statement and logback.xml configuration we can index and view log on Kibana

logger.info(" inside getproductdetails Micro service ");

please check logback.xml (in account and product) for more details

alt text

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].