Overview
PentAGI provides comprehensive observability through three integrated systems:
- Langfuse: LLM observability and analytics for AI agent operations
- Grafana Stack: System monitoring with metrics, traces, and logs
- OpenTelemetry: Unified telemetry collection and correlation
All observability components are optional and can be enabled independently.
Langfuse Integration
Langfuse provides advanced LLM observability including trace analysis, cost tracking, and performance metrics.
PentAGI Configuration
Configure PentAGI to send telemetry to Langfuse:
URL of the Langfuse serverLANGFUSE_BASE_URL=http://langfuse-web:3000
Langfuse project ID (defaults to LANGFUSE_INIT_PROJECT_ID)LANGFUSE_PROJECT_ID=cm47619l0000872mcd2dlbqwb
Langfuse project public key (defaults to LANGFUSE_INIT_PROJECT_PUBLIC_KEY)LANGFUSE_PUBLIC_KEY=pk-lf-5946031c-ae6c-4451-98d2-9882a59e1707
Langfuse project secret key (defaults to LANGFUSE_INIT_PROJECT_SECRET_KEY)LANGFUSE_SECRET_KEY=sk-lf-d9035680-89dd-4950-8688-7870720bf359
Langfuse Server Configuration
LANGFUSE_LISTEN_IP
string
default:"127.0.0.1"
IP address for Langfuse web UI to bind to on hostLANGFUSE_LISTEN_IP=127.0.0.1
Port for Langfuse web UI on host machineLANGFUSE_LISTEN_PORT=4000
LANGFUSE_NEXTAUTH_URL
string
default:"http://localhost:4000"
Public URL for Langfuse NextAuth callbacksLANGFUSE_NEXTAUTH_URL=http://localhost:4000
Database Configuration
PostgreSQL:
PostgreSQL username for Langfuse
LANGFUSE_POSTGRES_PASSWORD
PostgreSQL password for LangfuseChange this default value in production
PostgreSQL database name for Langfuse
ClickHouse (Analytics):
LANGFUSE_CLICKHOUSE_USER
string
default:"clickhouse"
ClickHouse username
LANGFUSE_CLICKHOUSE_PASSWORD
string
default:"clickhouse"
ClickHouse passwordChange this default value in production
LANGFUSE_CLICKHOUSE_URL
string
default:"http://langfuse-clickhouse:8123"
ClickHouse HTTP endpoint URL
LANGFUSE_CLICKHOUSE_MIGRATION_URL
string
default:"clickhouse://langfuse-clickhouse:9000"
ClickHouse native protocol URL for migrations
LANGFUSE_CLICKHOUSE_CLUSTER_ENABLED
Enable ClickHouse cluster mode
Storage Configuration (S3/MinIO)
S3 bucket name for Langfuse data
S3 region (use auto for MinIO)
LANGFUSE_S3_ACCESS_KEY_ID
string
default:"accesskey"
S3/MinIO access key IDChange this default value in production
LANGFUSE_S3_SECRET_ACCESS_KEY
string
default:"secretkey"
S3/MinIO secret access keyChange this default value in production
LANGFUSE_S3_ENDPOINT
string
default:"http://langfuse-minio:9000"
S3-compatible endpoint URL
LANGFUSE_S3_FORCE_PATH_STYLE
Force path-style S3 URLs (required for MinIO)
LANGFUSE_S3_EVENT_UPLOAD_PREFIX
S3 prefix for event data
LANGFUSE_S3_MEDIA_UPLOAD_PREFIX
S3 prefix for media uploads
LANGFUSE_S3_BATCH_EXPORT_ENABLED
Enable batch export to S3
Redis Configuration
LANGFUSE_REDIS_HOST
string
default:"langfuse-redis"
Redis hostname
LANGFUSE_REDIS_AUTH
string
default:"redispassword"
Redis authentication passwordChange this default value in production
LANGFUSE_REDIS_TLS_ENABLED
Enable TLS for Redis connections
Path to Redis TLS CA certificate
Path to Redis TLS client certificate
Path to Redis TLS client key
Security Settings
Salt for hashing in Langfuse web UIChange this to a random value in production
64-character hex encryption key (32 bytes)Generate with: openssl rand -hex 32Change this in production
NextAuth secret key for session signingChange this to a random value in production
Admin User Configuration
LANGFUSE_INIT_USER_PASSWORD
Admin user passwordChange this to a strong password in production
Project Configuration
LANGFUSE_INIT_ORG_ID
string
default:"ocm47619l0000872mcd2dlbqwb"
Initial organization ID
LANGFUSE_INIT_ORG_NAME
string
default:"PentAGI Org"
Initial organization name
LANGFUSE_INIT_PROJECT_ID
string
default:"cm47619l0000872mcd2dlbqwb"
Initial project ID
LANGFUSE_INIT_PROJECT_NAME
Initial project name
LANGFUSE_INIT_PROJECT_PUBLIC_KEY
string
default:"pk-lf-00000000-0000-0000-0000-000000000000"
Initial project public keyChange this to a random UUID in production
LANGFUSE_INIT_PROJECT_SECRET_KEY
string
default:"sk-lf-00000000-0000-0000-0000-000000000000"
Initial project secret keyChange this to a random UUID in production
Optional Settings
LANGFUSE_ENABLE_EXPERIMENTAL_FEATURES
Enable experimental Langfuse features
LANGFUSE_TELEMETRY_ENABLED
Enable Langfuse’s own telemetry reporting
Log level for Langfuse services (debug, info, warn, error)
Langfuse Enterprise Edition license key
Deployment
# Start PentAGI with Langfuse
docker compose -f docker-compose.yml -f docker-compose-langfuse.yml up -d
# Access Langfuse UI
open http://localhost:4000
Example Configuration
# Langfuse Integration
LANGFUSE_BASE_URL=http://langfuse-web:3000
LANGFUSE_PROJECT_ID=cm47619l0000872mcd2dlbqwb
LANGFUSE_PUBLIC_KEY=pk-lf-5946031c-ae6c-4451-98d2-9882a59e1707
LANGFUSE_SECRET_KEY=sk-lf-d9035680-89dd-4950-8688-7870720bf359
# Langfuse Server
LANGFUSE_LISTEN_IP=127.0.0.1
LANGFUSE_LISTEN_PORT=4000
# Security (CHANGE IN PRODUCTION)
LANGFUSE_POSTGRES_PASSWORD=strong_pg_password
LANGFUSE_CLICKHOUSE_PASSWORD=strong_ch_password
LANGFUSE_S3_ACCESS_KEY_ID=strong_access_key
LANGFUSE_S3_SECRET_ACCESS_KEY=strong_secret_key
LANGFUSE_REDIS_AUTH=strong_redis_password
LANGFUSE_SALT=random_salt_value
LANGFUSE_ENCRYPTION_KEY=$(openssl rand -hex 32)
LANGFUSE_NEXTAUTH_SECRET=random_nextauth_secret
# Admin User
LANGFUSE_INIT_USER_EMAIL=[email protected]
LANGFUSE_INIT_USER_PASSWORD=strong_admin_password
OpenTelemetry Integration
OpenTelemetry provides unified observability with metrics, traces, and logs.
PentAGI Configuration
OpenTelemetry collector endpoint (gRPC)
OpenTelemetry Collector Configuration
OTEL_GRPC_LISTEN_IP
string
default:"127.0.0.1"
IP address for OTLP gRPC endpoint on host
Port for OTLP gRPC endpoint on host
OTEL_HTTP_LISTEN_IP
string
default:"127.0.0.1"
IP address for OTLP HTTP endpoint on host
Port for OTLP HTTP endpoint on host
Langfuse OpenTelemetry Integration
LANGFUSE_OTEL_EXPORTER_OTLP_ENDPOINT
OpenTelemetry endpoint for Langfuse to send telemetryLANGFUSE_OTEL_EXPORTER_OTLP_ENDPOINT=http://otelcol:4318
LANGFUSE_OTEL_SERVICE_NAME
Service name for Langfuse traces
Example Configuration
# PentAGI to OpenTelemetry
OTEL_HOST=otelcol:8148
# OpenTelemetry Collector ports
OTEL_GRPC_LISTEN_IP=127.0.0.1
OTEL_GRPC_LISTEN_PORT=8148
OTEL_HTTP_LISTEN_IP=127.0.0.1
OTEL_HTTP_LISTEN_PORT=4318
# Langfuse to OpenTelemetry (optional)
LANGFUSE_OTEL_EXPORTER_OTLP_ENDPOINT=http://otelcol:4318
LANGFUSE_OTEL_SERVICE_NAME=langfuse
Grafana Stack
The Grafana observability stack includes metrics, traces, and logs.
Grafana Configuration
GRAFANA_LISTEN_IP
string
default:"127.0.0.1"
IP address for Grafana web UI to bind to on host
Port for Grafana web UI on host machine
Services Included
The observability stack includes:
- Grafana: Visualization dashboards
- VictoriaMetrics: Time-series metrics storage
- Jaeger: Distributed tracing
- Loki: Log aggregation
- ClickHouse: Trace storage backend
- Node Exporter: Host metrics
- cAdvisor: Container metrics
- OpenTelemetry Collector: Telemetry aggregation
Deployment
# Start observability stack
docker compose -f docker-compose.yml -f docker-compose-observability.yml up -d
# Access Grafana UI
open http://localhost:3000
Example Configuration
# Grafana
GRAFANA_LISTEN_IP=127.0.0.1
GRAFANA_LISTEN_PORT=3000
# OpenTelemetry Integration
OTEL_HOST=otelcol:8148
OTEL_GRPC_LISTEN_IP=127.0.0.1
OTEL_GRPC_LISTEN_PORT=8148
OTEL_HTTP_LISTEN_IP=127.0.0.1
OTEL_HTTP_LISTEN_PORT=4318
Complete Observability Setup
Deploy all observability components together:
# Start PentAGI with full observability
docker compose \
-f docker-compose.yml \
-f docker-compose-langfuse.yml \
-f docker-compose-observability.yml \
up -d
Access the dashboards:
Complete Example Configuration
# OpenTelemetry (enables all telemetry collection)
OTEL_HOST=otelcol:8148
# Langfuse Integration
LANGFUSE_BASE_URL=http://langfuse-web:3000
LANGFUSE_PUBLIC_KEY=pk-lf-5946031c-ae6c-4451-98d2-9882a59e1707
LANGFUSE_SECRET_KEY=sk-lf-d9035680-89dd-4950-8688-7870720bf359
# Langfuse to OpenTelemetry
LANGFUSE_OTEL_EXPORTER_OTLP_ENDPOINT=http://otelcol:4318
# Service Ports
LANGFUSE_LISTEN_PORT=4000
GRAFANA_LISTEN_PORT=3000
# Security - Database Passwords
LANGFUSE_POSTGRES_PASSWORD=strong_password_1
LANGFUSE_CLICKHOUSE_PASSWORD=strong_password_2
LANGFUSE_REDIS_AUTH=strong_password_3
# Security - S3/MinIO
LANGFUSE_S3_ACCESS_KEY_ID=strong_access_key
LANGFUSE_S3_SECRET_ACCESS_KEY=strong_secret_key
# Security - Langfuse
LANGFUSE_SALT=$(openssl rand -hex 16)
LANGFUSE_ENCRYPTION_KEY=$(openssl rand -hex 32)
LANGFUSE_NEXTAUTH_SECRET=$(openssl rand -hex 32)
# Admin User
LANGFUSE_INIT_USER_EMAIL=[email protected]
LANGFUSE_INIT_USER_PASSWORD=strong_admin_password
Monitoring Best Practices
Use Langfuse
Monitor LLM costs, latency, and token usage per agent type
Use Grafana
Track system resources, container health, and performance metrics
Enable Tracing
Use distributed tracing to debug complex agent workflows
Set Up Alerts
Configure Grafana alerts for critical metrics and errors
Next Steps
Security Configuration
Configure SSL, authentication, and secrets
LLM Providers
Set up OpenAI, Anthropic, and more