Skip to content

web: add `WindowLoad` OpenTelemetry auto instrumentation

Warren Gifford requested to merge vb/window-load-instrumentation into main

Created by: valerybugakov

Context

Adds auto instrumentation of the window load event based on Web Performance API navigation entries.

  1. Listens to the first Web Performance navigation entries update.
  2. Creates the WINDOW_LOAD span capturing timings from FETCH_START till LOAD_EVENT_END.
  3. Adds performance navigation events to the WINDOW_LOAD span.
  4. Adds performance paint events to the WINDOW_LOAD span.
  5. Creates nested spans for all resources loaded before the LOAD_EVENT_END.

Implementation

The implementation is based on the OpenTelemetry Instrumentation Document Load. The implementation is forked because of various issues blocking the integration with other auto instrumentations.

The implementation is experimental. The plan is to pilot this span structure along with code helpers created for this instrumentation to see if we want to change them based on use-cases we encounter instrumenting other parts of the application like the Blob view.

Traces

ConsoleBatchSpanExporter

Screen Shot 2022-08-10 at 15 00 36

Honeycomb

Trace example

Screen Shot 2022-08-10 at 14 59 13

Resources

Test plan

  1. ENABLE_OPEN_TELEMETRY=true sg start web-standalone.
  2. Open web application.
  3. See the windowLoad span in the console.

App preview:

Check out the client app preview documentation to learn more.

Merge request reports

Loading