Introducing a new way to review your PRs.

Read the announcement

frappe / insights

Open Source Business Intelligence Tool

View on GitHub

25 documents · Updated Nov 23, 2026

docs / telemetry-and-product-analytics

Telemetry and product analytics

Insights uses product-usage telemetry to show how sites adopt its workbooks, queries, charts, dashboards, sharing, and data sources. It sends small event records to Pulse, the server-side telemetry service, so product teams can measure adoption, usage patterns, failures, and the value of the data store without collecting the data that users analyze.

Analytics purpose

Telemetry turns product activity into answers about adoption and product health. The event catalog in docs/telemetry.md is the contract for event names and properties, and it groups signals around product questions such as where sites stop in the workbook flow, whether dashboards are viewed, which query styles are used, and which operations fail.

Product questions

The analytics model favors a small set of stable questions over a record of every click. Creation and sharing events show the path from a new data source to a shared dashboard, while daily activity and site summaries show whether that path leads to continued use.

The catalog also supports comparisons across app versions and site entry groups. These dimensions help explain changes in adoption without exposing user text, SQL, column names, emails, or record IDs.

References: docs/telemetry.md• L7-25 docs/telemetry.md• L28-40

Event groups

The system uses three broad event groups. Each group answers a different kind of product question and uses a different time scale.

Event groupPurposeExamples
Milestones and outcomesMeasure progress and results in a product flowWorkbook creation, query failure, data-source test, import outcome, sharing
Daily activityMeasure use by a site and user over timeWorkbook opened, dashboard viewed, template workbook used
Site summariesDescribe the current shape of a site and its data-store fitSite profile, query patterns, table and chart fit

The event name describes the product action in past tense. Properties carry the controlled variation, such as the interface used, the source type, or the result of an operation.

References: docs/telemetry.md• L28-40 docs/telemetry.md• L50-93

Event collection

Telemetry collection has browser and backend paths that meet at the same event contract. The browser reports the small set of creation actions that only the user interface can see. The backend reports saved milestones, outcomes, sharing changes, and views because it owns the lasting product state.

Shared event contract

Every event carries the Insights app version and an entry group. The backend derives these values from the site, and the browser receives them through the site-info API before it sends an event.

Pulse stores each event with its properties as a JSON record. The contract limits properties to low-cardinality values such as enums, booleans, counts, and buckets. This keeps reports useful while reducing the chance that product data or user content leaves the site.

References: insights/telemetry.py• L20-37 frontend/…/telemetry.ts• L1-15 frontend/…/session.ts• L24-35 docs/telemetry.md• L42-48

Browser instrumentation

The browser path starts only after the logged-in Insights application enables the telemetry plugin. Its shared capture helper adds the site properties and sends creation signals from the workbook and dashboard flows.

The child page Telemetry event instrumentation explains where individual events are placed and how their properties map to product behavior. This overview stays focused on the boundary between the interface and the server-side analytics system.

References: frontend/…/main.ts• L19-29 frontend/…/telemetry.ts• L7-15 frontend/…/workbook.ts• L39-41 frontend/…/dashboard.ts• L107-109 docs/telemetry.md• L36-40

Backend instrumentation

The backend path reports events through one Insights capture boundary. That boundary adds the same common properties and suppresses telemetry errors, so a failed report does not fail the user action that produced it.

Backend events cover outcomes that the server can verify. These include query failures, connection-test results, completed imports, saved workbooks, views, and access grants. Error reporting sends a closed error category rather than the exception message, which keeps the reason useful without sending source-specific detail.

References: insights/telemetry.py• L20-37 insights/telemetry.py• L103-130 insights/…/insights_query_v3.py• L215-230 insights/…/insights_data_source_v3.py• L437-454

Activity and reporting flows

Telemetry follows the product lifecycle from an action to a report in Pulse. The browser or backend emits a named event, Pulse applies its storage and de-duplication rules, and Insights can group the result by version, entry group, event properties, or site summary.

This diagram shows how product activity reaches analytics and how the daily site report differs from action-level events.

flowchart LR
    A[User action or saved outcome] --> B{Event source}
    B -->|Browser| C[Shared browser capture]
    B -->|Backend| D[Shared backend capture]
    C --> E[Common site properties]
    D --> E
    E --> F[Pulse event record]
    G[Daily scheduler] --> H[Site scan]
    H --> I[Site profile, query, and table events]
    I --> F
    F --> J[Product reports]

Milestone flow

Milestone events report durable product progress or an outcome that the server can confirm. A workbook or data source is reported after it is saved, a query failure is reported when execution fails, and a share event is reported when access is granted.

This separation keeps the analytics record aligned with product state. A UI action that does not reach the server does not appear as a completed server-side milestone.

References: docs/telemetry.md• L54-67 insights/…/insights_workbook.py• L64-70 insights/…/insights_data_source_v3.py• L89-92 insights/…/workbooks.py• L240-248

View flow

Workbook and dashboard views use a daily interval. The server records a view in the site View Log and sends at most one matching telemetry row for a user and site on that day.

Public dashboard guests share one telemetry user. The site scan therefore uses recent View Log windows as a floor for public view volume instead of treating the shared guest identity as a count of people.

References: insights/…/insights_workbook.py• L238-258 insights/…/insights_dashboard_v3.py• L85-103 insights/telemetry_scan.py• L235-267 docs/telemetry.md• L69-77

Daily site scan

The daily site scan reports facts about the site as a whole. It runs from the daily scheduler, checks whether Pulse telemetry is enabled before reading site data, and sends three separate events so each report remains within the event-size limit.

Site profile

The site profile describes site age, installation milestones, product footprint, user activity, and the presence of standard apps. It gives the denominator for cohort and retention reports and includes history from creation dates, so the first report can describe an existing site.

