|
| 1 | +# SpecterOps — Integrations & Going Live |
| 2 | + |
| 3 | +SpecterOps runs with **zero setup** (simulated telemetry + offline reasoning). Each |
| 4 | +integration below upgrades a part of the system from "demo" to "real". Add them in |
| 5 | +any order — everything degrades gracefully if a key is missing. |
| 6 | + |
| 7 | +> After editing **`backend/.env`** restart the backend. After editing |
| 8 | +> **`frontend/.env`** restart the frontend (Vite only reads `VITE_*` at startup). |
| 9 | +
|
| 10 | +--- |
| 11 | + |
| 12 | +## 1. Gemini (AI reasoning) — free |
| 13 | + |
| 14 | +Turns the agents from scripted offline output into **real LLM reasoning**. |
| 15 | + |
| 16 | +1. Get a free key at **https://aistudio.google.com/apikey**. |
| 17 | +2. In `backend/.env`: |
| 18 | + ``` |
| 19 | + GEMINI_API_KEY=AIza... # your key |
| 20 | + GEMINI_MODEL=gemini-2.5-flash # recommended; blank = auto fallback chain |
| 21 | + ``` |
| 22 | +**Which model:** use **`gemini-2.5-flash`** — fast (keeps the live demo snappy), generous |
| 23 | +free tier. `gemini-2.5-pro` writes slightly richer post-mortems but is slower and has |
| 24 | +tighter free limits. If a model is unavailable the app auto-falls back down the chain. |
| 25 | + |
| 26 | +--- |
| 27 | + |
| 28 | +## 2. Dynatrace (real incidents) — free trial |
| 29 | + |
| 30 | +Lets SpecterOps pull **real open problems** from your tenant and analyze them. |
| 31 | + |
| 32 | +1. Start a free **Dynatrace trial** (SaaS) — or use the public **Playground**. |
| 33 | +2. Find your environment URL. Whatever you log in at (e.g. `https://abc12345.apps.dynatrace.com`), |
| 34 | + the **API host** is the `.live.` form: |
| 35 | + ``` |
| 36 | + DYNATRACE_URL=https://abc12345.live.dynatrace.com |
| 37 | + ``` |
| 38 | + (No trailing slash, no `/api`. The Playground's value is `https://playground.live.dynatrace.com`.) |
| 39 | +3. Create an **Access token**: Settings → Access tokens → Generate. Tick these scopes: |
| 40 | + |
| 41 | + | Scope (UI) | Internal | Used for | Priority | |
| 42 | + |---|---|---|---| |
| 43 | + | Read problems | `problems.read` | `GET /api/v2/problems` — auto-pull the incident | ⭐ required | |
| 44 | + | Read metrics | `metrics.read` | `GET /api/v2/metrics/query` — error rate & latency | ⭐ required | |
| 45 | + | Read entities | `entities.read` | `GET /api/v2/entities` — topology | recommended | |
| 46 | + | Read logs | `logs.read` | `GET /api/v2/logs/search` — log evidence (needs Log Management) | optional | |
| 47 | + | Write problem comments | `problems.write` | post the RCA **back** onto the problem | optional | |
| 48 | +4. In `backend/.env`: |
| 49 | + ``` |
| 50 | + DEMO_MODE=false |
| 51 | + DYNATRACE_URL=https://<env-id>.live.dynatrace.com |
| 52 | + DYNATRACE_API_TOKEN=dt0c01.... |
| 53 | + ``` |
| 54 | +5. Restart the backend → the **"Investigate latest live Dynatrace problem"** button appears. |
| 55 | + |
| 56 | +**Notes & honest limits** |
| 57 | +- Dynatrace has **no public "read traces" REST endpoint** (traces live in Grail/DQL), so |
| 58 | + the live path uses problems + metrics + entities + logs. Investigations still complete. |
| 59 | +- `response.time` is returned in **microseconds** and `errors.total.rate` as a **percent** — |
| 60 | + SpecterOps normalizes both. If a value can't be resolved, the metric tile is hidden rather |
| 61 | + than shown wrong. |
| 62 | +- **Push to Dynatrace** (posting the RCA as a problem comment) needs `problems.write`. The |
| 63 | + read-only Playground token returns 403 — that's expected. |
| 64 | +- The richest visuals come from `DEMO_MODE=true` (full simulated scenarios) reasoned over by |
| 65 | + real Gemini. `DEMO_MODE=false` shows *real* problems, whose richness depends on your tenant. |
| 66 | + |
| 67 | +--- |
| 68 | + |
| 69 | +## 3. MongoDB Atlas (persistent history) — free M0 |
| 70 | + |
| 71 | +Without it, incidents live in memory and reset on restart. With it, history persists. |
| 72 | + |
| 73 | +1. Create a free account at **https://www.mongodb.com/atlas** and a free **M0** cluster. |
| 74 | +2. **Database Access** → Add a database user (username + password). |
| 75 | +3. **Network Access** → Add IP → allow your IP (or `0.0.0.0/0` for testing). |
| 76 | +4. **Connect → Drivers → Python** → copy the SRV connection string and insert your password: |
| 77 | + ``` |
| 78 | + MONGODB_URI=mongodb+srv://USER:PASSWORD@cluster0.xxxxx.mongodb.net/specterops |
| 79 | + ``` |
| 80 | +5. Put it in `backend/.env`, restart. The status badge flips to **DB · persisted**. |
| 81 | + |
| 82 | +--- |
| 83 | + |
| 84 | +## 4. Firebase Auth (real Google / email sign-in) — free |
| 85 | + |
| 86 | +> **Why does clicking sign-in jump straight to a "demo" user?** Because Firebase isn't |
| 87 | +> configured yet, the app uses a built-in **demo identity** so the flow works with zero setup. |
| 88 | +> Add the keys below to get **real Google + email/password** login. |
| 89 | +
|
| 90 | +1. Create a project at **https://console.firebase.google.com**. |
| 91 | +2. **Build → Authentication → Get started** → enable **Google** and **Email/Password**. |
| 92 | +3. **Project settings → General → Your apps →** add a **Web app** → copy the SDK config. |
| 93 | +4. **Authentication → Settings → Authorized domains** → add `localhost` (and your deployed domain). |
| 94 | +5. Create **`frontend/.env`** (copy from `frontend/.env.example`) and fill: |
| 95 | + ``` |
| 96 | + VITE_FIREBASE_API_KEY=... |
| 97 | + VITE_FIREBASE_AUTH_DOMAIN=your-project.firebaseapp.com |
| 98 | + VITE_FIREBASE_PROJECT_ID=your-project |
| 99 | + VITE_FIREBASE_APP_ID=1:...:web:... |
| 100 | + ``` |
| 101 | +6. Restart the frontend (`npm run dev`). Sign-in now uses real Google/email; the modal's |
| 102 | + "Demo auth active" note disappears. |
| 103 | + |
| 104 | +Signed-in users' investigations are tagged to their account and shown in their **Profile**. |
| 105 | + |
| 106 | +--- |
| 107 | + |
| 108 | +## 5. Slack delivery (optional) — free |
| 109 | + |
| 110 | +1. Create an **Incoming Webhook** at https://api.slack.com/messaging/webhooks. |
| 111 | +2. In `backend/.env`: `SLACK_WEBHOOK_URL=https://hooks.slack.com/services/...` |
| 112 | +3. Restart. A **Send to Slack** button appears on the post-mortem. |
| 113 | + |
| 114 | +--- |
| 115 | + |
| 116 | +## About auto-remediation |
| 117 | + |
| 118 | +SpecterOps generates the **exact fix** and can **push the RCA back onto the Dynatrace |
| 119 | +problem** as a comment (with `problems.write`). It deliberately does **not** auto-execute |
| 120 | +fixes (creating indexes, rolling back deploys, restarting pods) — that requires direct, |
| 121 | +privileged access to your infrastructure/CI and must stay behind a human approval gate. |
| 122 | +Auto-applying production changes from an AALU loop is unsafe; the responsible pattern is |
| 123 | +**diagnose autonomously → recommend the fix → human approves → automation applies it.** |
| 124 | +That approval-gated execution is the natural next step and can be wired to your CI/CD. |
| 125 | + |
| 126 | +--- |
| 127 | + |
| 128 | +## Per-user Dynatrace (future) |
| 129 | + |
| 130 | +Today SpecterOps connects to **one** Dynatrace tenant configured in `backend/.env`. Letting |
| 131 | +each signed-in user connect *their own* tenant (e.g. via OAuth + stored per-user tokens) is a |
| 132 | +multi-tenant feature — straightforward to add on top of the current auth, but out of scope for |
| 133 | +the single-tenant demo. |
0 commit comments