This repo sample spring-boot project to demonstrate redis cache with spring-boot & Datadog Java APM and used the Datadog Java APM TraceInterceptor to ignore the Redis Resource for "EXISTS".
- Java 8
- Apache Maven 3.5.0 or higher
- Clone the project
- Configure Redis password in application.yml
- Build the project
mvn clean install
- Run the application
java -jar target/redis-0.0.1-SNAPSHOT.jar
- Make sure your redis-server is up and running
- Use the postman collection located in /src/main/resources directory to test the application.
- Build the project
mvn clean install
- Run using docker-compose
docker-compose up --build
- Launch PostMan
- Create a POST request to:
with the raw body of:
http://localhost:8080/api/v1/otp/generate
{ "email":"user@gmail.com" }
-
Create a POST request to:
http://localhost:8080/api/v1/otp/verify
This will create traces to the Redis service.
- Datadog Extending Java Tracer
- The location of ther Datadog Java APM TraceInterceptor class is:
- RedisTraceInterceptor under:
src/main/java/com/rkdevblog/interceptors/RedisTraceInterceptor.java
- The TraceInterceptor is registered under:
src/main/redis/RedisApplication.java
- RedisTraceInterceptor under:
- The location of ther Datadog Java APM TraceInterceptor class is: