diff --git a/backend/build.gradle b/backend/build.gradle index 87c13723..4dba0f2c 100644 --- a/backend/build.gradle +++ b/backend/build.gradle @@ -52,6 +52,8 @@ dependencies { compileOnly 'org.projectlombok:lombok' annotationProcessor 'org.projectlombok:lombok' + implementation group: 'com.datadoghq', name: 'dd-trace-api', version: '1.21.0' + implementation 'com.querydsl:querydsl-jpa:5.0.0:jakarta' annotationProcessor "com.querydsl:querydsl-apt:${dependencyManagement.importedProperties['querydsl.version']}:jakarta" annotationProcessor "jakarta.annotation:jakarta.annotation-api" diff --git a/backend/src/main/java/zipgo/petfood/application/PetFoodQueryService.java b/backend/src/main/java/zipgo/petfood/application/PetFoodQueryService.java index 569fd29b..66d9735f 100644 --- a/backend/src/main/java/zipgo/petfood/application/PetFoodQueryService.java +++ b/backend/src/main/java/zipgo/petfood/application/PetFoodQueryService.java @@ -1,5 +1,6 @@ package zipgo.petfood.application; +import datadog.trace.api.Trace; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -37,6 +38,7 @@ public GetPetFoodsResponse getPetFoodsByFilters(FilterRequest filterDto, Long la ); } + @Trace(resourceName = "식품 페이징 조회") private List getPagingPetFoods(FilterRequest filterDto, Long lastPetFoodId, int size) { return petFoodQueryRepository.findPagingPetFoods( filterDto.brands(), @@ -48,6 +50,7 @@ private List getPagingPetFoods(FilterRequest filterDto, ); } + @Trace(resourceName = "식품 페이징 카운트 조회") private Long getPetFoodsCount(FilterRequest filterDto) { return petFoodQueryRepository.findPetFoodsCount( filterDto.brands(), diff --git a/backend/src/main/java/zipgo/petfood/infra/persist/PetFoodQueryRepositoryImpl.java b/backend/src/main/java/zipgo/petfood/infra/persist/PetFoodQueryRepositoryImpl.java index 2387b7b7..8ed1aed4 100644 --- a/backend/src/main/java/zipgo/petfood/infra/persist/PetFoodQueryRepositoryImpl.java +++ b/backend/src/main/java/zipgo/petfood/infra/persist/PetFoodQueryRepositoryImpl.java @@ -2,6 +2,7 @@ import com.querydsl.core.types.dsl.BooleanExpression; import com.querydsl.jpa.impl.JPAQueryFactory; +import datadog.trace.api.Trace; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Repository; import org.springframework.transaction.annotation.Transactional; @@ -26,6 +27,7 @@ public class PetFoodQueryRepositoryImpl implements PetFoodQueryRepository { private final JPAQueryFactory queryFactory; + @Trace(resourceName = "식품 페이징 조회 쿼리") public List findPagingPetFoods( List brandsName, List standards, @@ -103,6 +105,7 @@ private BooleanExpression isContainFunctionalities(List functionalityLis .functionality.name.in(functionalityList); } + @Trace(resourceName = "식품 페이징 조회 카운트 쿼리") @Override public Long findPetFoodsCount( List brandsName,