Skip to content

Commit

Permalink
feat: Trace 어노테이션 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
wonyongChoi05 committed Oct 12, 2023
1 parent 37877c0 commit ffdc6ca
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -37,6 +38,7 @@ public GetPetFoodsResponse getPetFoodsByFilters(FilterRequest filterDto, Long la
);
}

@Trace(resourceName = "식품 페이징 조회")
private List<GetPetFoodQueryResponse> getPagingPetFoods(FilterRequest filterDto, Long lastPetFoodId, int size) {
return petFoodQueryRepository.findPagingPetFoods(
filterDto.brands(),
Expand All @@ -48,6 +50,7 @@ private List<GetPetFoodQueryResponse> getPagingPetFoods(FilterRequest filterDto,
);
}

@Trace(resourceName = "식품 페이징 카운트 조회")
private Long getPetFoodsCount(FilterRequest filterDto) {
return petFoodQueryRepository.findPetFoodsCount(
filterDto.brands(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -26,6 +27,7 @@ public class PetFoodQueryRepositoryImpl implements PetFoodQueryRepository {

private final JPAQueryFactory queryFactory;

@Trace(resourceName = "식품 페이징 조회 쿼리")
public List<GetPetFoodQueryResponse> findPagingPetFoods(
List<String> brandsName,
List<String> standards,
Expand Down Expand Up @@ -103,6 +105,7 @@ private BooleanExpression isContainFunctionalities(List<String> functionalityLis
.functionality.name.in(functionalityList);
}

@Trace(resourceName = "식품 페이징 조회 카운트 쿼리")
@Override
public Long findPetFoodsCount(
List<String> brandsName,
Expand Down

0 comments on commit ffdc6ca

Please sign in to comment.