운영·관측¶
서비스 트래픽은 8080, Actuator는 9090으로 분리됩니다.
8080:/sohri,/healthz, EPD 보조 REST9090:/actuator/health,/actuator/prometheus, 기타 관리 엔드포인트
9090에는 애플리케이션 인증이 없으므로 Service·Ingress·NEG로 공개하면 안 됩니다. /healthz는
외부 LB용 고정 ok 응답이며 의존성 상태를 노출하지 않습니다. Kubernetes liveness는 프로세스
상태만, readiness는 DB를 포함합니다.
핵심 메트릭¶
Micrometer 이름은 Prometheus에서 점이 밑줄로 바뀌고 counter에는 _total이 붙습니다.
| 관심사 | Micrometer 이름 | 주요 태그·의미 |
|---|---|---|
| 활성 연결 | websocket.connections.active |
전역 gauge, 태그 추가 금지 |
| 연결 거절 | websocket.connections.rejected |
reason=capacity |
| workspace 연결 | sohri.websocket.connections.by.workspace |
workspace별 gauge |
| 트래픽 | sohri.websocket.bytes, sohri.websocket.frames |
direction, kind |
| 턴 체감 지연 | sohri.turn.response.latency |
수락 END → 첫 TTS write, outcome |
| 단계 지연 | sohri.pipeline.stage.duration |
stage=stt|dm, outcome |
| TTS 합성 | sohri.tts.synthesis.duration |
provider, outcome |
| TTS 첫 청크 | sohri.tts.first.chunk.duration |
provider, outcome |
| TTS 스트림 종료 | sohri.tts.stream.end |
status, reason |
| EPD 연결 | sohri.epd.connection.attempts, sohri.epd.connect.duration |
success/failed, success/timeout/error |
| EPD 상태 | sohri.epd.connections.inprogress, sohri.epd.sessions.active |
연결 중·활성 세션 gauge |
| 취소 END | sohri.epd.cancelled.end |
text, outcome |
| END 누락 관측 | sohri.epd.o10 |
new_candidate, new_started, session_end, closed_without_end |
| DM 회수 | sohri.dm.session.reclaim |
deleted, already_gone, timed_out, failed |
| OpenAI 종료 | sohri.openai.realtime.terminations |
종료 원인·ready 여부 |
| OpenAI 오류 | sohri.openai.realtime.setup.failures, sohri.openai.realtime.upstream.send.failures |
설정/상류 송신 실패 |
| OpenAI 오디오 폐기 | sohri.openai.realtime.audio.dropped |
upstream 송신 큐 초과 |
| 아카이빙 | sohri.audio.archival.link, .publish, .bot, .user.direct |
단계별 outcome |
websocket.connections.active, http_server_requests_seconds_*,
hikaricp_connections_active, jvm_gc_pause_seconds_max는 외부 알림 계약이 직접 참조합니다.
특히 활성 연결 gauge에 workspace 태그를 추가하면 기존 시계열이 분할되므로 workspace 분해는
별도 메트릭만 사용해야 합니다.
지연 해석¶
- 턴 응답 지연 시작: EPD END가 텍스트·발화 세대·USER lease 검사를 통과한 시점
- 턴 응답 지연 종료: DM 응답 경로의 첫 TTS binary
sendMessage직후 stage=stt: EPD 내부 추론 시간이 아니라 END 결과 확정·저장·클라이언트 통지 구간stage=dm: DM API 왕복과 BOT/응답 영속화- TTS
durationMs: 재생 길이,synthesisMs: 합성 벽시계
바지인 취소 턴은 success 지연 분포에 섞지 않습니다. 세션 정리 시 진행 중 지연 표본은 cancelled로 기록하는 대신 먼저 폐기합니다.
장애 진단 순서¶
PCM은 오는데 STT가 없음¶
sohri_epd_connection_attempts_total과 connect duration의 timeout/error를 확인합니다.sohri_epd_connections_inprogress가 계속 증가하는지 봅니다.- 입력 gate가 pause 상태인지, END 처리 또는 TIMEOUT pause holder가 남았는지 로그로 확인합니다.
sohri_epd_o10_total로 confirmed 뒤 END가 오지 않은 경로를 분리합니다.
STT는 있으나 답변이 없음¶
stage=dm실패와 DM 회수 실패를 구분합니다.- response generation이 바지인으로 바뀌어 출력만 억제됐는지 확인합니다.
tts_error, TTS synthesis outcome, stream end reason을 확인합니다.- USER/BOT 행은 존재할 수 있습니다. 출력 부재를 저장 롤백으로 해석하지 않습니다.
스트림 재생 큐가 닫히지 않음¶
tts_stream_start를 받은 generation에 대응하는 tts_stream_end를 확인합니다. 취소된 스트림도
status=aborted end가 와야 합니다. 단, start 전 실패·취소는 end가 없는 것이 정상입니다.
최종 요약이 늦거나 없음¶
- pending record tail의 5초 대기 timeout 로그를 확인합니다.
- 분석과 일반 요약은 병렬이므로 각각의 timeout·실패를 분리합니다.
- 바이오마커 요약은 두 작업 join 뒤 시작합니다.
- 마음온 회신 실패는 최종화 실패가 아니며 별도 비동기 로그로 확인합니다.
로그와 개인정보¶
운영 로그에 API key, 마음온 API key, 대화 요약 본문, 키워드 값, 장기 메모리를 남기면 안 됩니다. 세션·dialog·message·activity·generation 같은 상관키와 길이·outcome을 사용합니다. OpenAI provider 오류도 provider code와 타입만 기록하고 사용자 텍스트를 오류 메시지로 노출하지 않는 것이 원칙입니다.
배포 값과 기능 플래그는 설정 참조를 참고하세요.