Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Datadog Trace 어노테이션 추가 #475

Merged
merged 2 commits into from
Oct 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions backend/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
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