Skip to content
This repository has been archived by the owner on Sep 30, 2024. It is now read-only.

web: link fetch to page view span #43993

Merged
merged 3 commits into from
Nov 8, 2022
Merged

Conversation

valerybugakov
Copy link
Member

@valerybugakov valerybugakov commented Nov 7, 2022

Context

Spans created by @opentelemetry/instrumentation-fetch always make independent traces, and the instrumentation doesn't provide an API for controlling span context.

This PR extends the default WebTracerProvider implementation to patch the behavior of the @opentelemetry/instrumentation-fetch tracer. Fetch spans created by the instrumentation when the window load span is recording are linked to it.

Test plan

Should be tested together with https://github.com/sourcegraph/sourcegraph/pull/43994. See the test plan there (these PRs are stacked).

App preview:

Check out the client app preview documentation to learn more.

@valerybugakov valerybugakov self-assigned this Nov 7, 2022
@cla-bot cla-bot bot added the cla-signed label Nov 7, 2022
@github-actions github-actions bot added the frontend-platform Issues related to our frontend platform, owned collectively by our frontend crew. label Nov 7, 2022
@sg-e2e-regression-test-bob
Copy link

sg-e2e-regression-test-bob commented Nov 7, 2022

Bundle size report 📦

Initial size Total size Async size Modules
0.04% (+1.00 kb) 0.01% (+1.01 kb) 0.00% (+0.01 kb) 0.00% (0)

Look at the Statoscope report for a full comparison between the commits def5238 and 5773b39 or learn more.

Open explanation
  • Initial size is the size of the initial bundle (the one that is loaded when you open the page)
  • Total size is the size of the initial bundle + all the async loaded chunks
  • Async size is the size of all the async loaded chunks
  • Modules is the number of modules in the initial bundle

@valerybugakov valerybugakov marked this pull request as ready for review November 7, 2022 08:25
@sourcegraph-bot
Copy link
Contributor

Codenotify: Notifying subscribers in OWNERS files for diff 2a70511...def5238.

Notify File(s)
@sourcegraph/frontend-platform-devs client/observability-client/src/instrumentations/fetch.ts
client/observability-client/src/sdk/index.ts
client/observability-client/src/sdk/tracer.ts

@valerybugakov valerybugakov added UI performance Improvements to the actual page rendering performance as well as perceived performance. observability labels Nov 7, 2022
Base automatically changed from vb/otel-react-page-views to main November 8, 2022 10:10
@valerybugakov valerybugakov merged commit f08cd08 into main Nov 8, 2022
@valerybugakov valerybugakov deleted the vb/link-fetch-to-pageview-spans branch November 8, 2022 10:12
@valerybugakov valerybugakov added the team/code-exploration Issues owned by the Code Exploration team label Nov 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla-signed frontend-platform Issues related to our frontend platform, owned collectively by our frontend crew. observability team/code-exploration Issues owned by the Code Exploration team UI performance Improvements to the actual page rendering performance as well as perceived performance.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants