Commit 65bc069
feat: ship multi-tenancy, Entra auth, retention, and pre-UI hardening
Backend
- Multi-tenancy: tenant_id column + ctx propagation across all reads/writes;
X-Tenant-ID HTTP header, x-tenant-id gRPC metadata, tenant.id resource attr;
per-tenant API key file support that overrides client header.
- Azure Entra ID DB auth (DefaultAzureCredential); strict sslmode gate
(require|verify-ca|verify-full); 30m conn lifetime cap for token TTL.
- Drain log clustering (pure-Go, persisted templates, O(1) LRU via
container/list); retains TF-IDF vectordb as fallback similarity ranker.
- RetentionScheduler: hourly batched purge + daily VACUUM/ANALYZE via raw
sqlDB (escapes GORM implicit tx); atomic.Bool overlap guard; cross-tenant.
- Self-signed TLS bootstrap: package mutex + flock cross-process serialization,
ECDSA-P256, 10yr validity, SANs for localhost/hostname.
- Panic recovery across HTTP middleware, gRPC interceptors, GraphRAG workers.
- DB health 503 fast-fail middleware with 5s ping loop.
- DLQ: typed envelopes, collision-safe tempfiles via os.CreateTemp.
- Decompression bomb guard: 64 MiB io.LimitReader post-gzip.
- OTel self-instrumentation via otlptracegrpc + otelhttp.
- API auth failure metric hook (missing_header/bad_scheme/bad_key reasons).
Storage fixes
- PurgeTracesBatched: Unscoped().Delete() to avoid GORM soft-delete.
- Span sweep: exclude spans whose trace still exists (clock-skew safe).
- UpdateLogInsight: tenant-scoped WHERE + ErrLogNotFoundOrWrongTenant.
- GetLogsV2 parallel queries now use WithContext(ctx).
- Drain template ID collisions on merge folded into existing bucket.
UI
- Mantine v8 (scoped migration from Radix UI).
- ErrorBoundary + WebSocket exponential backoff and heartbeat.
- react-window virtualization for Traces/Logs pages.
- Full TypeScript type contracts in ui/src/types/api.ts.
Ops
- docs/OPERATIONS.md (First Run, Production Checklist, Backup/Restore,
Incident Response, Observability, Known Limitations, Upgrade Path).
- .env.example covering every os.Getenv key.
- CLAUDE.md synced with new subsystems.
Verification: go build + go vet + golangci-lint (0 issues) + go test -race
across all packages green.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent adb6c76 commit 65bc069
125 files changed
Lines changed: 16685 additions & 7569 deletions
File tree
- docs
- internal
- ai
- api
- views
- archive
- cache
- compress
- config
- graphrag
- graph
- ingest
- mcp
- queue
- realtime
- storage
- telemetry
- tls
- tsdb
- ui
- dist
- assets
- vectordb
- test
- authservice
- inventoryservice
- notificationservice
- orderservice
- paymentservice
- shippingservice
- userservice
- ui
- src
- components
- __tests__
- mcp
- observability
- hooks
- __tests__
- types
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
4 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
5 | 9 | | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
10 | 15 | | |
11 | | - | |
12 | | - | |
13 | | - | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
14 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
0 commit comments