PerfAgent — Copiloto de IA para SRE
srimtipparaju-ux/perfagent
Análise de performance com IA que roteia alertas para o time certo
Ver no GitHubPlataforma de diagnóstico de performance orientada por IA que analisa relatórios Oracle AWR, planos de execução SQL, dumps de thread/heap Java, gravações JFR, logs de console e stack traces. Classifica achados por severidade e roteia automaticamente para times via Slack, Jira e email com observabilidade nativa de LLMOps.
Instalação
npx convez-ai srimtipparaju-ux/perfagent1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.
Métricas
Casos de uso
- Diagnóstico automático de gargalos em bancos de dados Oracle
- Análise de performance em aplicações Java (heap, threads, JFR)
- Validação de SQL em CI/CD antes de merge
- Correlação e priorização de alertas em incidentes
Veredito

Skill maduro e prático para equipes SRE/DevOps que lidam com observabilidade de performance em stacks Oracle e Java. Integração sólida com Anthropic Claude, Pinecone e fluxos de notificação — pronto para produção com suporte a múltiplos ambientes.
README
A tradução para o português deste README ainda está na fila.
perf-agent
An AI-powered performance diagnostic agent. Analyzes Oracle AWR reports, SQL execution plans, Java thread/heap dumps, JFR recordings, browser console logs, and stack traces. Routes findings with severity-ranked reports to the right teams via Slack, Jira, and email — automatically.
Architecture
Inputs Agent Pipeline Outputs
────── ────────────── ───────
File Upload ──┐ ┌──────────────┐ Slack #db-team
Alert Hook ──┤──────▶ │ Classifier │──┐ Slack #java-team
Monitoring ──┤ └──────────────┘ │ Slack #on-call
Scheduled ──┘ │ │ Jira DBA project
▼ │ Jira BACKEND project
┌─────────────────┐ │ Email team DLs
│ Skill Analyzers │ │ Word Report (.docx)
│ (run in parallel)│ │
└─────────────────┘ │
│ │
▼ │
┌─────────────────┐ │
│ Report Compiler │◀────┘
└─────────────────┘
│
┌──────────┼──────────┐
▼ ▼ ▼
Slack Jira Email
Agents
| Agent | File | Role |
|---|---|---|
| Classifier | src/agents/classifier.ts | Reads input, picks skills, estimates severity |
| Analyzer | src/agents/analyzer.ts | Runs Claude with skill prompts, parses JSON |
| Correlator | src/agents/correlator.ts | Groups related alerts into one incident |
| Reporter | src/agents/reporter.ts | Merges findings, formats Slack/Jira/email |
| Orchestrator | src/agents/orchestrator.ts | Ties the pipeline together |
| Scheduler | src/utils/scheduler.ts | Nightly trends + weekly digest |
Quick Start
1. Clone and install
git clone https://github.com/YOUR_USERNAME/perf-agent.git
cd perf-agent
npm install
2. Configure environment
cp .env.example .env
# Edit .env — at minimum, set ANTHROPIC_API_KEY
Only ANTHROPIC_API_KEY is required. Slack, Jira, and email are optional — the agent works without them (reports are returned via API and logged).
3. Run locally
npm run dev # TypeScript watch mode
# or
npm run build && npm start
4. Deploy with Docker
# Local / VPS
docker-compose up -d
# AWS ECS
npm run deploy:aws
API Reference
POST /analyze — Manual upload
# Upload a file
curl -X POST http://localhost:3000/analyze \
-F "files=@awr_report.html" \
-F "application=OrderService" \
-F "environment=production"
# Paste SQL text
curl -X POST http://localhost:3000/analyze \
-F "text=SELECT * FROM orders o, customers c WHERE o.amount > 1000" \
-F "application=OrderService"
Response (202 — analysis runs in background):
{ "inputId": "uuid", "message": "Analysis started" }
POST /ci/sql-gate — CI/CD SQL review
curl -X POST http://localhost:3000/ci/sql-gate \
-H "Content-Type: application/json" \
-d '{ "sql": "SELECT * FROM orders o, customers c", "pullRequest": "123", "repo": "my-app" }'
Response:
{
"passed": false,
"gate": "FAIL",
"severity": "Critical",
"criticalCount": 1,
"findings": [...],
"message": "SQL gate FAILED. 1 critical issue(s) must be fixed before merge."
}
Webhook endpoints
| Endpoint | Source |
|---|---|
POST /webhooks/pagerduty | PagerDuty alert webhook |
POST /webhooks/opsgenie | OpsGenie alert webhook |
POST /webhooks/grafana | Grafana alerting webhook |
GET /reports — List recent reports
curl http://localhost:3000/reports
GET /reports/:id — Get full report
curl http://localhost:3000/reports/uuid-here
GET /health — Health check
curl http://localhost:3000/health
Skills
The agent uses 8 diagnostic skills from the claudeSkills library:
| Skill | Triggered by |
|---|---|
awr-analysis | .html/.txt files containing "Snap Id", "DB Name", wait events |
sql-monitor-analysis | SQL Monitoring reports with "A-Rows", "E-Rows", execution plans |
sql-tuning | Raw SQL text (SELECT/INSERT/UPDATE/DELETE/MERGE) |
thread-dump-analysis | jstack output, java.lang.Thread.State, BLOCKED threads |
heap-dump-analysis | MAT/VisualVM reports, "Dominator Tree", "Retained Heap", OOM |
jfr-analysis | jfr print output, JMC reports, CPUSample events |
ui-console-analysis | Browser console logs, .har files, Lighthouse reports |
stack-trace-analysis | Any exception in any language |
Team Routing
Edit config/routing.ts to match your team structure:
export const ROUTING_RULES: RoutingRule[] = [
{
skill: 'awr-analysis',
team: 'DBA',
slackChannel: '#db-team', // your Slack channel
jiraProject: 'DBA', // your Jira project key
emailList: ['dba@yourcompany.com'],
notifyOnSeverity: ['Critical', 'High'],
},
// ... one entry per skill
];
Connecting Integrations
Slack
- Create a Slack App at api.slack.com/apps
- Add Bot Token Scopes:
chat:write,files:write - Install to workspace, copy Bot Token
- Set
SLACK_BOT_TOKEN=xoxb-...in.env - Invite the bot to each channel:
/invite @perf-agent
Jira
- Go to id.atlassian.com/manage-profile/security/api-tokens
- Create an API token
- Set
JIRA_BASE_URL,JIRA_EMAIL,JIRA_API_TOKENin.env
Email (SendGrid)
- Create account at sendgrid.com
- Create an API key with Mail Send permission
- Set
SMTP_HOST=smtp.sendgrid.net,SMTP_USER=apikey,SMTP_PASS=your-key
PagerDuty Webhook
- In PagerDuty: Integrations → Generic Webhooks (V3)
- Set URL to:
https://your-server.com/webhooks/pagerduty - Subscribe to:
incident.trigger
Grafana Webhook
- In Grafana: Alerting → Contact Points → New → Webhook
- URL:
https://your-server.com/webhooks/grafana
CI/CD SQL Gate (GitHub Actions example)
- name: SQL Performance Gate
run: |
RESULT=$(curl -s -X POST $PERF_AGENT_URL/ci/sql-gate \
-H "Content-Type: application/json" \
-d "{\"sql\": \"$(cat migrations/latest.sql | jq -Rs .)\", \"pullRequest\": \"$PR_NUMBER\"}")
PASSED=$(echo $RESULT | jq -r '.passed')
echo $RESULT | jq .
[ "$PASSED" = "true" ] || exit 1
Future Ideas to Build Next
-
Feedback Loop — when a Jira ticket is resolved, read the resolution notes and build a knowledge base of "what fixed this pattern." Surface suggestions for similar future incidents.
-
Multi-input Synthesis — when an incident is declared, auto-pull AWR snapshot + thread dump + last 100 error log lines simultaneously, run all skills in parallel, produce a single incident briefing in 60 seconds.
-
Slack Bot Mode — let developers post a stack trace or SQL directly in any channel and get an analysis in-thread. No form or upload needed.
-
Trend Regression Detection — compare this week's AWR metrics to last week's. Automatically flag if wait event % has increased > 20% week-over-week.
-
Knowledge Base — store anonymized findings and their resolutions. Query it to say "last time we saw db file sequential read at 40%+ on ORDERS, the fix was index X."
Project Structure
perf-agent/
├── src/
│ ├── index.ts Main Express server
│ ├── types.ts All TypeScript interfaces
│ ├── agents/
│ │ ├── classifier.ts Input → skills + teams
│ │ ├── analyzer.ts Skill execution via Claude API
│ │ ├── correlator.ts Groups related alerts
│ │ ├── reporter.ts Merges findings, formats output
│ │ └── orchestrator.ts Main pipeline
│ ├── integrations/
│ │ ├── slack.ts Slack Block Kit messages
│ │ ├── jira.ts Jira REST API v3
│ │ └── email.ts Nodemailer / SMTP
│ ├── skills/
│ │ └── prompts.ts Claude prompts per skill
│ ├── routes/
│ │ └── index.ts All HTTP endpoints
│ └── utils/
│ ├── logger.ts Winston logger
│ └── scheduler.ts Cron jobs
├── config/
│ └── routing.ts Team routing rules
├── deploy/
│ └── aws-deploy.sh ECS deployment script
├── Dockerfile
├── docker-compose.yml
├── .env.example
├── package.json
└── tsconfig.json