Hello,

I am attempting to associate user clicks into a trace using open telemetry.

using the auto instrumentation library, I want click to result in a span under a per-page span.

/foobar

  • click
  • click
  • click
  • navigate /barfoo

/barfoo

  • click
  • click
  • click

like that.

I can get all my click traces to populate but cannot figure out how to associate them to a parent span for the page.

I’ve been following otel docs, but it really only seems to cover async calls to my API.

https://opentelemetry.io/docs/languages/js/instrumentation/

user interaction instrumentation library:

https://www.npmjs.com/package/@opentelemetry/instrumentation-user-interaction

Any tips would be appreciated :)

EDIT: I forgot to mention this is a React Single page Application.