Commit b6b10ea
authored
feat!: Support clicks and custom event tracing (#432)
## Summary
Support tracing for the following product analytics events
- Clicks
- PageViews
- LD.track
Make sure to add the LD context to each of these traces
<img width="736" height="575" alt="Screenshot 2026-03-30 at 12 26 56 PM"
src="https://github.com/user-attachments/assets/71a916cd-e948-4ab4-a781-e258cd426cd0"
/>
Note:
- Removes support for otel eventNames
- Passes in full url for clicks to better support search
## How did you test this change?
1. Run the react router e2e app
2. Make sure the client is running
- [ ] Clicks are recorded with correct info
- [ ] PageViews are recorded with correct info
- [ ] Custom events are recorded with correct info
https://www.loom.com/share/e112659086f94a228279a97cc2b690b7
## Are there any deployment considerations?
Breaking change: removal of event_names
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Medium Risk**
> Introduces new auto-instrumented spans for user interactions and
navigation, and removes the prior `otel.eventNames` configuration
(breaking API change). Risk is moderate because it changes tracing
behavior and emitted telemetry volume/shape across consumers.
>
> **Overview**
> **Adds product-analytics tracing controls and spans.** Introduces
`productAnalytics` configuration (boolean or per-event toggles) to drive
which product analytics events are traced (clicks, page views, and
`LD.track`).
>
> **Reworks OTel instrumentation wiring.** Removes support for
`otel.eventNames`, updates `UserInteractionInstrumentation` to emit
click spans with full URL and attach LaunchDarkly context-key
attributes, and adds new `LocationChangeInstrumentation` to emit
`page_view` spans on URL changes (also enriched with LD context).
>
> **LaunchDarkly observe integration now correlates context + events.**
Persists LD context key attributes after `identify` and uses them when
generating `launchdarkly.track` spans; e2e React Router app adds new
`LDClient` / `LDClient Lazy` test pages and updates staging endpoints to
exercise these behaviors.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
9a1c887. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent de17cdf commit b6b10ea
16 files changed
Lines changed: 759 additions & 28 deletions
File tree
- e2e/react-router/src
- routes
- sdk/highlight-run/src
- api
- client
- otel
- types
- integrations/launchdarkly
- plugins
- sdk
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
23 | | - | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
28 | | - | |
| 29 | + | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
15 | 21 | | |
16 | 22 | | |
17 | 23 | | |
| |||
59 | 65 | | |
60 | 66 | | |
61 | 67 | | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
62 | 74 | | |
63 | 75 | | |
64 | 76 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
0 commit comments