Commit 65b2e46
authored
feat(otel): add OpenTelemetry ingest, query, and frontend traces UI (#18)
* feat(otel): add OpenTelemetry support with new permissions and plugin integration
- Introduced `temps-otel` crate to the workspace and updated dependencies in `Cargo.toml`.
- Added `OtelRead` and `OtelWrite` permissions to the `Permission` enum in `temps-auth`.
- Registered `OtelPlugin` in the console API for OpenTelemetry metrics, traces, and logs collection.
- Created migration for OpenTelemetry tables in the database.
- Updated relevant files to integrate OpenTelemetry functionality across the application.
* feat(otel): add OpenTelemetry ingest, query, and frontend traces UI
- Complete temps-otel crate: OTLP/HTTP protobuf ingest (traces, metrics, logs),
query handlers, TimescaleDB storage, rate limiting, quota checks, anomaly
detection, health summaries, and sidecar config generation
- Auth: support tk_ (API key) and dt_ (deployment token) authentication for
OTel ingest with path-based and header-based routes
- Frontend: Traces list page with filtering (time range, service, status),
trace detail page with span waterfall visualization and span detail panel,
setup section with OTLP endpoint and Next.js code snippets
- Add deployment_id to deployment tokens for OTel context propagation
- Fix protobuf Span.flags from uint32 to fixed32 per OTLP v1.1.0+ spec
- Remove server-side tail sampling (sampling is client SDK responsibility)
- Add OtelRead/OtelWrite permissions, plugin registered in console
- 117 passing unit tests, zero clippy warnings
* ci(otel): install protobuf-compiler in CI and document prerequisites
- Add protobuf-compiler installation to all CI jobs that compile the
workspace (check, clippy, build-tests, unit-tests, integration-tests)
- Add temps-otel to unit-b test group
- Add OTel feature entry to CHANGELOG.md [Unreleased] section
- Document protoc and wasm-pack as prerequisites in CONTRIBUTING.md
with platform-specific installation instructions
- Add changelog reminder to PR checklist
* feat(otel): add trace-level pagination with TraceSummary endpoint
Add GET /otel/trace-summaries that returns one row per trace (grouped by
trace_id) with root span name, service name, deployment environment,
span count, error count, and duration. This fixes the pagination bug
where the old endpoint returned flat spans causing only ~5 traces to
display per page.
- Add TraceSummary type with deployment_environment field
- Add query_trace_summaries() and count_traces() to OtelStorage trait
- Implement both in TimescaleDB (GROUP BY trace_id with array_agg)
- Implement both in MockOtelStorage for tests
- Add TraceSummariesResponse handler with proper total count
- Register new route and OpenAPI annotations
- Update TracesList.tsx to use new endpoint (remove client-side groupByTrace)
- Show Environment column as badge when viewing all environments
- Change page size from 50 to 10 traces per page
- Auto-inject OTel env vars in workflow_planner for deployments
* style(otel): add mobile responsiveness to traces list and detail views
- TracesList: filters stack vertically on mobile (flex-col sm:flex-row),
selects go full-width, hide Kind/Spans/Timestamp columns on mobile,
compact pagination, overflow-x-auto on table
- TraceDetail: waterfall + detail panel stack vertically on mobile
(flex-col lg:flex-row), detail panel goes full-width, span name
column narrower on mobile, min-width on scrollable rows
- Add mobile responsiveness guidelines to CLAUDE.md
* feat(otel): add Traces to project command palette (Ctrl+K)
* fix(otel): resolve environment name from deployments table in trace summaries
The deployment_environment column comes from the OTel resource attribute
which most SDKs don't set. JOIN deployments + environments tables to get
the actual environment name, falling back to the resource attribute via
COALESCE. Also qualify all column references with table alias since the
query now involves multiple tables.
* fix(otel): add horizontal overflow to span detail panel1 parent b32d810 commit 65b2e46
File tree
64 files changed
+14429
-48
lines changed- .github/workflows
- crates
- temps-auth/src
- temps-cli
- src/commands/serve
- temps-deployments/src/services
- temps-entities/src
- temps-migrations/src/migration
- temps-otel
- proto/opentelemetry/proto
- collector
- logs/v1
- metrics/v1
- trace/v1
- common/v1
- logs/v1
- metrics/v1
- resource/v1
- trace/v1
- src
- anomaly
- handlers
- ingest
- services
- sidecar
- storage
- tests
- web
- src
- api/client
- @tanstack
- components
- command
- project
- pages
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
64 files changed
+14429
-48
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
33 | 36 | | |
34 | 37 | | |
35 | 38 | | |
| |||
76 | 79 | | |
77 | 80 | | |
78 | 81 | | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
79 | 85 | | |
80 | 86 | | |
81 | 87 | | |
| |||
116 | 122 | | |
117 | 123 | | |
118 | 124 | | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
119 | 128 | | |
120 | 129 | | |
121 | 130 | | |
| |||
176 | 185 | | |
177 | 186 | | |
178 | 187 | | |
| 188 | + | |
179 | 189 | | |
180 | 190 | | |
181 | 191 | | |
| |||
195 | 205 | | |
196 | 206 | | |
197 | 207 | | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
198 | 211 | | |
199 | 212 | | |
200 | 213 | | |
| |||
327 | 340 | | |
328 | 341 | | |
329 | 342 | | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
330 | 346 | | |
331 | 347 | | |
332 | 348 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
11 | 14 | | |
12 | 15 | | |
13 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
883 | 883 | | |
884 | 884 | | |
885 | 885 | | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
886 | 896 | | |
887 | 897 | | |
888 | 898 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
21 | 44 | | |
22 | 45 | | |
23 | 46 | | |
24 | 47 | | |
25 | 48 | | |
26 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
27 | 56 | | |
28 | 57 | | |
29 | 58 | | |
| |||
97 | 126 | | |
98 | 127 | | |
99 | 128 | | |
| 129 | + | |
100 | 130 | | |
101 | 131 | | |
102 | 132 | | |
| |||
170 | 200 | | |
171 | 201 | | |
172 | 202 | | |
| 203 | + | |
173 | 204 | | |
174 | 205 | | |
175 | 206 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| 54 | + | |
54 | 55 | | |
55 | 56 | | |
56 | 57 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
7 | 17 | | |
8 | 18 | | |
9 | 19 | | |
| |||
37 | 47 | | |
38 | 48 | | |
39 | 49 | | |
| 50 | + | |
40 | 51 | | |
41 | 52 | | |
42 | 53 | | |
| |||
65 | 76 | | |
66 | 77 | | |
67 | 78 | | |
| 79 | + | |
68 | 80 | | |
69 | 81 | | |
70 | 82 | | |
| |||
152 | 164 | | |
153 | 165 | | |
154 | 166 | | |
| 167 | + | |
155 | 168 | | |
156 | 169 | | |
157 | 170 | | |
| |||
161 | 174 | | |
162 | 175 | | |
163 | 176 | | |
| 177 | + | |
164 | 178 | | |
165 | 179 | | |
166 | 180 | | |
| |||
266 | 280 | | |
267 | 281 | | |
268 | 282 | | |
269 | | - | |
| 283 | + | |
270 | 284 | | |
271 | 285 | | |
272 | 286 | | |
273 | 287 | | |
| 288 | + | |
274 | 289 | | |
275 | 290 | | |
276 | 291 | | |
277 | | - | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
278 | 299 | | |
279 | 300 | | |
280 | 301 | | |
| |||
287 | 308 | | |
288 | 309 | | |
289 | 310 | | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
290 | 319 | | |
291 | 320 | | |
292 | 321 | | |
| |||
0 commit comments