OPHION é uma plataforma de observabilidade open source que combina métricas, logs e traces em uma única solução, potencializada por inteligência artificial para monitoramento proativo e auto-healing.
| Camada | Tecnologia | Função |
|---|---|---|
| API Server | Go 1.22 | Backend principal |
| Dashboard | Next.js + TypeScript | Interface web |
| Collector | OpenTelemetry Collector | Ingestão de telemetria |
| Database | PostgreSQL | Dados estruturados |
| Time Series | ClickHouse | Métricas de alta performance |
| Cache | Redis | Cache e filas |
| Container | Docker Compose | Orquestração |
┌─────────────────────────────────────────────────────────────────┐
│ APLICAÇÕES INSTRUMENTADAS │
│ ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐ │
│ │ Node.js │ │ Python │ │ Java │ │ .NET │ │ Go │ │
│ └────┬────┘ └────┬────┘ └────┬────┘ └────┬────┘ └────┬────┘ │
│ └───────────┴───────────┼───────────┴───────────┘ │
│ │ OTLP (4317/4318) │
└───────────────────────────────┼─────────────────────────────────┘
│
┌───────────────────────────────┼─────────────────────────────────┐
│ OPHION STACK ▼ │
│ ┌─────────────────────────────────────────────────┐ │
│ │ OpenTelemetry Collector │ │
│ │ (receivers → processors → exporters) │ │
│ └─────────────────────────┬───────────────────────┘ │
│ │ │
│ ┌────────────────┐ ▼ ┌────────────────┐ │
│ │ Dashboard │◄───► Server ◄──►│ PostgreSQL │ │
│ │ (Next.js) │ (Go API) │ ClickHouse │ │
│ │ :3000 │ :8080 │ Redis │ │
│ └────────────────┘ └────────────────┘ │
│ │
│ ┌────────────────────────────────────────────────┐ │
│ │ AI Engine (Copilot) │ │
│ │ - Correlação de alertas │ │
│ │ - Previsão de capacidade │ │
│ │ - Auto-healing │ │
│ └────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────────┘
ophion/
├── cmd/
│ ├── server/ # API Server (Go)
│ └── agent/ # Agent de coleta
├── internal/ # Código interno Go
│ ├── api/ # Handlers HTTP
│ ├── db/ # Repositórios
│ ├── ai/ # Engine de IA
│ └── telemetry/ # Processamento OTLP
├── dashboard/ # Frontend Next.js
│ ├── src/
│ │ ├── app/ # App Router
│ │ ├── components/ # UI Components
│ │ └── lib/ # Utilitários
│ └── package.json
├── deploy/
│ ├── docker/ # Docker configs
│ │ └── otel-collector-config.yaml
│ ├── remote-agent/ # Agent remoto
│ └── instrumentation/ # Scripts de instrumentação
├── examples/ # Exemplos por linguagem
│ ├── otel-nodejs/
│ ├── otel-python/
│ └── docker/
├── configs/ # Configurações
├── docs/ # Documentação
├── instrument.sh # Script de auto-instrumentação
├── install.sh # Instalador
├── docker-compose.yml
├── go.mod / go.sum
└── server # Binário compilado
Portas:
- 4317 - OTLP gRPC
- 4318 - OTLP HTTP
Pipeline:
receivers:
otlp:
protocols:
grpc:
endpoint: 0.0.0.0:4317
http:
endpoint: 0.0.0.0:4318
processors:
batch:
timeout: 1s
memory_limiter:
limit_mib: 512
exporters:
ophion:
endpoint: http://server:8080
Endpoints principais:
| Endpoint | Método | Descrição |
|---|---|---|
/api/v1/traces |
POST | Ingestão de traces |
/api/v1/metrics |
POST | Ingestão de métricas |
/api/v1/logs |
POST | Ingestão de logs |
/api/v1/services |
GET | Lista serviços |
/api/v1/alerts |
GET/POST | Gerenciamento de alertas |
/api/v1/ai/analyze |
POST | Análise por IA |
Recursos: - Service Map visual - Trace waterfall - Métricas em tempo real - Logs agregados - Alertas e notificações - AI Copilot chat
# Auto-detecta linguagem
./instrument.sh <container-name>
# Especifica linguagem
./instrument.sh my-app nodejs
./instrument.sh my-app python
./instrument.sh my-app java
./instrument.sh my-app dotnet
| Linguagem | Método | Complexidade |
|---|---|---|
| .NET | Auto-instrumentation | Zero code |
| Node.js | Auto-instrumentation | Zero code |
| Python | Auto-instrumentation | Zero code |
| Java | Java Agent | Zero code |
| Go | SDK (compile-time) | Pequenas mudanças |
| PHP | SDK | Pequenas mudanças |
OTEL_EXPORTER_OTLP_ENDPOINT=http://ophion:4318
OTEL_SERVICE_NAME=my-service
OTEL_RESOURCE_ATTRIBUTES=deployment.environment=production
OPENAI_API_KEY=sk-...
AI_MODEL=gpt-4
git clone https://github.com/bigtux/ophion.git
cd ophion
docker compose up -d
| Serviço | URL | Porta |
|---|---|---|
| Dashboard | http://localhost:3000 | 3000 |
| API | http://localhost:8080 | 8080 |
| OTLP gRPC | localhost:4317 | 4317 |
| OTLP HTTP | localhost:4318 | 4318 |
# Com install.sh
./install.sh --production
# Ou manualmente
docker compose -f docker-compose.prod.yml up -d
| Recurso | Mínimo | Recomendado |
|---|---|---|
| CPU | 2 cores | 4+ cores |
| RAM | 4 GB | 8+ GB |
| Disco | 20 GB SSD | 100+ GB SSD |
| Docker | 20.10+ | Latest |
| Docker Compose | v2+ | Latest |
# Server
PORT=8080
DATABASE_URL=postgres://user:pass@localhost:5432/ophion
REDIS_URL=redis://localhost:6379
CLICKHOUSE_URL=clickhouse://localhost:9000
# Auth
JWT_SECRET=your-secret
AGENT_KEY=agent-secret-key
# AI
OPENAI_API_KEY=sk-...
AI_ENABLED=true
# Notifications
TELEGRAM_BOT_TOKEN=...
TELEGRAM_CHAT_ID=...
# otel-collector-config.yaml
receivers:
otlp:
protocols:
grpc:
endpoint: 0.0.0.0:4317
http:
endpoint: 0.0.0.0:4318
processors:
batch:
timeout: 1s
send_batch_size: 1024
exporters:
otlphttp:
endpoint: http://server:8080/api/v1
service:
pipelines:
traces:
receivers: [otlp]
processors: [batch]
exporters: [otlphttp]
AGENT_KEY)# Backend (Go)
go run ./cmd/server
# Frontend (Next.js)
cd dashboard
npm install
npm run dev
# Testes
go test ./...
| Problema | Solução |
|---|---|
| Traces não aparecem | Verificar OTEL_EXPORTER_OTLP_ENDPOINT |
| Dashboard lento | Aumentar RAM do ClickHouse |
| Collector crash | Verificar memory_limiter no config |
| Auth falhando | Verificar JWT_SECRET |
AGPL-3.0 (Community Edition)
Documento gerado automaticamente - OPHION