Repository navigation
Releases
@strada.sh/[email protected]
-
userIdoption fortrack()andcaptureException(): setuser.idon an event or error without wrapping the call in a baggage context.import { captureException, track } from "@strada.sh/sdk" track("task_started", { org_id: org.id }, { userId: session.userId }) captureException(error, { userId: job.userId, tags: { handler: "export" } })
It lands in the same
user.idattribute that baggage and the browser cookie set, so the record joinsotel_users. Use it where the user is known but there is no request context: Durable Object alarms, queue consumers, cron jobs. An explicituserIdwins over the user from baggage or the browser cookie.
@strada.sh/[email protected]
- Fewer ingest requests — every flush is now one request to
/v1/batchwith spans, logs, and metrics together. - Debounced flush on Cloudflare Workers and Vercel — the
waitUntilflush waits until no record arrived for 100ms (at most 1s), so spans that end after anawaitand concurrent requests in the same isolate share one request. Before, each span sent its own request. - A slow observable metric callback no longer delays logs and spans — collection stops at
telemetry.metrics.exportTimeoutMillis.
Requires the Strada collector with /v1/batch (live on strada.sh). Update self-hosted collectors first.
@strada.sh/[email protected]
- Fixed Cloudflare Workers crash on every request — in 0.8.0 and 0.9.0, a Worker whose runtime exports
tracing.enterSpanthrewTypeError: Illegal invocationfromstartActiveSpan()/startSpan(), so every traced request failed with error 1101. The native Cloudflare span bridge now works.
@strada.sh/[email protected]
-
Automatic spans with
node:diagnostics_channel— opt-in integrations from@strada.sh/sdk/instrument. No module patching, no preload, no extra packages. Works with any import order and in bundled apps (Vite, Next):import { initStrada } from '@strada.sh/sdk' import { fetchSpans, httpClientSpans, httpServerSpans, mysql2Spans, redisSpans } from '@strada.sh/sdk/instrument' initStrada({ projectId: '01JTHG5M7XPQR8KNCZ0W4D', service: 'api', integrations: [fetchSpans(), httpClientSpans(), httpServerSpans(), mysql2Spans(), redisSpans()], })
Integration What it records fetchSpans(),httpClientSpans()client spans for outgoing requests, with traceparentandbaggageheaders added.httpClientSpans()needs Node 22.12+httpServerSpans()a server span per incoming request, active for the whole handler, parented to the incoming traceparentmysql2Spans(),redisSpans(),mongooseSpans()database client spans with db.*attributes (mysql2 3.20+, redis 5.12+, ioredis 5.11+, mongoose 9.7+)graphqlSpans(),aiSpans(),h3Spans()graphql 17+, AI SDK 7+ GenAI spans with token usage, h3 v2 with tracingPlugin()pinoLogs()every pino 9.10+ log line becomes an OTel log record, correlated to the active span Spans from these integrations are active inside the traced call, so nested spans, logs, and errors attach to them. Nothing is enabled by default. Write your own integration for any library that publishes a
TracingChannel: an integration is{ name, setup() }, wheresetup()returns the teardown thatshutdown()runs. See https://strada.sh/docs/instrumentation. -
W3C
tracestatesupport — the header is read, sent to downstream requests, and stored on spans. New exportscreateTraceState()and theTraceStatetype, the same as in@opentelemetry/api. Spans also export their traceflags, soTraceFlagsinotel_tracesis no longer always0. -
Cloudflare Workers export per invocation — each invocation exports its own records, and the SDK starts no timers in Workers. A flush no longer waits for another request's export. Metrics export with the invocation that recorded them, and only series that changed are sent. Before, a shared export chain could delay or lose telemetry, and every flush sent all metrics again.
-
registerOpenTelemetry()is all or nothing and never throws — if another OTel SDK already owns one global, or a registration step throws, it rolls back every global it set and returns the error. -
Browser: tab switches rejoin a page trace — when a hidden tab is visible again, the SDK starts a
pageview.resumespan. Events and errors after a tab switch get a parent trace again. It is not apageview, so page analytics do not count a tab switch as a hit. -
Fixed lost batches on page close — the 64 KiB
keepalivelimit is now checked in bytes, not characters. Batches with many non-ASCII characters are no longer dropped. -
Fixed re-init after
shutdown()— metrics no longer export old cumulative values again, and instruments stop collecting while the SDK is not exporting. On Node,shutdown()removes theuncaughtException,unhandledRejection, andbeforeExithandlers, so a laterinitStrada()can changecaptureUncaughtErrors. -
Stricter
traceparentparsing — a version00header with extra fields after the flags is rejected, as the W3C spec requires.
[email protected]
-
Raw telemetry is kept by default — traces, logs, errors, and metrics no longer expire at 14 / 30 / 90 days. Set a custom TTL only when you want that signal to expire:
strada projects retention -p api strada projects retention update -p api --traces-days 7 --logs-days 14 strada projects retention update -p staging --all-days 7 strada projects retention update --traces-days -1 strada projects create staging --all-days 7
Pass
-1to remove a custom TTL and keep that signal forever. Custom values are 1 through 365 days. Browser analytics and health-check aggregates stay at 90 days. After website production deploy, runstrada database upgradeso Tinybird drops the old default TTLs. New self-hosted ClickHouse tables also keep all raw rows. Existing ClickHouse tables still needALTER TABLE ... REMOVE TTL. -
strada database upgradewaits through Tinybirdpending—pendingis treated as in-flight, same ascreating_schemaandcalculating. Leftover Staging candidates are skipped by numeric deployment id when timestamps are missing.
[email protected]
-
Unique visitors and first-visit analytics — browser traffic now uses cookie
strada_vid(visitor.id). Login and logout do not touch it.strada_uidstays the signed-in account. New commands for a daily traffic check without SQL:strada analytics overview -p my-app --since 7d strada analytics timeseries -p my-app --since 30d strada analytics visitors -p my-app --since 7d
overviewprints unique visitors, first visits, pageviews, sessions, bounce rate, top pages, and top referrers. Unique visitors in the pages MV usevisitor.id, withsession.idas fallback for old data. First visits come from theFirstVisitscolumn. Existing analytics rows are not backfilled. -
strada mcp— the same CLI binary is now a stdio MCP server. Cursor, Claude Desktop, and VS Code can spawn it and call supported non-interactive commands as tools (issues_list,logs,query):strada login npx @playwriter/install-mcp 'strada mcp' --client cursorlogin,logout,database create,database upgrade,projects retention update,mcp, and the TUI are not MCP tools. Run those in a terminal. -
Per-project Tinybird retention — set how long raw traces, logs, errors, and metrics stay in Tinybird:
strada projects retention -p api strada projects retention update -p api --traces-days 7 --logs-days 14 strada projects retention update -p staging --all-days 7
New projects default to 14 days for traces, 30 days for logs and custom events, and 90 days for errors and metrics. Browser analytics and health-check aggregates stay at 90 days. Lowering a value can delete existing Tinybird rows after schema promotion.
-
strada database upgradewaits for an in-progress Tinybird deploy — a 400 that means "already a deployment in progress" is no longer treated as a hard failure. Upgrade now waits and retries until Tinybird finishes. Runstrada database upgradeagain if a previous attempt failed withDeployment not found.
@strada.sh/[email protected]
-
Unique visitors — the browser SDK writes cookie
strada_vid(visitor.id) on first pageview.strada_uidstays the signed-in account (user.id). Login and logout do not touchstrada_vid. No localStorage.Tab focus no longer starts an extra pageview. SPA navigations use the Navigation API only, and only
sameDocumentnavigations, so a full page load is not counted twice.identifyUser()updatesstrada_uidwithout restarting the active pageview. -
Telemetry never throws into application code — high-level SDK calls catch internally and return the failure instead of throwing it:
const error = captureException(err) if (error) { // optional. The SDK already logged it once. }
Function Returns captureException(),track(),trackPageview(),identifyUser(),initStrada()Error | undefinedflush(),shutdown()Promise<Error | undefined>Almost every call site can ignore the return value. Failures are also logged once with
console.warn, deduplicated by message.startSpan()still re-throws: it wraps your callback, records the exception on the span, and leaves app control flow unchanged. -
A blank
projectIddisables export — missing env vars or secrets no longer post tohttps://-ingest.strada.sh. CallinitStrada()unconditionally:initStrada({ projectId: env.STRADA_PROJECT_ID, // "" while the secret is missing token: env.STRADA_TOKEN, service: "my-worker", }) track("thing_happened", { ok: true }) // no guard, no request
An explicit
endpoint(a local collector) still exports without a projectId.
[email protected]
-
URL health checks — monitor any HTTP endpoint on a cron schedule and get alerted when it fails. Checks run as a Cloudflare Workflow, one durable step per org, so a slow tenant does not block others:
strada checks create --url https://api.example.com/health --name "API health" strada checks list strada checks disable <id> strada checks enable <id> strada checks delete <id>
Defaults: GET, expect 200-299, check every 5 minutes (
*/5 * * * *), alert after 2 consecutive failures, 60 minute cooldown. After 24 hours of continuous failure the check auto-disables so a dead URL does not fill ClickHouse. Recovery notifications fire automatically when the URL comes back.Results live in
otel_health_checks. Failed checks store the response body (up to 16KB) and headers so you can see what the server returned:strada query " SELECT Timestamp, StatusCode, LatencyMs, ErrorMessage FROM otel_health_checks WHERE Success = 0 ORDER BY Timestamp DESC LIMIT 20 "
-
Rewritten alerts and destinations — multiple named error-alert rules per org, with project-scoped overrides. Destinations (email, webhook, Slack) are org-scoped and auto-link to every rule, including health checks:
# Org-wide default strada alerts create --name "All errors" --channel email --to [email protected] # Project override: only fire after 20 errors in 30 minutes strada alerts create --name "Frontend noise" --project frontend --threshold 20 --window 30 strada alerts list strada alerts update <id> --threshold 5 --window 15 strada alerts delete <id> strada alerts test strada destinations list strada destinations remove <id>
alerts add/alerts set/alerts removeare gone. Usecreate,update, anddelete. -
--statusonissues list— default is now open only. Pass--statusto include other triage states:strada issues list -p my-app strada issues list -p my-app --status all strada issues list -p my-app --status resolved
Valid values:
open,resolved,muted,ignored,all. -
CLI docs site — every command now has a generated Holocron page under the CLI tab, with usage, flags, and examples. Command descriptions use
.example()so--helpand the docs stay in sync. -
CLI sessions last one year — device-flow tokens no longer expire after 7 days. Active sessions refresh at most once per day.
-
TUI starts correctly — Termcast is initialized before the cache module, so
stradaopens with the right~/.termcast/compiled/stradastorage instead of creating a cache before Termcast is ready. -
strada database upgradeno longer deadlocks on slow Tinybird data migrations. It waits fordata_ready(up to 45 minutes), adopts in-flight deployments, and allows destructive schema changes so removed datasources can be cleaned up.
@strada.sh/[email protected]
-
trackPageview()for server-side pageviews — emit a zero-durationpageviewspan from Node or Cloudflare Workers. It lands in the same analytics materialized views as browser pageviews, so bots, AI crawlers, JS-blocked visitors, and SSR-only pages show up in analytics:import { initStrada, trackPageview } from "@strada.sh/sdk" app.use((req, res, next) => { trackPageview({ path: req.path, url: req.url, referrer: req.headers.referer, }) next() })
Cloudflare Workers:
export default { fetch(request, env) { initStrada({ projectId: "...", service: "docs", token: env.STRADA_TOKEN }) const url = new URL(request.url) trackPageview({ path: url.pathname, url: url.href }) }, }
session.idanduser.idcome from W3C Baggage when not passed. Relative URLs are parsed safely; only absolute URLs seturl.full. -
Cloudflare native tracing bridge — when
tracing.enterSpanis available (workerd 2026-06-16+), everystartActiveSpan()also creates a Cloudflare native span. Custom OTel spans then appear in the Cloudflare trace waterfall next to auto-instrumented KV, D1, and fetch spans.Auto-enabled at runtime. Disable with
cloudflareTracing: false:initStrada({ projectId: "...", token: env.STRADA_TOKEN, cloudflareTracing: false, })
-
Better Auth plugin reports API errors —
strataBetterAuth()now callscaptureExceptionon Better AuthonAPIErrorfailures, taggedsource: better-auth.
[email protected]
-
Enriched issue detail view -- issue detail now shows URL path, user ID, session ID, browser brands, and environment alongside the existing metadata. The events table displays URL path and user ID columns. A 30-day frequency bar chart renders below the metadata so you can see error trends at a glance.
-
HTTP method and route in issues list -- the issues list subtitle now shows
POST /api/users/:idstyle labels combininghttp.methodandhttp.route(orurl.pathas fallback). The full detail view also shows method, route, and URL path as separate metadata labels. -
30-day frequency chart in both list and detail -- each issue shows a daily frequency bar graph for the last 30 days. In the list view, frequency data for all visible issues is batch-fetched in a single SQL query to avoid N+1 requests. Bar width adapts to terminal width.
-
Copy stacktrace action -- press the action key on any issue to copy the full stacktrace (prefixed with error type and message) to the clipboard. Available in both the issues list and the pushed detail view.
-
URL path visible in issues list -- the issues list subtitle shows the URL path inline (e.g.
error · /api/orders) so you can see which endpoint errored without opening the detail view. -
Server-side
url.pathpropagation into error rows -- errors captured viacaptureException()in Node or Cloudflare Workers HTTP handlers now includeurl.path,http.route, andhttp.methodin their tags. Errors fromspan.recordException()also inherit span-level attributes. -
Removed unhandled tag from issues list -- the red dot icon color already communicates unhandled status; the redundant text tag is gone for a cleaner layout.
-
Fixed bin.js entrypoint resolution under bun -- the CLI re-spawn logic now resolves the
bin.jspath correctly when running under bun.