피드로 돌아가기
Your AI agent already emits OpenTelemetry. Why aren't you watching it?
Dev.toDev.to
AI/ML

Vendor SDK 없이 OpenTelemetry gen_ai.* 표준으로 구현한 LLM Agent 관측성

Your AI agent already emits OpenTelemetry. Why aren't you watching it?

Sunil Prakash2026년 5월 9일6intermediate

Context

기존 APM은 LLM 특유의 프롬프트, 토큰 사용량, Tool Call 등 세부 신호를 포착하지 못하는 한계 존재. 특정 벤더 SDK 도입 방식은 프레임워크 업데이트 시마다 의존성 충돌과 코드 수정이 필요한 Coordination Problem 유발.

Technical Solution

  • Framework Native OTel 기반의 gen_ai.* Semantic Convention 채택을 통한 표준 신호 방출
  • Spring AI(Micrometer Observations), LangChain4j(ChatModelListener) 등 프레임워크 수준의 내장 Instrumentation 활용
  • Application Code 수정 없이 OTLP Endpoint 설정만으로 데이터를 전송하는 Decoupled Architecture 설계
  • W3C traceparent 및 custom tracestate 세그먼트를 활용한 Multi-agent 간 분산 트레이싱 및 호출 그래프 구현
  • 서버 사이드에서 gen_ai.usage.*_tokens 신호를 기반으로 실시간 비용을 계산하는 Cost Rollup 로직 적용
  • Ed25519 서명 기반의 JSON/CSV 감사 패키지 생성을 통한 SOC2 준수 및 보안 감사 체계 구축

- 프레임워크가 지원하는 gen_ai.* Semantic Convention 적용 여부 확인 - 벤더 전용 SDK 대신 OTLP standard exporter를 통한 Backend-portable 구조 검토 - LLM Agent의 루프 발생 및 비용 폭증 감지를 위해 Token usage 및 Tool execution span 모니터링 설정 - Multi-agent 환경에서 End-user ID를 전파하기 위한 Trace Context 전파 전략 수립

원문 읽기