@bugsnag/browser-performance
Advanced tools
Comparing version 0.0.2-alpha.3 to 0.0.2
@@ -29,3 +29,3 @@ class FullPageLoadPlugin { | ||
const startTime = 0; | ||
const span = this.spanFactory.startSpan(`[FullPageLoad]${route}`, startTime); | ||
const span = this.spanFactory.startSpan(`[FullPageLoad]${route}`, { startTime }); | ||
// Browser attributes | ||
@@ -32,0 +32,0 @@ span.setAttribute('bugsnag.span.category', 'full_page_load'); |
@@ -10,3 +10,3 @@ class NetworkRequestPlugin { | ||
return; | ||
const span = this.spanFactory.startSpan(`[HTTP]/${startContext.method.toUpperCase()}`, startContext.startTime); | ||
const span = this.spanFactory.startSpan(`[HTTP]/${startContext.method.toUpperCase()}`, { startTime: startContext.startTime }); | ||
span.setAttribute('bugsnag.span.category', 'network'); | ||
@@ -13,0 +13,0 @@ span.setAttribute('http.url', startContext.url); |
@@ -13,9 +13,9 @@ import { timeToNumber } from '@bugsnag/core-performance'; | ||
let previousRoute = configuration.routingProvider.resolveRoute(new URL(this.location.href)); | ||
configuration.routingProvider.listenForRouteChanges((newRoute, routeChangeTime) => { | ||
const startTime = timeToNumber(this.clock, routeChangeTime); | ||
const span = this.spanFactory.startSpan(`[RouteChange]${newRoute}`, startTime); | ||
configuration.routingProvider.listenForRouteChanges((route, trigger, options) => { | ||
const span = this.spanFactory.startSpan(`[RouteChange]${route}`, options); | ||
span.setAttribute('bugsnag.span.category', 'route_change'); | ||
span.setAttribute('bugsnag.browser.page.route', newRoute); | ||
span.setAttribute('bugsnag.browser.page.route', route); | ||
span.setAttribute('bugsnag.browser.page.previous_route', previousRoute); | ||
previousRoute = newRoute; | ||
span.setAttribute('bugsnag.browser.page.route_change.trigger', trigger); | ||
previousRoute = route; | ||
return { | ||
@@ -22,0 +22,0 @@ end: (endTime) => { |
@@ -13,3 +13,3 @@ import getAbsoluteUrl from './request-tracker/url-helpers.js'; | ||
const route = this.resolveRoute(url); | ||
const span = startRouteChangeSpan(route); | ||
const span = startRouteChangeSpan(route, 'popstate'); | ||
onSettle((endTime) => { | ||
@@ -26,3 +26,3 @@ span.end(endTime); | ||
const route = resolveRoute(absoluteURL); | ||
const span = startRouteChangeSpan(route); | ||
const span = startRouteChangeSpan(route, 'pushState'); | ||
onSettle((endTime) => { | ||
@@ -29,0 +29,0 @@ span.end(endTime); |
@@ -5,3 +5,3 @@ import { ResourceAttributes } from '@bugsnag/core-performance'; | ||
return function resourceAttributesSource(config) { | ||
const attributes = new ResourceAttributes(config.releaseStage, config.appVersion, 'bugsnag.performance.browser', '0.0.2-alpha.2'); | ||
const attributes = new ResourceAttributes(config.releaseStage, config.appVersion, 'bugsnag.performance.browser', '0.0.2-alpha.3'); | ||
attributes.set('browser.user_agent', navigator.userAgent); | ||
@@ -8,0 +8,0 @@ // chromium only |
@@ -1,7 +0,3 @@ | ||
import { type Clock, type InternalConfiguration, type Plugin, type Span, type SpanFactory, type Time } from '@bugsnag/core-performance'; | ||
import { type Clock, type InternalConfiguration, type Plugin, type SpanFactory } from '@bugsnag/core-performance'; | ||
import { type BrowserConfiguration } from '../config'; | ||
interface StartRouteOptions { | ||
startTime?: Time; | ||
} | ||
export type StartRouteChangeSpan = (route: string, options?: StartRouteOptions) => Span; | ||
export declare class RouteChangePlugin implements Plugin<BrowserConfiguration> { | ||
@@ -14,3 +10,2 @@ private readonly spanFactory; | ||
} | ||
export {}; | ||
//# sourceMappingURL=route-change-plugin.d.ts.map |
export { DefaultRoutingProvider, default, onSettle } from './browser'; | ||
export { type BrowserConfiguration } from './config'; | ||
export { type RouteResolver, type RoutingProvider } from './routing-provider'; | ||
export { type SpanOptions, type Time } from '@bugsnag/core-performance'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -1,3 +0,3 @@ | ||
import { type Span, type Time } from '@bugsnag/core-performance'; | ||
export type StartRouteChangeCallback = (newRoute: string, routeChangeTime?: Time) => Span; | ||
import { type Span, type SpanOptions } from '@bugsnag/core-performance'; | ||
export type StartRouteChangeCallback = (route: string, trigger: string, options?: SpanOptions) => Span; | ||
export interface RoutingProvider { | ||
@@ -4,0 +4,0 @@ resolveRoute: (url: URL) => string; |
{ | ||
"name": "@bugsnag/browser-performance", | ||
"version": "0.0.2-alpha.3", | ||
"version": "0.0.2", | ||
"description": "BugSnag performance monitoring for browsers", | ||
@@ -22,3 +22,3 @@ "homepage": "https://www.bugsnag.com/", | ||
"dependencies": { | ||
"@bugsnag/core-performance": "^0.0.2-alpha.3" | ||
"@bugsnag/core-performance": "^0.0.2" | ||
}, | ||
@@ -31,3 +31,3 @@ "type": "module", | ||
], | ||
"gitHead": "27db39a417a02d300bbc2ff8226f22d37a2b3d70" | ||
"gitHead": "339a055dca4f3fcc17d9d6b4d2a73434495228d5" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
65144
1057