The scan names only apps and doctypes published by standard Frappe apps. It counts custom or unknown items without sending their names.

References: insights/telemetry_scan.py• L75-97 insights/telemetry_scan.py• L124-151 insights/telemetry_scan.py• L235-267 insights/telemetry_scan.py• L413-448 docs/telemetry.md• L87-90

Query summary

The query summary describes how users build and run queries. It groups query interfaces, data-store use, pipeline operations, filters, joins, aggregations, and known expression functions into counts or bounded lists.

The scan treats free-form query data as an input to classification, not as telemetry content. Values outside the engine's known lists become other, which prevents user-written operation names from becoming event property names.

References: insights/telemetry_scan.py• L270-321 insights/telemetry_scan.py• L324-357 docs/telemetry.md• L90

Table fit report

The table report helps answer whether the data store can serve as the default sync path. It compares catalog row estimates with the configured row limit and summarizes how many charts fit, do not have tables, or cannot be judged.

The scan reads catalog estimates from supported data sources and stores them on the related table records for later product behavior. It does not run a count query. If a source cannot answer, the related chart remains unknown rather than being marked too large.

References: insights/telemetry_scan.py• L359-378 insights/telemetry_scan.py• L463-513 insights/telemetry_scan.py• L516-543 insights/telemetry_scan.py• L615-624 docs/telemetry.md• L91-93

Server integration points

Telemetry depends on a small set of server boundaries that coordinate collection with normal Insights work. The scheduler starts site reporting, the site-info API supplies browser context, and Pulse receives the final event records.

Scheduler boundary

The daily scheduler calls the site scan beside other daily Insights work. The scan is not placed on the query or import path, so a user action does not wait for a site-wide report.

The scan handles each of its three reports independently. A failure in one report is logged and does not prevent the other reports from being attempted.

References: insights/hooks.py• L168-186 insights/telemetry_scan.py• L75-97

Site-info boundary

The site-info API supplies the app version and entry group that the browser adds to events. This keeps browser and backend reports on the same dimensions even though they run in different places.

The browser enables telemetry after session state confirms that the application is logged in. Site information is still loaded separately because it is also needed by public or guest-facing surfaces.

References: frontend/…/main.ts• L19-29 frontend/…/session.ts• L79-104 frontend/…/telemetry.ts• L5-15 docs/telemetry.md• L44-48

Pulse boundary

Pulse is the external storage and reporting boundary for Insights telemetry. The shared capture path identifies Insights as the sending app, adds common properties, and treats Pulse errors as non-blocking.

Daily events use the scheduler as their timing gate and a one-day interval for de-duplication. The site scan does not add a second interval because an early scheduler tick could otherwise cause Pulse to drop the report for that day.

References: insights/telemetry.py• L24-32 insights/telemetry_scan.py• L75-85 docs/telemetry.md• L3-5 docs/telemetry.md• L69-85

Change checklist

When these files or sections are changed, remember to consider these:

  • Update docs/telemetry.md in the same change as a new event or property. It is the contract shared by browser capture, backend capture, and Pulse reports.
  • Keep browser and backend common properties aligned with frontend/…/session.ts and insights/telemetry.py.
  • Preserve the split between frontend creation events and backend milestones or outcomes. Moving an event across that boundary can create duplicate or false funnel steps.
  • Preserve the daily interval on view and template-use events. Removing it changes the unit from daily activity to raw request volume.
  • Keep the site scan outside query and import request paths. It reads customer source catalogs and must remain gated by the Pulse-enabled check.
  • When changing site-scan lists or names, preserve the size cap and standard-name filter so custom names and oversized property sets do not leave the site.
  • When adding an error category, update the closed mapping and the event contract together. Unknown exception classes must still map to other.

Important failure modes

TriggerConsequenceGuard
Pulse telemetry is disabledThe site scan returns before it reads source catalogs or sends reportsis_pulse_enabled() gates run_site_scan
A telemetry send raises an exceptionThe reported product action continues, but that event is lostThe shared capture boundary suppresses telemetry errors
A daily scheduler tick arrives before the intervalPulse can drop the daily event and the site loses that day's activity or profile reportThe scan relies on the daily scheduler and does not add an interval
A source does not answer a catalog readRelated table-fit values remain unknown instead of showing the source as over limitThe scan skips failed estimates and reports charts_unknown
A custom app or doctype appears in site dataIts name must not be sent to PulseStandard app and doctype filters count unknown items without naming them
A query raises an exception outside the known classesThe event uses error_kind: other and keeps the message, SQL, and names out of telemetryerror_kind maps exception classes through a closed list

Key files

FileWhy to read it
docs/telemetry.mdDefines the event contract, product questions, privacy limits, daily events, and site-scan reports
insights/telemetry.pyDefines the shared backend capture boundary, common properties, safe value buckets, and error categories
frontend/…/telemetry.tsDefines the shared browser capture boundary
frontend/…/session.tsShows how the browser receives site-level analytics properties
insights/telemetry_scan.pyExplains the daily site profile, query summary, table-fit report, and catalog estimate flow
insights/hooks.pyConnects the daily scheduler to the site scan
insights/…/insights_workbook.pyShows how workbook views and template use become daily activity signals
insights/…/insights_dashboard_v3.pyShows how dashboard views become daily activity signals across shared and private surfaces
insights/…/insights_query_v3.pyShows how query outcomes become safe failure categories
insights/…/insights_data_source_v3.pyShows how source creation and connection outcomes reach the backend telemetry boundary
frontend/…/workbook.tsShows the browser-side workbook creation instrumentation
frontend/…/dashboard.tsShows the browser-side dashboard creation and chart-add instrumentation