Spring-Boot rest microservices using Eureka, Zuul, Docker. Monitoring with logstash, logback, elasticsearch, kibana
This project is created to get experience on Microservices With Netflix OSS. This is a simple project by coded imperative programming with simple business requirements.
ELK Stack has been integrated for monitoring since version 1.1.0.
Backoffice microservice has an endpoint with path “/api/v1/backoffice/orders”. This endpoint return a list of orders with name of product and account. It connects accounts, products and orders
microservices via Feign.
Service | EndPoint | Port | Method | Description |
---|---|---|---|---|
Accounts | /api/v1/accounts/{id} | 7500 | GET | Return detail of specified account |
Accounts | /api/v1/accounts | 7500 | GET | Return details of all acounts |
Products | /api/v1/products/{id} | 7501 | GET | Return detail of specified product |
Products | /api/v1/products | 7501 | GET | Return details of all products |
Orders | /api/v1/orders/{id} | 7502 | GET | Return detail of order |
Orders | /api/v1/orders | 7502 | GET | Return details of orders |
Backoffice | /api/v1/backoffice/orders | 7503 | GET | Return orders with product name and account name |
Service | EndPoint |
---|---|
Accounts | /account/api/v1/accounts/{id} |
Accounts | /account/api/v1/accounts |
Products | /product/api/v1/products/{id} |
Products | /product/api/v1/products |
Orders | /order/api/v1/orders/{id} |
Orders | /order/api/v1/orders |
Backoffice | /backoffice/api/v1/backoffice/orders |
URI for gateway : http://localhost:8762
You can open Zipkin : http://localhost:9411
Open kibana with http://localhost:5601/. You must define an index pattern (taner-*) on Management/Stack Management.
You can open Grafana : http://localhost:3000/
Predefined dashboard : http://localhost:3000/d/dLsDQIUnzb/spring-boot-observability?orgId=1&refresh=5s
Grafana has loki for log aggregation and tempo for distributed tracing backend.
In docker-compose.yml file:
curl localhost:7500/account/api/v1/accounts
kubectl create -f containerized-products/k8n/deployment.yml
kubectl create -f containerized-orders/k8n/deployment.yml
curl localhost:7502/order/api/v1/orders
kubectl create -f containerized-main/k8n/deployment.yml
curl localhost:7503/backoffice/api/v1/backoffice/orders
kubectl create -f containerized-discovery/k8n/deployment.yml
kubectl port-forward svc/discovery 8761:8761
kubectl create -f containerized-gateway/k8n/deployment.yml
feign-micrometer dependency and Capability bean added to send trace-id on resttemplate calls
@Bean
public Capability capability(final MeterRegistry registry) {
return new MicrometerCapability(registry);
}
<dependency>
<groupId>io.github.openfeign</groupId>
<artifactId>feign-micrometer</artifactId>
</dependency>
micrometer-tracing-bridge-brave added to generate trace-id and span-id
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-tracing-bridge-brave</artifactId>
</dependency>