feat: add lab SQLite migrate, LiteLLM env, and OTEL/Grafana stack
sonar / sonar (push) Skipped
sonar / sonar (pull_request) Failing after 40s
sonar / sonar (push) Skipped
sonar / sonar (pull_request) Failing after 40s
Enable local workshop readiness with executable SQLite migrations, OpenTelemetry hello signals, and a provisioned Grafana demo dashboard over Tempo/Loki/Prometheus. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -8,16 +8,55 @@ Hello world — repositório de testes MCP do TicketLab.
|
||||
|
||||
```bash
|
||||
npm ci
|
||||
cp .env.example .env # preencha LITELLM_API_KEY
|
||||
npm run migrate
|
||||
npm start
|
||||
```
|
||||
|
||||
Requires Node.js 22+.
|
||||
Requires Node.js 22+ and npm (`package-lock.json`).
|
||||
|
||||
## SQLite
|
||||
|
||||
```bash
|
||||
npm run migrate
|
||||
```
|
||||
|
||||
Cria/atualiza `SQLITE_PATH` (default `data/ticketlab.sqlite`) com a migration `migrations/001_tickets.sql`.
|
||||
|
||||
## LiteLLM
|
||||
|
||||
Configure no `.env` (veja `.env.example`):
|
||||
|
||||
- `LITELLM_BASE_URL`
|
||||
- `LITELLM_MODEL`
|
||||
- `LITELLM_API_KEY`
|
||||
|
||||
## Observability lab stack
|
||||
|
||||
Local Grafana + Tempo + Loki + OTEL Collector (+ Prometheus):
|
||||
|
||||
```bash
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
| What | Where |
|
||||
|------|--------|
|
||||
| Grafana UI | http://localhost:3001 (`admin` / `admin`) |
|
||||
| Demo dashboard | http://localhost:3001/d/ticketlab-demo (folder TicketLab; starred) |
|
||||
| OTLP HTTP | `http://localhost:4318` |
|
||||
| OTLP gRPC | `localhost:4317` |
|
||||
| Tempo | http://localhost:3200 |
|
||||
| Loki | http://localhost:3100 |
|
||||
| Prometheus | http://localhost:9090 |
|
||||
|
||||
Copy `.env.example` → `.env` for LiteLLM, SQLite e OTLP. Datasources (Prometheus, Loki, Tempo) are provisioned automatically. Stop with `docker compose down`.
|
||||
|
||||
## Scripts
|
||||
|
||||
- `npm run build` — compile TypeScript to `dist/`
|
||||
- `npm start` — run the compiled hello program
|
||||
- `npm start` — hello world with OTLP (trace → Tempo, log → Loki, metric → Prometheus)
|
||||
- `npm run typecheck` — type-check without emitting
|
||||
- `npm run migrate` — apply SQLite migrations
|
||||
- `npm test` — build and run tests
|
||||
|
||||
## CI / quality gate
|
||||
|
||||
Reference in New Issue
Block a user