Skip to content

Surface bundle load time as a standalone transaction measurement #6335

Description

@antonis

The "JS Bundle Execution Before React Root" child span on app start already captures JS bytecode load + evaluation duration (from getBundleStartTimestampMs() to rootComponentCreationTimestampMs). However, this duration is only available as a child span — it's not emitted as a top-level transaction measurement, unlike app_start_cold/app_start_warm and time_to_initial_display/time_to_full_display which get both spans and measurements.

Surfacing it as a measurement (e.g. js_bundle_execution) would make it independently queryable and dashboardable.

Implementation

In appStart.ts attachAppStartToTransactionEvent(), after the existing app start measurement is set (~line 646), add:

if (jsExecutionSpanJSON) {
  setSpanDurationAsMeasurementOnTransactionEvent(event, 'js_bundle_execution', jsExecutionSpanJSON);
}

This works for both standalone and non-standalone app start modes since both go through attachAppStartToTransactionEvent.

Caveats

Scope

JS only. ~5 lines of code + tests.

Metadata

Metadata

Assignees

No one assigned
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions