Skip to content
Telemetry
Product analytics SQL recipe

Find features used before upgrade

Join feature events to upgrade events and rank behaviors that occur before paid conversion.

Advancedproduct_eventsReviewed 2026-07-27Tested with Apache DataFusion 45.2.0

Reviewed by the Telemetry product team on . We checked the SQL syntax, required event fields, sample results, and limits on using the query. Who reviews this page

Question answered

Which features are most commonly adopted before an account upgrades?

Pre-upgrade behavior does not prove why an account upgraded. Use it to choose features to test in onboarding, lifecycle messages, and plans.

Event schema

Fields the query expects

FieldTypeWhy it exists
timestamp_utcTimestampWhen the event occurred.
team_idUtf8Stable account or workspace identifier.
event_nameUtf8Product event name.
feature_nameUtf8Stable feature identifier for feature_used events.
DataFusion SQL

Copy the query

sql
WITH upgrades AS (
  SELECT
    team_id,
    MIN(timestamp_utc) AS upgraded_at
  FROM product_events
  WHERE event_name = 'plan_upgraded'
  GROUP BY team_id
),
pre_upgrade_features AS (
  SELECT DISTINCT
    e.team_id,
    e.feature_name
  FROM product_events e
  JOIN upgrades u ON e.team_id = u.team_id
  WHERE e.event_name = 'feature_used'
    AND e.timestamp_utc < u.upgraded_at
    AND e.timestamp_utc >= u.upgraded_at - INTERVAL '30 days'
)
SELECT
  feature_name,
  COUNT(DISTINCT team_id) AS upgraded_teams_using_feature
FROM pre_upgrade_features
GROUP BY feature_name
ORDER BY upgraded_teams_using_feature DESC;

This read-only query is planned and executed against an empty typed table with Apache DataFusion 45.2.0. We review the synthetic sample output separately. Check field types, thresholds, and counting rules against your own data. Read the testing methodology.

Query result

Feature adoption among upgraded teams

Shared dashboards are the most common pre-upgrade behavior in this synthetic example.

feature_nameupgraded_teams_using_feature
shared_dashboard184
alert_created151
scheduled_export112
ai_query97

Synthetic example output. Run the query against your own event schema and thresholds before using it for operational decisions.

Feature adoption among upgraded teams: static chart of synthetic upgraded_teams_using_feature values from the Find features used before upgrade example result
Download this SVG chart of the sample results for an article, runbook, or design review. Please credit Telemetry.

Reproduce the example

Download the sample data

The JSON bundle includes the event schema with field types, illustrative input rows, exact SQL, expected output, review notes, and engine version. The CSV contains the displayed result.

How the SQL works

  1. 1The upgrades CTE finds the first upgrade time per team.
  2. 2The join limits feature activity to the thirty days before that upgrade, preventing post-upgrade adoption from contaminating the result.
  3. 3Count each team and feature pair once with DISTINCT so heavy users do not dominate the ranking.

Edge cases to check

  • Compare against non-upgraded teams before treating a common feature as predictive.
  • Control for account size, plan eligibility, and tenure where those variables influence both adoption and upgrade.
  • Use exposure events when a feature is not available to every account.

Recommended dashboard

  • Bar chart: upgraded_teams_using_feature
  • Comparison table: adoption among upgraded vs eligible non-upgraded teams
  • Line chart: time from first feature use to upgrade

Alert guidance

This is a product-learning query, not an operational alert. Schedule it as a weekly dashboard review.

Read alert setup

Set up the events this query needs

Related instrumentation and guides

Continue the analysis

Run it on your events

Create a table, adapt the fields, and save the result

Start free, send structured events, and use the query result as a chart, shared dashboard widget, or alert input.

Get an API key