Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(web-tracing): remove zone-context-manager #928

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

codecapitano
Copy link
Collaborator

@codecapitano codecapitano commented Jan 31, 2025

Why

Remove ZoneContextManager from the web-tracing instrumentation because it's not needed by Faro's default web-tracing instruments.

If users add more instrumentation manually, they now need to inject the context manager via teh web-tracing config.

  initializeFaro({
    instrumentations: [
      ...getWebInstrumentations({
        captureConsole: true,
      }),
      new TracingInstrumentation({
        contextManager: new ZoneContextManager(),
      }),
    ],
  });

This removes 36.3 kB (minified) | 12.2 kB (minified + gzip) from the bundle
and decreases loading time by 245ms (slow 3g) | 14ms (emerging 4g). https://bundlephobia.com/package/@opentelemetry/[email protected]

`

What

  • Remove ZoneContextManager
  • add spanProcessor via WebTracerConfig instead of the deprecated provider.addSpanProcessor() function

Links

Checklist

  • Tests added
  • Changelog updated
  • Documentation updated

@codecapitano codecapitano self-assigned this Jan 31, 2025
@codecapitano codecapitano added the improvement Request a change of an existing feature label Jan 31, 2025
@codecapitano codecapitano changed the title remove zone-context-manager chore(web-tracing): remove zone-context-manager Jan 31, 2025
@codecapitano codecapitano linked an issue Jan 31, 2025 that may be closed by this pull request
@codecapitano codecapitano force-pushed the remove-zone-context-manager branch from a24189d to b80c3ea Compare February 4, 2025 09:15
@codecapitano
Copy link
Collaborator Author

We can close this if we decide to add web-tracing to the default instrumentations.

#971

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking improvement Request a change of an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improvements to the tracing instrumentation
2 participants