- A CorrelationID is a Unique identifier assigned to a request that allows tracking it through various components.
- We can print CorrelationID along with Our logs.
- It is easier to debug across micro services using correlation ID.
- Helps to the request in a distributed system.
- Each client will have a unique CorrelationID Corresponding to its request.
- Since 3.2.1 spring boot adds this ID using simple configuration as follows
- Add the dependency of “micrometer – tracing – bridge – brave” or “ Spring boot actuator”
- Add property management.tracing.enabled=true.
- Example
- Old way using once per request Filter
- Recent way using using configuration
- Correlated logs in Spring Apps With reactive parts
- We use MDC I.e. Mapped Diagnostics Context.
- MDC is map Backed by thread, local storage.
- We add correlation ID in MDC and response header So that we can correlate logs corresponding to request/Response
- We can use a correlation Filter() as a bean in oncePerRequestFilter()
- Add a logging pattern with correlation key in properties.
- Context. Write() and context.store helps To store data in context reactor.
- To access data back we use tap() or handle().
- Example : https://github.com/gauravmatta/springmvc/tree/master/springredis
- Annotations
- Controllers
- Components
- Dependencies
- Documenting Java Code
- Entities
- Hibernate
- HTTPS Security
- Spring Core
- Maven
- Spring MVC
- Microservices
- Packages
- Project Configuration
- REST Templates
- Spring Boot
- AOP
- Spring DI
- Spring IOC
- Spring Data
- Tag Library
- View Resolvers
- Validations,Errors & Exceptions
- Activiti Framework
- Deploy spring boot Microservices in Fargate
- Spring Security
- Password encryption using Jasypt
- Flyway DB Migration Script
- Session in Spring Boot
- Spring Expression Language
- Spring JDBC
- Spring ORM
- Testing Spring Boot
- Correlation ID
- Logging
- ELK Stack
- EFK Stack
- Swagger
- Rabbit MQ
- Circuit Breaker Pattern
- Connection Pooling
- Spring Batch
- Zipkins
- Kafka
- Spring Boot Actuator
- Spring Cloud
- Caching
- Gateway
- Service Discovery
Correlation ID
Subscribe to:
Posts (Atom)
Spring Boot
What is circular/cyclic dependency in spring boot? When two services are interdependent on each other, that is to start one service, we requ...
-
What is JPA? JPA Is also called as Java persistence API It is a standard form oracle to map object to database relations. Provides specific...
-
Technology's / frameworks in Spring Spring core Spring MVC Spring boot Spring data Hibernate
-
Q What is the minimal web version required to use JSTL? And : 2.4 For example following tag from web.xml uses web 4.0 <web-app xmlns:xs...
No comments:
Post a Comment