-
Notifications
You must be signed in to change notification settings - Fork 1
feat(runtime-node): error-linked trace retention + Docker Desktop quickstart fixes #14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -41,7 +41,7 @@ you from zero to seeing data in ClickHouse. | |
| | Unhandled errors / rejections | ✅ automatic | ✅ automatic | | ||
| | Handled errors | `captureException(err)` | `captureException(err)` | | ||
| | Usage | session pings + `trackEvent()` | request counts/durations per route (automatic) | | ||
| | Traces | — (by design; no OTel in the browser) | ~1% sampled (configurable) | | ||
| | Traces | — (by design; no OTel in the browser) | ~1% sampled, plus **every erroring trace kept in full** | | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 [deterministic] markdownlint: MD013 — Risk: 30/100 Line length: Expected: 80; Actual: 108 🛠 AI fix prompt (copy & paste into your coding agent)Flagged by Autter security & observability checks. |
||
| | LLM usage & cost | — | `withLlmCall()` / Vercel AI SDK telemetry / GenAI semconv — always 100% (model, tokens, cost) | | ||
|
|
||
| **What is never sent:** cookies, DOM content, form values, request/response | ||
|
|
@@ -58,6 +58,11 @@ cd autter-runtime | |
| docker compose up # ClickHouse + ingester on :4318, key "dev-key" | ||
| ``` | ||
|
|
||
| > **That's all the clone is for.** It runs the ingester — you never add | ||
| > code to this checkout. Every step from here on (installing packages, | ||
| > creating `instrument.cjs`, …) happens in **your application's | ||
| > repository**, the app you want to monitor. | ||
|
|
||
| For real deployments, configure keys via env (or point | ||
| `AUTTER_KEY_VALIDATOR_URL` at your own key service): | ||
|
|
||
|
|
@@ -78,11 +83,15 @@ Full config reference: [`packages/otlp-ingester`](../packages/otlp-ingester). | |
|
|
||
| ## 3. Instrument your backend | ||
|
|
||
| In **your app's repository** (not the `autter-runtime` checkout from | ||
| step 2): | ||
|
|
||
| ```bash | ||
| npm install @autter/runtime-node | ||
| ``` | ||
|
|
||
| Create `instrument.cjs` — it must load **before** your app: | ||
| Create `instrument.cjs` in your app's root, next to its entry point — it | ||
| must load **before** your app: | ||
|
|
||
| ```js | ||
| const { initAutterServer } = require("@autter/runtime-node"); | ||
|
|
@@ -101,8 +110,10 @@ node --require ./instrument.cjs server.js | |
| ``` | ||
|
|
||
| That alone gives you: every incoming HTTP request traced-and-sampled, | ||
| request/error/duration rollups per route, and crashes captured. For | ||
| handled errors: | ||
| request/error/duration rollups per route, crashes captured, and the full | ||
| trace of any request that errors — erroring traces are retained even when | ||
| the sampler wouldn't have kept them, so every issue keeps the trace that | ||
| explains it. For handled errors: | ||
|
|
||
| ```js | ||
| const { captureException } = require("@autter/runtime-node"); | ||
|
|
@@ -303,7 +314,9 @@ clickhouse-client --password dev`. | |
| - [ ] `release` is wired to your git SHA in **both** frontend and backend — | ||
| it's what powers regression detection ("broke in release X"). | ||
| - [ ] Keep trace sampling at ~1% (`traceSampleRate`) — errors are always | ||
| captured regardless. | ||
| captured regardless, and the full trace of an erroring request is | ||
| retained (`retainTracesOnError`, on by default), so cheap sampling | ||
| doesn't cost you debugging context. | ||
| - [ ] The relay route keeps its built-in per-IP rate limit (or your WAF | ||
| covers it: `perIpRateLimit: false`). | ||
| - [ ] Direct browser ingest: your CSP includes | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -325,16 +325,12 @@ | |
| if (llmCall) llmCalls.push(llmCall); | ||
|
|
||
| // Server spans fold into 1-minute usage rollups so traffic is | ||
| // tracked even when the metrics pipeline isn't wired — | ||
| // senders that DO export request metrics mark the resource | ||
| // with `autter.metrics_wired` and are skipped here, or every | ||
| // request they trace would count twice. The rollup key uses | ||
| // the normalized route: `http.route` is already a template, | ||
| // but the url.path/http.target fallback is a raw path whose | ||
| // id segments would explode the SummingMergeTree key space | ||
| // (and never line up with the metric-fed rows for the same | ||
| // endpoint). | ||
| if (kind === "server" && !resource.metricsWired) { | ||
| // tracked even when the metrics pipeline isn't wired. Spans | ||
| // exported by error-linked tail retention are skipped: the SDK | ||
| // ships those at ~100% alongside a metrics pipeline that already | ||
| // counts every request, so folding them in would double-count | ||
| // erroring routes. | ||
| if (kind === "server" && attrs.get("autter.tail_retained") !== "true") { | ||
|
Check failure on line 333 in packages/otlp-ingester/src/normalize-otlp.ts
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟠 [ai] Tail-retained requests are dropped from fallback usage rollups — Risk: 78/100 This condition excludes every tail-retained server span from
🛠 AI fix prompt (copy & paste into your coding agent)Flagged by Autter security & observability checks. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔴 [ai] Wired server spans are double-counted in usage rollups — Risk: 80/100 The rollup condition no longer checks
🛠 AI fix prompt (copy & paste into your coding agent)Flagged by Autter security & observability checks. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔴 [ai] Runtime-node requests are double-counted after the metrics-wired guard is removed — Risk: 86/100 This is not safe to ship because the changed server-span branch now adds a span-derived request rollup for every ordinary server span unless it has
🛠 AI fix prompt (copy & paste into your coding agent)Flagged by Autter security & observability checks. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔴 [ai] Runtime server spans are now double-counted against the metrics pipeline — Risk: 86/100 This condition unconditionally creates a request rollup for every ordinary server span and no longer checks the resource's
🛠 AI fix prompt (copy & paste into your coding agent)Flagged by Autter security & observability checks. |
||
| addToRollup(rollups, { | ||
| service: resource.service, | ||
| environment: resource.environment, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 [deterministic] markdownlint: MD013 — Risk: 30/100
Line length: Expected: 80; Actual: 108
🛠 AI fix prompt (copy & paste into your coding agent)
Flagged by Autter security & observability checks.