Skip to content

[HSC-418] Pinpoint 설정 및 의존성 추가#62

Merged
tkv00 merged 2 commits into
mainfrom
config/HSC-418
Mar 28, 2026
Merged

[HSC-418] Pinpoint 설정 및 의존성 추가#62
tkv00 merged 2 commits into
mainfrom
config/HSC-418

Conversation

@tkv00

@tkv00 tkv00 commented Mar 28, 2026

Copy link
Copy Markdown
Contributor

📝작업 내용


👀변경 사항


🎫 Jira Ticket

  • Jira Ticket: HSC-418

#️⃣관련 이슈

@tkv00 tkv00 added 🏷️ release 릴리즈 준비/버전 태깅/릴리즈 노트/릴리즈 브랜치 작업 🗂️ area: BE 백엔드 영역 ☁️ area: INFRA 인프라/운영/배포 영역 🔥 priority: P0 즉시 처리 필요(서비스/데모 블로커) release:patch 버전 patch bump: X.Y.(Z+1) Infra Team deploy:intelligence-server labels Mar 28, 2026
@tkv00 tkv00 merged commit baa939a into main Mar 28, 2026
1 check failed
@tkv00 tkv00 changed the title Pinpoint 설정 및 의존성 추가 [HSC-418] Pinpoint 설정 및 의존성 추가 Mar 28, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request integrates Pinpoint monitoring into the application by adding necessary configuration settings, a dedicated infrastructure module for agent initialization, and FastAPI middleware. It also introduces an app_mode setting to conditionally enable CDC analysis. The review feedback suggests improving the robustness of the new Pinpoint infrastructure by adding unit tests for edge cases, such as missing dependencies or empty configurations, and recommends sorting the requirements.txt file alphabetically for better maintainability.

Comment thread app/infra/pinpoint.py
_PINPOINT_INITIALIZED = False


def build_fastapi_pinpoint_middleware(settings: Settings) -> list[Any]:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

이 모듈은 Pinpoint 초기화와 관련된 중요한 로직을 포함하고 있습니다. 특히, 설정 플래그에 따른 조건부 초기화, 지연 로딩, 스레드 안전성(_initialize_pinpoint) 등이 구현되어 있습니다. 이 로직의 정확성과 견고성을 보장하기 위해 단위 테스트를 추가하는 것을 강력히 권장합니다. 예를 들어, 다음과 같은 시나리오들을 테스트할 수 있습니다:

  • pinpoint_enabledFalse일 때 build_fastapi_pinpoint_middleware가 빈 리스트를 반환하는지 확인
  • pinpoint_enabledTrue이지만 pinpoint_collector_agent_uri가 비어있을 때 빈 리스트를 반환하고 경고 로그가 남는지 확인
  • pinpointPy 의존성이 설치되지 않았을 때 (ImportError), 예외가 로깅되고 빈 리스트를 반환하는지 확인 (mock 사용)
  • 성공적으로 초기화될 때, _initialize_pinpoint가 올바른 인자들로 호출되는지 확인 (mock 사용)
  • _initialize_pinpoint가 여러 번 호출되어도 실제 초기화는 한 번만 수행되는지 확인

Comment thread requirements.txt
Comment on lines +3 to +4
pinpointPy==1.3.1
starlette-context==0.4.0

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

새로운 의존성이 추가되었습니다. 프로젝트의 유지보수성을 높이기 위해 requirements.txt 파일의 모든 의존성을 알파벳 순으로 정렬하는 것을 권장합니다. 이렇게 하면 의존성을 찾기 쉽고, 중복을 방지하며, 병합 충돌을 줄일 수 있습니다. sort-requirements와 같은 도구를 사용하거나 수동으로 정렬할 수 있습니다.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🗂️ area: BE 백엔드 영역 ☁️ area: INFRA 인프라/운영/배포 영역 deploy:intelligence-server Infra Team 🔥 priority: P0 즉시 처리 필요(서비스/데모 블로커) release:patch 버전 patch bump: X.Y.(Z+1) 🏷️ release 릴리즈 준비/버전 태깅/릴리즈 노트/릴리즈 브랜치 작업

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant