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

XHR instrumentation doesn't check browser support for PerformanceObserver entryTypes #1719

Closed
bradfrosty opened this issue Dec 4, 2020 · 0 comments · Fixed by #1720
Closed
Assignees
Labels
bug Something isn't working

Comments

@bradfrosty
Copy link
Contributor

What version of OpenTelemetry are you using?

0.12.0

What version of Node are you using?

Using in browser

Please provide the code you used to setup the OpenTelemetry SDK

const tracerProvider = new WebTracerProvider({
	plugins, // array of plugin instances
    resource: initResource(), // instance of `Resource`
});

tracerProvider.addSpanProcessor(initSpanProcessor()); // BatchSpanProcessor instance
tracerProvider.register();

What did you do?

This week we launched tracing with otel in our browsers. We started receiving the following error immediately after:

TypeError: entryTypes contained only unsupported types

Our breadcrumbs indicated this was coming from xhr.js, on a specific browser/OS combination.

OS: macOS 10.11 (El Capitan, which is normally bundled with Safari 9)
Browser: Safari 11 (the version released with with macOS 10.13)

This means it was only happening to users who upgraded Safari to 11, but not their OS.

caniuse reports that Resource Timing is supported in Safari 11, but it's limited to macOS 10.12+.
However, PerformanceObserver is supported in this browser combination so the support check currently passes.

What did you expect to see?

I expect the plugin to handle checking support for the entryTypes it observes via PerformanceObserver. For resource entries, this would look like typeof window.PerformanceResourceTiming === 'function' in addition to the PerformanceObserver check.

What did you see instead?

The support check passes and PerformanceObserver throws a TypeError.

Additional context

Some browsers are starting to support PerformanceObserver.supportedEntryTypes, but this is still experimental. So I think explicitly checking the entryType's interface is the safest option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant