Conversation
Port the App Analytics browser SDK into packages/app-analytics, without accessibility auditing. It records action, page_view, and web_vital events and sends them as OTLP/HTTP JSON log records to /_analytics/v1/logs by default. The endpoint can be overridden. The package ships a framework-agnostic client (appAnalytics, createAppAnalytics) and a React entry point (<AppAnalytics />). Delivery batches records, caps request size, retries with backoff, and flushes with sendBeacon when the page is hidden. Nothing in AppKit uses the package yet. Co-authored-by: Isaac <no-reply@databricks.com> Signed-off-by: ditadi <victordperd@gmail.com>
ditadi
added this pull request to stack #616
September 26, 2026 21:42
This was referenced Sep 26, 2026
Contributor
🤖 AppKit PR bot🔬 Run evalsStart an eval for this PR from the evals-monitor app: Go to Evals Monitor → 📦 Try this PR's app templateScaffolds a new app from this PR's SDK build. Run it in any folder (requires the GitHub CLI — gh run download 36273868057 -R databricks/appkit -n appkit-template-0.78.0-pr.b743987-stack-app-analytics-01-sdk-611 -D appkit-pr-611 \
&& unzip -o "appkit-pr-611/appkit-template-0.78.0-pr.b743987-stack-app-analytics-01-sdk-611.zip" -d "appkit-pr-611" \
&& databricks apps init --template "appkit-pr-611"The template pins |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why the change
Databricks Apps can record server-side telemetry but nothing about what users do in the browser, so this adds
@databricks/app-analytics, a small browser SDK that sends page views, actions, and Web Vitals as OpenTelemetry log records to a same-origin endpoint.Special things to note
core/delivery.tsandcore/transport.ts, which own batching, retries, and the page-hide flush.Change outline
The package keeps the event model, delivery, and the three capture sources in separate folders:
The public surface is one client interface, a default shared client, and a React wrapper:
Every capture source feeds the same record and delivery path. Failures inside the SDK are swallowed so they never affect the host app:
Each request is a single OTLP
resourceLogsentry. Record attributes live underdatabricks.app.analytics.*:{ "resourceLogs": [{ "resource": { "attributes": [ { "key": "telemetry.sdk.name", "value": { "stringValue": "@databricks/app-analytics" } }, { "key": "telemetry.sdk.language", "value": { "stringValue": "webjs" } } ] }, "scopeLogs": [{ "logRecords": [{ "eventName": "page_view", "attributes": [ { "key": "databricks.app.analytics.event.name", "value": { "stringValue": "page_view" } }, { "key": "databricks.app.analytics.session.id", "value": { "stringValue": "…" } }, { "key": "databricks.app.analytics.page.path", "value": { "stringValue": "/orders" } } ] }] }] }] }Repo wiring: a new
app-analyticsvitest project (jsdom), knip entries, theweb-vitalsNOTICE and license entries, and a line inCLAUDE.md.This pull request and its description were written by Isaac.