Skip to content

Commit 8ed78e1

Browse files
fix: Add classname to user interaction (#258)
## Summary Add classname to any click events to be used in the heatmap ## How did you test this change? 1. Perform a click 2. Ensure it shows up in the event attributes of a trace ## Are there any deployment considerations? N/A <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Add `event.classname` to user interaction span attributes and bump instrumentation version to `0.1.1`. > > - **SDK: User Interaction Instrumentation (`sdk/highlight-run/src/client/otel/user-interaction.ts`)** > - Add `event.classname` to span attributes alongside `event.type`, `event.tag`, `event.xpath`, `event.id`, etc. > - Bump `UserInteractionInstrumentation.version` from `0.1.0` to `0.1.1`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 18df004. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent ac9cb12 commit 8ed78e1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

sdk/highlight-run/src/client/otel/user-interaction.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function defaultShouldPreventSpanCreation() {
2727
* the Highlight SDK.
2828
*/
2929
export class UserInteractionInstrumentation extends InstrumentationBase {
30-
static readonly version = '0.1.0'
30+
static readonly version = '0.1.1'
3131
static readonly moduleName: string = 'user-interaction'
3232
private _spansData = new WeakMap<api.Span, SpanData>()
3333
private _zonePatched?: boolean
@@ -124,6 +124,7 @@ export class UserInteractionInstrumentation extends InstrumentationBase {
124124
['event.tag']: element.tagName,
125125
['event.xpath']: xpath,
126126
['event.id']: element.id,
127+
['event.classname']: element.className,
127128
['event.text']: element.textContent ?? '',
128129
['event.url']: window.location.href,
129130
['viewport.width']: window.innerWidth,

0 commit comments

Comments
 (0)