first commit
This commit is contained in:
96
QUICKSTART.md
Normal file
96
QUICKSTART.md
Normal file
@@ -0,0 +1,96 @@
|
||||
# 🎯 Quick Start
|
||||
|
||||
## 1️⃣ Clone ou acesse o projeto
|
||||
```bash
|
||||
cd /home/luis/monitoramento_atendimento
|
||||
```
|
||||
|
||||
## 2️⃣ Configure sua credencial
|
||||
```bash
|
||||
# Editar .env com suas credenciais
|
||||
nano .env
|
||||
```
|
||||
|
||||
Alterar:
|
||||
```env
|
||||
API_USERNAME=seu_email@exemplo.com
|
||||
API_PASSWORD=sua_senha
|
||||
```
|
||||
|
||||
## 3️⃣ Inicie os containers
|
||||
```bash
|
||||
docker-compose up -d
|
||||
```
|
||||
|
||||
Isso iniciará automaticamente:
|
||||
- 🐍 API Python Flask (porta 5000)
|
||||
- 📊 Grafana (porta 3000)
|
||||
- 🔥 Prometheus (porta 9090)
|
||||
|
||||
## 4️⃣ Acesse os serviços
|
||||
|
||||
| Serviço | URL | Login |
|
||||
|---------|-----|-------|
|
||||
| Grafana | http://localhost:3000 | admin / admin |
|
||||
| API | http://localhost:5000 | - |
|
||||
| Prometheus | http://localhost:9090 | - |
|
||||
|
||||
## 5️⃣ Teste a API
|
||||
```bash
|
||||
./test-api.sh
|
||||
```
|
||||
|
||||
Ou manualmente:
|
||||
```bash
|
||||
curl http://localhost:5000/api/summary
|
||||
```
|
||||
|
||||
## 6️⃣ Configure Datasources no Grafana
|
||||
|
||||
### Para visualizar dados em GRÁFICOS:
|
||||
1. Configuration → Data Sources → Add data source
|
||||
2. Selecione **Prometheus**
|
||||
3. URL: `http://prometheus:9090`
|
||||
4. Save & Test
|
||||
|
||||
### Para visualizar dados em TABELAS:
|
||||
1. Configuration → Data Sources → Add data source
|
||||
2. Selecione **JSON API**
|
||||
3. URL: `http://monitoring-api:5000`
|
||||
4. Save & Test
|
||||
|
||||
## 7️⃣ Crie seu Dashboard
|
||||
|
||||
### Opção A: Usar Dashboard Pré-pronto
|
||||
- Vá para Dashboards → Browse
|
||||
- Procure por "Monitoramento de Atendimento"
|
||||
|
||||
### Opção B: Criar Novo Dashboard Manual
|
||||
|
||||
**Painel de Tabela:**
|
||||
- New Panel → Table
|
||||
- Data Source: JSON API
|
||||
- Query: Select field → tickets
|
||||
- Transform → Organize fields → Selecione: contact_name, duration_formatted
|
||||
|
||||
**Painel de Gráfico:**
|
||||
- New Panel → Time series
|
||||
- Data Source: Prometheus
|
||||
- Metrics: `ticket_duration_seconds`
|
||||
|
||||
## ❓ Problemas?
|
||||
|
||||
```bash
|
||||
# Ver logs
|
||||
docker-compose logs -f monitoring-api
|
||||
|
||||
# Reiniciar
|
||||
docker-compose restart
|
||||
|
||||
# Recriar tudo do zero
|
||||
docker-compose down -v
|
||||
docker-compose up -d
|
||||
```
|
||||
|
||||
## 📖 Mais informações
|
||||
Veja [README.md](README.md) para documentação completa.
|
||||
Reference in New Issue
Block a user