# 관측 가능성

> Langfuse로 모든 LLM 호출을 추적하고 Grafana와 OpenTelemetry로 전체 시스템을 모니터링하세요. 내장 대시보드 외에 선택적으로 사용할 수 있는 두 가지 스택입니다.

두 가지 선택적 스택은 PentAGI의 동작을 보여줍니다: 모델 호출용 Langfuse와 시스템 나머지 부분용 OpenTelemetry가 포함된 Grafana입니다.

PentAGI 자체 **Dashboard**는 이미 [flows](https://pentagi.com/ko/docs/glossary/#flow), [tool calls](https://pentagi.com/ko/docs/glossary/#tool-call), 토큰 및 비용을 시간 경과에 따라 차트로 표시합니다. 아래 스택은 전체 트레이스와 시스템 메트릭을 추가합니다.

![기본 제공 대시보드](https://pentagi.com/images/product/dashboard.webp)

## [Langfuse](https://pentagi.com/ko/docs/configuration/observability/#langfuse)

Langfuse는 [agent](https://pentagi.com/ko/docs/glossary/#agent)별 프롬프트, 완료 결과, 토큰 및 비용을 기록합니다.

```bash
LANGFUSE_BASE_URL=http://langfuse-web:3000
LANGFUSE_PROJECT_ID=same_as_LANGFUSE_INIT_PROJECT_ID
LANGFUSE_PUBLIC_KEY=same_as_LANGFUSE_INIT_PROJECT_PUBLIC_KEY
LANGFUSE_SECRET_KEY=same_as_LANGFUSE_INIT_PROJECT_SECRET_KEY
```

`.env`(`LANGFUSE_POSTGRES_*`, `LANGFUSE_CLICKHOUSE_*`, `LANGFUSE_REDIS_AUTH`, `LANGFUSE_SALT`, `LANGFUSE_ENCRYPTION_KEY`, `LANGFUSE_NEXTAUTH_SECRET`, `LANGFUSE_INIT_USER_*` 및 프로젝트 키)에서 Langfuse 자격 증명을 설정한 다음 스택을 시작합니다:

```bash
curl -O https://raw.githubusercontent.com/vxcontrol/pentagi/main/docker-compose-langfuse.yml
docker compose -f docker-compose.yml -f docker-compose-langfuse.yml up -d
```

Langfuse UI는 `http://localhost:4000`에서 사용할 수 있습니다.

## [Grafana 및 OpenTelemetry](https://pentagi.com/ko/docs/configuration/observability/#grafana-and-opentelemetry)

```bash
OTEL_HOST=otelcol:8148
```

```bash
git clone --depth 1 https://github.com/vxcontrol/pentagi.git pentagi-src
cp -r pentagi-src/observability ./observability
rm -rf pentagi-src
curl -O https://raw.githubusercontent.com/vxcontrol/pentagi/main/docker-compose-observability.yml
docker compose -f docker-compose.yml -f docker-compose-observability.yml up -d
```

Grafana는 `http://localhost:3000`에서 사용할 수 있으며, VictoriaMetrics의 메트릭, Jaeger의 트레이스 및 Loki의 로그를 제공합니다.

> [!NOTE]
> Langfuse 텔레메트리를 동일한 스택으로 보내려면 `LANGFUSE_OTEL_EXPORTER_OTLP_ENDPOINT=http://otelcol:4318`을 설정하세요.

## [모두 함께 사용하기](https://pentagi.com/ko/docs/configuration/observability/#everything-together)

```bash
git clone --depth 1 https://github.com/vxcontrol/pentagi.git pentagi-src
cp -r pentagi-src/examples/graphiti ./graphiti
cp -r pentagi-src/examples/neo4j ./neo4j
rm -rf pentagi-src
curl -O https://raw.githubusercontent.com/vxcontrol/pentagi/main/docker-compose-graphiti.yml
docker compose \
  -f docker-compose.yml \
  -f docker-compose-langfuse.yml \
  -f docker-compose-graphiti.yml \
  -f docker-compose-observability.yml \
  up -d
```