User experience
Sessions
Page views
Browser errors
P75 page load
Page views and errors
SQL
SELECT extract(epoch from time_bucket('{{rollup_interval}}', timestamp))::integer AS time,
CASE WHEN status_code = 'ERROR' OR attributes___exception___type IS NOT NULL THEN 'Errors' ELSE 'Page views' END AS series,
COUNT(*)::float AS value
FROM otel_logs_and_spans
WHERE project_id='{{project_id}}'
AND resource___telemetry___sdk___language IN ('webjs', 'javascript', 'js')
AND (name LIKE 'Pageview · %' OR status_code = 'ERROR' OR attributes___exception___type IS NOT NULL)
AND ('{{var-app}}' = '' OR resource___service___name = '{{var-app}}')
{{time_filter}}
GROUP BY time, series ORDER BY time DESC
No data in this time range
Try a wider time range or adjust the filters.
Top pages
SQL
SELECT COALESCE(NULLIF(attributes___url___path, ''), replace(name, 'Pageview · ', '')) AS page,
COUNT(*)::text AS views,
ROUND((approx_percentile(0.75, percentile_agg(duration)) / 1000000.0)::numeric, 1)::text AS p75_ms
FROM otel_logs_and_spans
WHERE project_id='{{project_id}}'
AND resource___telemetry___sdk___language IN ('webjs', 'javascript', 'js')
AND name LIKE 'Pageview · %' AND duration IS NOT NULL
AND ('{{var-app}}' = '' OR resource___service___name = '{{var-app}}')
{{time_filter}}
GROUP BY page ORDER BY COUNT(*) DESC LIMIT 20
Recent sessions
SQL
SELECT COALESCE(MAX(attributes___user___full_name), MAX(attributes___user___email), MAX(attributes___user___id), attributes___session___id) AS user_or_session,
COALESCE(MAX(attributes___url___path), 'Unknown page') AS last_page,
COUNT(*) FILTER (WHERE name LIKE 'Pageview · %')::text AS page_views,
COUNT(*) FILTER (WHERE status_code = 'ERROR' OR attributes___exception___type IS NOT NULL)::text AS errors,
MAX(timestamp)::text AS last_seen
FROM otel_logs_and_spans
WHERE project_id='{{project_id}}'
AND resource___telemetry___sdk___language IN ('webjs', 'javascript', 'js')
AND attributes___session___id IS NOT NULL
AND ('{{var-app}}' = '' OR resource___service___name = '{{var-app}}')
{{time_filter}}
GROUP BY attributes___session___id ORDER BY MAX(timestamp) DESC LIMIT 50