feat: expand telemetry β Sentry spans, GA4 events, Sentry init fix#859
Draft
thostetler wants to merge 2 commits intoadsabs:masterfrom
Draft
feat: expand telemetry β Sentry spans, GA4 events, Sentry init fix#859thostetler wants to merge 2 commits intoadsabs:masterfrom
thostetler wants to merge 2 commits intoadsabs:masterfrom
Conversation
Codecov Reportβ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #859 +/- ##
========================================
- Coverage 62.7% 62.6% -0.0%
========================================
Files 323 324 +1
Lines 38011 38143 +132
Branches 1723 1728 +5
========================================
+ Hits 23803 23876 +73
- Misses 14168 14226 +58
- Partials 40 41 +1
π New features to boost your workflow:
|
77f60b7 to
e3e2936
Compare
Next.js 16 defaults to Turbopack for `next dev`, which bypasses the Sentry webpack plugin and skips sentry.client.config.ts. Guard on `process.env.TURBOPACK` (truthy as 'auto' under default Turbopack, undefined under webpack/production) and require the config manually in browser context only.
Instruments key user flows end-to-end with Sentry inactive spans and GA4 behavioral events so latency and engagement can be tracked in production dashboards. Sentry spans added (all in PERF_SPANS): - search.submit.total / search.pagination.total β query lifecycle - search.results.render / search.facets.render β paint timing via useResultsRenderSpan - export.generate.total β full export flow in useCitationExporter - abstract.load.total / abstract.citations.load / abstract.references.load β SSR fetches - auth.login.total / auth.register.total / auth.session.validate β auth flows - orcid.oauth.total / orcid.claim.total / orcid.sync.total β ORCID flows - ux.full_text_time β time from results to full-text link click GA4 events added: - result_click β user clicks an abstract link in results - full_text_click β user opens a full-text resource (marked as conversion) - abstract_tab_view β user navigates between abstract tabs - search_no_results β query returns zero results Infrastructure: - makeSpanSlot factory for coordinated open/close across component boundaries - useResultsRenderSpan hook (closes both results and facets spans after paint) - useExportSpan hook for export span lifecycle - sendQueryAsTags with PII-safe allowlist (sort/start/rows/d/boostType only) - trackUserFlow wraps async server-side fetches with span + status - Sentry.setUser uses anonymous flag only β no credentials or PII
e3e2936 to
afe019d
Compare
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.
Next.js 16 Turbopack bypasses the Sentry webpack plugin, so sentry.client.config.ts was never loaded in dev. This adds a runtime guard to require it manually when Turbopack is active.
Instruments key user flows with Sentry performance spans and GA4 behavioral events for production latency and engagement tracking.
Sentry spans:
GA4 events:
Note: full_text_click must be manually marked as a key event in GA4 Admin > Events.