sentry-setup-ai-monitoring은(는) 무엇을 하나요?
모든 프로젝트에서 Sentry AI 에이전트 모니터링을 설정합니다. LLM 호출 모니터링, AI 에이전트 추적, 대화 추적, 또는 OpenAI/Anthropic/Vercel AI/LangChain/Google GenAI/Pydantic AI 계측 요청 시 사용합니다. 설치된 AI SDK를 감지하고 적절한 통합을 구성합니다.
사용 방법
- 프로젝트에서 다음 명령어를 실행하여 Sentry를 설치합니다:
pip install sentry-sdk
- 애플리케이션 코드에 Sentry를 초기화하고 아래와 같이 통합을 추가합니다:
import sentry_sdk
from sentry_sdk.integrations.openai import OpenAIIntegration
from sentry_sdk.integrations.anthropic import AnthropicIntegration
from sentry_sdk.integrations.langchain import LangChainIntegration
sentry_sdk.init(
dsn="YOUR_DSN_HERE",
integrations=[
OpenAIIntegration(),
AnthropicIntegration(),
LangChainIntegration(),
],
traces_sample_rate=1.0,
)
- 환경 변수를 설정합니다:
export SENTRY_DSN="your_dsn_here"
- 자세한 내용은 Sentry 문서를 참조하세요.