@bugsnag/browser-performance
Advanced tools
Comparing version 2.8.0 to 2.8.1-alpha.0
@@ -0,1 +1,2 @@ | ||
import { traceIdToSamplingRate } from '@bugsnag/core-performance'; | ||
import { defaultNetworkRequestCallback } from '@bugsnag/request-tracker-performance'; | ||
@@ -83,2 +84,3 @@ | ||
extraRequestHeaders.traceparent = buildTraceparentHeader(traceId, parentSpanId, sampled); | ||
extraRequestHeaders.tracestate = buildTracestateHeader(traceId); | ||
} | ||
@@ -91,2 +93,3 @@ else if (this.spanContextStorage.current) { | ||
extraRequestHeaders.traceparent = buildTraceparentHeader(traceId, parentSpanId, sampled); | ||
extraRequestHeaders.tracestate = buildTracestateHeader(traceId); | ||
} | ||
@@ -99,3 +102,6 @@ return extraRequestHeaders; | ||
} | ||
function buildTracestateHeader(traceId) { | ||
return `sb=v:1;r:${traceIdToSamplingRate(traceId)}`; | ||
} | ||
export { NetworkRequestPlugin }; |
@@ -51,3 +51,6 @@ import { isObject, isString, coreSpanOptionSchema } from '@bugsnag/core-performance'; | ||
// create internal options for validation | ||
const routeChangeSpanOptions = Object.assign(Object.assign({}, options), { trigger }); | ||
const routeChangeSpanOptions = { | ||
...options, | ||
trigger | ||
}; | ||
const cleanOptions = this.spanFactory.validateSpanOptions('[RouteChange]', routeChangeSpanOptions, routeChangeSpanOptionSchema); | ||
@@ -54,0 +57,0 @@ const route = configuration.routingProvider.resolveRoute(absoluteUrl) || defaultRouteResolver(absoluteUrl); |
@@ -7,41 +7,56 @@ import { schema, isBoolean, isStringOrRegExpArray, isStringWithLength } from '@bugsnag/core-performance'; | ||
function createSchema(hostname, defaultRoutingProvider) { | ||
return Object.assign(Object.assign({}, schema), { releaseStage: Object.assign(Object.assign({}, schema.releaseStage), { defaultValue: hostname === 'localhost' ? 'development' : 'production' }), autoInstrumentFullPageLoads: { | ||
return { | ||
...schema, | ||
releaseStage: { | ||
...schema.releaseStage, | ||
defaultValue: hostname === 'localhost' ? 'development' : 'production' | ||
}, | ||
autoInstrumentFullPageLoads: { | ||
defaultValue: true, | ||
message: 'should be true|false', | ||
validate: isBoolean | ||
}, autoInstrumentNetworkRequests: { | ||
}, | ||
autoInstrumentNetworkRequests: { | ||
defaultValue: true, | ||
message: 'should be true|false', | ||
validate: isBoolean | ||
}, autoInstrumentRouteChanges: { | ||
}, | ||
autoInstrumentRouteChanges: { | ||
defaultValue: true, | ||
message: 'should be true|false', | ||
validate: isBoolean | ||
}, generateAnonymousId: { | ||
}, | ||
generateAnonymousId: { | ||
defaultValue: true, | ||
message: 'should be true|false', | ||
validate: isBoolean | ||
}, routingProvider: { | ||
}, | ||
routingProvider: { | ||
defaultValue: defaultRoutingProvider, | ||
message: 'should be a routing provider', | ||
validate: isRoutingProvider | ||
}, settleIgnoreUrls: { | ||
}, | ||
settleIgnoreUrls: { | ||
defaultValue: [], | ||
message: 'should be an array of string|RegExp', | ||
validate: isStringOrRegExpArray | ||
}, networkRequestCallback: { | ||
}, | ||
networkRequestCallback: { | ||
defaultValue: defaultNetworkRequestCallback, | ||
message: 'should be a function', | ||
validate: isNetworkRequestCallback | ||
}, sendPageAttributes: { | ||
}, | ||
sendPageAttributes: { | ||
defaultValue: defaultSendPageAttributes, | ||
message: 'should be an object', | ||
validate: isSendPageAttributes | ||
}, serviceName: { | ||
}, | ||
serviceName: { | ||
defaultValue: 'unknown_service', | ||
message: 'should be a string', | ||
validate: isStringWithLength | ||
} }); | ||
} | ||
}; | ||
} | ||
export { createSchema }; |
@@ -8,3 +8,3 @@ import cuid from '@bugsnag/cuid'; | ||
return function resourceAttributesSource(config) { | ||
const attributes = new ResourceAttributes(config.releaseStage, config.appVersion, config.serviceName, 'bugsnag.performance.browser', '2.8.0'); | ||
const attributes = new ResourceAttributes(config.releaseStage, config.appVersion, config.serviceName, 'bugsnag.performance.browser', '2.8.1-alpha.0'); | ||
attributes.set('browser.user_agent', navigator.userAgent); | ||
@@ -11,0 +11,0 @@ // chromium only |
@@ -9,3 +9,6 @@ import { isObject } from '@bugsnag/core-performance'; | ||
function getPermittedAttributes(sendPageAttributes) { | ||
return Object.assign(Object.assign({}, defaultSendPageAttributes), sendPageAttributes); | ||
return { | ||
...defaultSendPageAttributes, | ||
...sendPageAttributes | ||
}; | ||
} | ||
@@ -12,0 +15,0 @@ function isSendPageAttributes(obj) { |
{ | ||
"name": "@bugsnag/browser-performance", | ||
"version": "2.8.0", | ||
"version": "2.8.1-alpha.0", | ||
"description": "BugSnag performance monitoring for browsers", | ||
@@ -24,9 +24,9 @@ "homepage": "https://www.bugsnag.com/", | ||
"dependencies": { | ||
"@bugsnag/core-performance": "^2.8.0", | ||
"@bugsnag/core-performance": "^2.8.1-alpha.0", | ||
"@bugsnag/cuid": "^3.1.1", | ||
"@bugsnag/delivery-fetch-performance": "^2.8.0", | ||
"@bugsnag/request-tracker-performance": "^2.8.0" | ||
"@bugsnag/delivery-fetch-performance": "^2.8.1-alpha.0", | ||
"@bugsnag/request-tracker-performance": "^2.8.1-alpha.0" | ||
}, | ||
"devDependencies": { | ||
"@bugsnag/browser": "^7.25.0-alpha.0" | ||
"@bugsnag/browser": "8.0.0-alpha.13" | ||
}, | ||
@@ -39,3 +39,3 @@ "type": "module", | ||
], | ||
"gitHead": "39754ecb88063ec84edb031202820545950725de" | ||
"gitHead": "904470ce3230f19ce28f858efe5cf6b0f18cecf1" | ||
} |
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
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
84204
1434
1