@sentry/core
Advanced tools
@@ -5,3 +5,2 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); | ||
const envelope = require('./utils-hoist/envelope.js'); | ||
const object = require('./utils-hoist/object.js'); | ||
@@ -34,3 +33,3 @@ /** | ||
if (dynamicSamplingContext) { | ||
headers.trace = object.dropUndefinedKeys(dynamicSamplingContext) ; | ||
headers.trace = dynamicSamplingContext ; | ||
} | ||
@@ -37,0 +36,0 @@ |
@@ -8,3 +8,2 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); | ||
require('./utils-hoist/logger.js'); | ||
const object = require('./utils-hoist/object.js'); | ||
require('./utils-hoist/time.js'); | ||
@@ -120,8 +119,11 @@ require('./utils-hoist/syncpromise.js'); | ||
const traceContext = object.dropUndefinedKeys({ | ||
const traceContext = { | ||
trace_id: traceId, | ||
span_id: propagationSpanId || propagationContext.generateSpanId(), | ||
parent_span_id: parentSpanId, | ||
}); | ||
}; | ||
if (parentSpanId) { | ||
traceContext.parent_span_id = parentSpanId; | ||
} | ||
return traceContext; | ||
@@ -128,0 +130,0 @@ } |
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); | ||
const currentScopes = require('./currentScopes.js'); | ||
const object = require('./utils-hoist/object.js'); | ||
@@ -18,3 +17,3 @@ /** | ||
contexts: { | ||
feedback: object.dropUndefinedKeys({ | ||
feedback: { | ||
contact_email: email, | ||
@@ -26,3 +25,3 @@ name, | ||
associated_event_id: associatedEventId, | ||
}), | ||
}, | ||
}, | ||
@@ -29,0 +28,0 @@ type: 'feedback', |
@@ -20,2 +20,4 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); | ||
/* eslint-disable complexity */ | ||
/** | ||
@@ -55,4 +57,16 @@ * Create and track fetch request spans for usage in combination with `addFetchInstrumentationHandler`. | ||
const fullUrl = getFullURL(url$1); | ||
const parsedUrl = fullUrl ? url.parseUrl(fullUrl) : url.parseUrl(url$1); | ||
// Curious about `thismessage:/`? See: https://www.rfc-editor.org/rfc/rfc2557.html | ||
// > When the methods above do not yield an absolute URI, a base URL | ||
// > of "thismessage:/" MUST be employed. This base URL has been | ||
// > defined for the sole purpose of resolving relative references | ||
// > within a multipart/related structure when no other base URI is | ||
// > specified. | ||
// | ||
// We need to provide a base URL to `parseStringToURL` because the fetch API gives us a | ||
// relative URL sometimes. | ||
// | ||
// This is the only case where we need to provide a base URL to `parseStringToURL` | ||
// because the relative URL is not valid on its own. | ||
const parsedUrl = url$1.startsWith('/') ? url.parseStringToURL(url$1, 'thismessage:/') : url.parseStringToURL(url$1); | ||
const fullUrl = url$1.startsWith('/') ? undefined : parsedUrl?.href; | ||
@@ -69,8 +83,9 @@ const hasParent = !!spanUtils.getActiveSpan(); | ||
'http.method': method, | ||
'http.url': fullUrl, | ||
'server.address': parsedUrl?.host, | ||
'http.url': parsedUrl?.href, | ||
[semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: spanOrigin, | ||
[semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'http.client', | ||
...(parsedUrl?.search && { 'http.query': parsedUrl?.search }), | ||
...(parsedUrl?.hash && { 'http.fragment': parsedUrl?.hash }), | ||
...(fullUrl && { 'http.url': fullUrl }), | ||
...(fullUrl && parsedUrl?.host && { 'server.address': parsedUrl.host }), | ||
...(parsedUrl?.search && { 'http.query': parsedUrl.search }), | ||
...(parsedUrl?.hash && { 'http.fragment': parsedUrl.hash }), | ||
}, | ||
@@ -215,11 +230,2 @@ }) | ||
function getFullURL(url) { | ||
try { | ||
const parsed = new URL(url); | ||
return parsed.href; | ||
} catch { | ||
return undefined; | ||
} | ||
} | ||
function endSpan(span, handlerData) { | ||
@@ -226,0 +232,0 @@ if (handlerData.response) { |
@@ -152,2 +152,3 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); | ||
exports.SEMANTIC_ATTRIBUTE_URL_FULL = semanticAttributes.SEMANTIC_ATTRIBUTE_URL_FULL; | ||
exports.SEMANTIC_LINK_ATTRIBUTE_LINK_TYPE = semanticAttributes.SEMANTIC_LINK_ATTRIBUTE_LINK_TYPE; | ||
exports.createEventEnvelope = envelope.createEventEnvelope; | ||
@@ -256,2 +257,3 @@ exports.createSessionEnvelope = envelope.createSessionEnvelope; | ||
exports.captureFeedback = feedback.captureFeedback; | ||
exports._INTERNAL_captureLog = index$1._INTERNAL_captureLog; | ||
exports._INTERNAL_flushLogsBuffer = index$1._INTERNAL_flushLogsBuffer; | ||
@@ -258,0 +260,0 @@ exports.applyAggregateErrorsToEvent = aggregateErrors.applyAggregateErrorsToEvent; |
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); | ||
const client = require('../client.js'); | ||
const currentScopes = require('../currentScopes.js'); | ||
const debugBuild = require('../debug-build.js'); | ||
const constants = require('./constants.js'); | ||
require('../utils-hoist/debug-build.js'); | ||
require('../utils-hoist/logger.js'); | ||
const logger = require('../utils-hoist/logger.js'); | ||
require('../utils-hoist/time.js'); | ||
require('../utils-hoist/syncpromise.js'); | ||
require('../debug-build.js'); | ||
const spanOnScope = require('../utils/spanOnScope.js'); | ||
const envelope = require('./envelope.js'); | ||
const MAX_LOG_BUFFER_SIZE = 100; | ||
const CLIENT_TO_LOG_BUFFER_MAP = new WeakMap(); | ||
/** | ||
* Converts a log attribute to a serialized log attribute. | ||
* | ||
* @param key - The key of the log attribute. | ||
* @param value - The value of the log attribute. | ||
* @returns The serialized log attribute. | ||
*/ | ||
function logAttributeToSerializedLogAttribute(key, value) { | ||
switch (typeof value) { | ||
case 'number': | ||
return { | ||
key, | ||
value: { doubleValue: value }, | ||
}; | ||
case 'boolean': | ||
return { | ||
key, | ||
value: { boolValue: value }, | ||
}; | ||
case 'string': | ||
return { | ||
key, | ||
value: { stringValue: value }, | ||
}; | ||
default: { | ||
let stringValue = ''; | ||
try { | ||
stringValue = JSON.stringify(value) ?? ''; | ||
} catch (_) { | ||
// Do nothing | ||
} | ||
return { | ||
key, | ||
value: { stringValue }, | ||
}; | ||
} | ||
} | ||
} | ||
/** | ||
* Captures a log event and sends it to Sentry. | ||
* | ||
* @param log - The log event to capture. | ||
* @param scope - A scope. Uses the current scope if not provided. | ||
* @param client - A client. Uses the current client if not provided. | ||
* | ||
* @experimental This method will experience breaking changes. This is not yet part of | ||
* the stable Sentry SDK API and can be changed or removed without warning. | ||
*/ | ||
function _INTERNAL_captureLog(log, client$1 = currentScopes.getClient(), scope = currentScopes.getCurrentScope()) { | ||
if (!client$1) { | ||
debugBuild.DEBUG_BUILD && logger.logger.warn('No client available to capture log.'); | ||
return; | ||
} | ||
const { _experiments, release, environment } = client$1.getOptions(); | ||
if (!_experiments?.enableLogs) { | ||
debugBuild.DEBUG_BUILD && logger.logger.warn('logging option not enabled, log will not be captured.'); | ||
return; | ||
} | ||
const [, traceContext] = client._getTraceInfoFromScope(client$1, scope); | ||
const { level, message, attributes, severityNumber } = log; | ||
const logAttributes = { | ||
...attributes, | ||
}; | ||
if (release) { | ||
logAttributes.release = release; | ||
} | ||
if (environment) { | ||
logAttributes.environment = environment; | ||
} | ||
const span = spanOnScope._getSpanForScope(scope); | ||
if (span) { | ||
// Add the parent span ID to the log attributes for trace context | ||
logAttributes['sentry.trace.parent_span_id'] = span.spanContext().spanId; | ||
} | ||
const serializedLog = { | ||
severityText: level, | ||
body: { | ||
stringValue: message, | ||
}, | ||
attributes: Object.entries(logAttributes).map(([key, value]) => logAttributeToSerializedLogAttribute(key, value)), | ||
timeUnixNano: `${new Date().getTime().toString()}000000`, | ||
traceId: traceContext?.trace_id, | ||
severityNumber: severityNumber ?? constants.SEVERITY_TEXT_TO_SEVERITY_NUMBER[level], | ||
}; | ||
const logBuffer = CLIENT_TO_LOG_BUFFER_MAP.get(client$1); | ||
if (logBuffer === undefined) { | ||
CLIENT_TO_LOG_BUFFER_MAP.set(client$1, [serializedLog]); | ||
// Every time we initialize a new log buffer, we start a new interval to flush the buffer | ||
return; | ||
} | ||
logBuffer.push(serializedLog); | ||
if (logBuffer.length > MAX_LOG_BUFFER_SIZE) { | ||
_INTERNAL_flushLogsBuffer(client$1, logBuffer); | ||
} | ||
} | ||
/** | ||
* Flushes the logs buffer to Sentry. | ||
@@ -35,3 +148,5 @@ * | ||
exports._INTERNAL_captureLog = _INTERNAL_captureLog; | ||
exports._INTERNAL_flushLogsBuffer = _INTERNAL_flushLogsBuffer; | ||
exports.logAttributeToSerializedLogAttribute = logAttributeToSerializedLogAttribute; | ||
//# sourceMappingURL=index.js.map |
@@ -63,2 +63,14 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); | ||
/** | ||
* A span link attribute to mark the link as a special span link. | ||
* | ||
* Known values: | ||
* - `previous_trace`: The span links to the frontend root span of the previous trace. | ||
* - `next_trace`: The span links to the frontend root span of the next trace. (Not set by the SDK) | ||
* | ||
* Other values may be set as appropriate. | ||
* @see https://develop.sentry.dev/sdk/telemetry/traces/span-links/#link-types | ||
*/ | ||
const SEMANTIC_LINK_ATTRIBUTE_LINK_TYPE = 'sentry.link.type'; | ||
exports.SEMANTIC_ATTRIBUTE_CACHE_HIT = SEMANTIC_ATTRIBUTE_CACHE_HIT; | ||
@@ -79,2 +91,3 @@ exports.SEMANTIC_ATTRIBUTE_CACHE_ITEM_SIZE = SEMANTIC_ATTRIBUTE_CACHE_ITEM_SIZE; | ||
exports.SEMANTIC_ATTRIBUTE_URL_FULL = SEMANTIC_ATTRIBUTE_URL_FULL; | ||
exports.SEMANTIC_LINK_ATTRIBUTE_LINK_TYPE = SEMANTIC_LINK_ATTRIBUTE_LINK_TYPE; | ||
//# sourceMappingURL=semanticAttributes.js.map |
@@ -5,3 +5,2 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); | ||
require('./utils-hoist/logger.js'); | ||
const object = require('./utils-hoist/object.js'); | ||
const time = require('./utils-hoist/time.js'); | ||
@@ -147,3 +146,3 @@ const misc = require('./utils-hoist/misc.js'); | ||
function sessionToJSON(session) { | ||
return object.dropUndefinedKeys({ | ||
return { | ||
sid: `${session.sid}`, | ||
@@ -165,3 +164,3 @@ init: session.init, | ||
}, | ||
}); | ||
}; | ||
} | ||
@@ -168,0 +167,0 @@ |
@@ -337,5 +337,3 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); | ||
capturedSpanIsolationScope, | ||
...object.dropUndefinedKeys({ | ||
dynamicSamplingContext: dynamicSamplingContext.getDynamicSamplingContextFromSpan(this), | ||
}), | ||
dynamicSamplingContext: dynamicSamplingContext.getDynamicSamplingContextFromSpan(this), | ||
}, | ||
@@ -342,0 +340,0 @@ ...(source && { |
@@ -247,3 +247,3 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); | ||
...(dynamicSamplingContext && { | ||
trace: object.dropUndefinedKeys({ ...dynamicSamplingContext }), | ||
trace: dynamicSamplingContext, | ||
}), | ||
@@ -250,0 +250,0 @@ }; |
@@ -107,2 +107,21 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); | ||
// We enhance the not-so-helpful "Failed to fetch" error messages with the host | ||
// Possible messages we handle here: | ||
// * "Failed to fetch" (chromium) | ||
// * "Load failed" (webkit) | ||
// * "NetworkError when attempting to fetch resource." (firefox) | ||
if ( | ||
error instanceof TypeError && | ||
(error.message === 'Failed to fetch' || | ||
error.message === 'Load failed' || | ||
error.message === 'NetworkError when attempting to fetch resource.') | ||
) { | ||
try { | ||
const url = new URL(handlerData.fetchData.url); | ||
error.message = `${error.message} (${url.host})`; | ||
} catch { | ||
// ignore it if errors happen here | ||
} | ||
} | ||
// NOTE: If you are a Sentry user, and you are seeing this stack frame, | ||
@@ -109,0 +128,0 @@ // it means the sentry.javascript SDK caught an error invoking your application code. |
@@ -208,18 +208,22 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); | ||
function _dropUndefinedKeys(inputValue, memoizationMap) { | ||
if (isPojo(inputValue)) { | ||
// If this node has already been visited due to a circular reference, return the object it was mapped to in the new object | ||
const memoVal = memoizationMap.get(inputValue); | ||
if (memoVal !== undefined) { | ||
return memoVal ; | ||
} | ||
// Early return for primitive values | ||
if (inputValue === null || typeof inputValue !== 'object') { | ||
return inputValue; | ||
} | ||
const returnValue = {}; | ||
// Store the mapping of this value in case we visit it again, in case of circular data | ||
// Check memo map first for all object types | ||
const memoVal = memoizationMap.get(inputValue); | ||
if (memoVal !== undefined) { | ||
return memoVal ; | ||
} | ||
// handle arrays | ||
if (Array.isArray(inputValue)) { | ||
const returnValue = []; | ||
// Store mapping to handle circular references | ||
memoizationMap.set(inputValue, returnValue); | ||
for (const key of Object.getOwnPropertyNames(inputValue)) { | ||
if (typeof inputValue[key] !== 'undefined') { | ||
returnValue[key] = _dropUndefinedKeys(inputValue[key], memoizationMap); | ||
} | ||
} | ||
inputValue.forEach(value => { | ||
returnValue.push(_dropUndefinedKeys(value, memoizationMap)); | ||
}); | ||
@@ -229,15 +233,14 @@ return returnValue ; | ||
if (Array.isArray(inputValue)) { | ||
// If this node has already been visited due to a circular reference, return the array it was mapped to in the new object | ||
const memoVal = memoizationMap.get(inputValue); | ||
if (memoVal !== undefined) { | ||
return memoVal ; | ||
} | ||
const returnValue = []; | ||
// Store the mapping of this value in case we visit it again, in case of circular data | ||
if (isPojo(inputValue)) { | ||
const returnValue = {}; | ||
// Store mapping to handle circular references | ||
memoizationMap.set(inputValue, returnValue); | ||
inputValue.forEach((item) => { | ||
returnValue.push(_dropUndefinedKeys(item, memoizationMap)); | ||
const keys = Object.keys(inputValue); | ||
keys.forEach(key => { | ||
const val = inputValue[key]; | ||
if (val !== undefined) { | ||
returnValue[key] = _dropUndefinedKeys(val, memoizationMap); | ||
} | ||
}); | ||
@@ -248,2 +251,3 @@ | ||
// For other object types, return as is | ||
return inputValue; | ||
@@ -253,12 +257,5 @@ } | ||
function isPojo(input) { | ||
if (!is.isPlainObject(input)) { | ||
return false; | ||
} | ||
try { | ||
const name = (Object.getPrototypeOf(input) ).constructor.name; | ||
return !name || name === 'Object'; | ||
} catch { | ||
return true; | ||
} | ||
// Plain objects have Object as constructor or no constructor | ||
const constructor = (input ).constructor; | ||
return constructor === Object || constructor === undefined; | ||
} | ||
@@ -265,0 +262,0 @@ |
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); | ||
/** | ||
* Parses string to a URL object | ||
* | ||
* @param url - The URL to parse | ||
* @returns The parsed URL object or undefined if the URL is invalid | ||
*/ | ||
function parseStringToURL(url, base) { | ||
try { | ||
// Use `canParse` to short-circuit the URL constructor if it's not a valid URL | ||
// This is faster than trying to construct the URL and catching the error | ||
// Node 20+, Chrome 120+, Firefox 115+, Safari 17+ | ||
if ('canParse' in URL && !(URL ).canParse(url, base)) { | ||
return undefined; | ||
} | ||
return new URL(url, base); | ||
} catch { | ||
// empty body | ||
} | ||
return undefined; | ||
} | ||
/** | ||
* Parses string form of URL into an object | ||
@@ -64,4 +87,5 @@ * // borrowed from https://tools.ietf.org/html/rfc3986#appendix-B | ||
exports.getSanitizedUrlString = getSanitizedUrlString; | ||
exports.parseStringToURL = parseStringToURL; | ||
exports.parseUrl = parseUrl; | ||
exports.stripUrlQueryAndFragment = stripUrlQueryAndFragment; | ||
//# sourceMappingURL=url.js.map |
@@ -5,5 +5,5 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); | ||
const SDK_VERSION = "9.8.0" ; | ||
const SDK_VERSION = "9.9.0" ; | ||
exports.SDK_VERSION = SDK_VERSION; | ||
//# sourceMappingURL=version.js.map |
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); | ||
const dynamicSamplingContext = require('../tracing/dynamicSamplingContext.js'); | ||
const object = require('../utils-hoist/object.js'); | ||
const merge = require('./merge.js'); | ||
@@ -98,20 +97,16 @@ const spanUtils = require('./spanUtils.js'); | ||
const cleanedExtra = object.dropUndefinedKeys(extra); | ||
if (Object.keys(cleanedExtra).length) { | ||
event.extra = { ...cleanedExtra, ...event.extra }; | ||
if (Object.keys(extra).length) { | ||
event.extra = { ...extra, ...event.extra }; | ||
} | ||
const cleanedTags = object.dropUndefinedKeys(tags); | ||
if (Object.keys(cleanedTags).length) { | ||
event.tags = { ...cleanedTags, ...event.tags }; | ||
if (Object.keys(tags).length) { | ||
event.tags = { ...tags, ...event.tags }; | ||
} | ||
const cleanedUser = object.dropUndefinedKeys(user); | ||
if (Object.keys(cleanedUser).length) { | ||
event.user = { ...cleanedUser, ...event.user }; | ||
if (Object.keys(user).length) { | ||
event.user = { ...user, ...event.user }; | ||
} | ||
const cleanedContexts = object.dropUndefinedKeys(contexts); | ||
if (Object.keys(cleanedContexts).length) { | ||
event.contexts = { ...cleanedContexts, ...event.contexts }; | ||
if (Object.keys(contexts).length) { | ||
event.contexts = { ...contexts, ...event.contexts }; | ||
} | ||
@@ -118,0 +113,0 @@ |
import { dsnToString } from './utils-hoist/dsn.js'; | ||
import { createEnvelope } from './utils-hoist/envelope.js'; | ||
import { dropUndefinedKeys } from './utils-hoist/object.js'; | ||
@@ -31,3 +30,3 @@ /** | ||
if (dynamicSamplingContext) { | ||
headers.trace = dropUndefinedKeys(dynamicSamplingContext) ; | ||
headers.trace = dynamicSamplingContext ; | ||
} | ||
@@ -34,0 +33,0 @@ |
@@ -6,3 +6,2 @@ import { getAsyncContextStrategy } from './asyncContext/index.js'; | ||
import './utils-hoist/logger.js'; | ||
import { dropUndefinedKeys } from './utils-hoist/object.js'; | ||
import './utils-hoist/time.js'; | ||
@@ -118,8 +117,11 @@ import './utils-hoist/syncpromise.js'; | ||
const traceContext = dropUndefinedKeys({ | ||
const traceContext = { | ||
trace_id: traceId, | ||
span_id: propagationSpanId || generateSpanId(), | ||
parent_span_id: parentSpanId, | ||
}); | ||
}; | ||
if (parentSpanId) { | ||
traceContext.parent_span_id = parentSpanId; | ||
} | ||
return traceContext; | ||
@@ -126,0 +128,0 @@ } |
import { getCurrentScope, getClient } from './currentScopes.js'; | ||
import { dropUndefinedKeys } from './utils-hoist/object.js'; | ||
@@ -16,3 +15,3 @@ /** | ||
contexts: { | ||
feedback: dropUndefinedKeys({ | ||
feedback: { | ||
contact_email: email, | ||
@@ -24,3 +23,3 @@ name, | ||
associated_event_id: associatedEventId, | ||
}), | ||
}, | ||
}, | ||
@@ -27,0 +26,0 @@ type: 'feedback', |
@@ -15,5 +15,7 @@ import { getClient } from './currentScopes.js'; | ||
import { startInactiveSpan } from './tracing/trace.js'; | ||
import { parseUrl, stripUrlQueryAndFragment } from './utils-hoist/url.js'; | ||
import { parseStringToURL, stripUrlQueryAndFragment } from './utils-hoist/url.js'; | ||
import { getTraceData } from './utils/traceData.js'; | ||
/* eslint-disable complexity */ | ||
/** | ||
@@ -53,4 +55,16 @@ * Create and track fetch request spans for usage in combination with `addFetchInstrumentationHandler`. | ||
const fullUrl = getFullURL(url); | ||
const parsedUrl = fullUrl ? parseUrl(fullUrl) : parseUrl(url); | ||
// Curious about `thismessage:/`? See: https://www.rfc-editor.org/rfc/rfc2557.html | ||
// > When the methods above do not yield an absolute URI, a base URL | ||
// > of "thismessage:/" MUST be employed. This base URL has been | ||
// > defined for the sole purpose of resolving relative references | ||
// > within a multipart/related structure when no other base URI is | ||
// > specified. | ||
// | ||
// We need to provide a base URL to `parseStringToURL` because the fetch API gives us a | ||
// relative URL sometimes. | ||
// | ||
// This is the only case where we need to provide a base URL to `parseStringToURL` | ||
// because the relative URL is not valid on its own. | ||
const parsedUrl = url.startsWith('/') ? parseStringToURL(url, 'thismessage:/') : parseStringToURL(url); | ||
const fullUrl = url.startsWith('/') ? undefined : parsedUrl?.href; | ||
@@ -67,8 +81,9 @@ const hasParent = !!getActiveSpan(); | ||
'http.method': method, | ||
'http.url': fullUrl, | ||
'server.address': parsedUrl?.host, | ||
'http.url': parsedUrl?.href, | ||
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: spanOrigin, | ||
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'http.client', | ||
...(parsedUrl?.search && { 'http.query': parsedUrl?.search }), | ||
...(parsedUrl?.hash && { 'http.fragment': parsedUrl?.hash }), | ||
...(fullUrl && { 'http.url': fullUrl }), | ||
...(fullUrl && parsedUrl?.host && { 'server.address': parsedUrl.host }), | ||
...(parsedUrl?.search && { 'http.query': parsedUrl.search }), | ||
...(parsedUrl?.hash && { 'http.fragment': parsedUrl.hash }), | ||
}, | ||
@@ -213,11 +228,2 @@ }) | ||
function getFullURL(url) { | ||
try { | ||
const parsed = new URL(url); | ||
return parsed.href; | ||
} catch { | ||
return undefined; | ||
} | ||
} | ||
function endSpan(span, handlerData) { | ||
@@ -224,0 +230,0 @@ if (handlerData.response) { |
@@ -12,3 +12,3 @@ export { registerSpanErrorInstrumentation } from './tracing/errors.js'; | ||
export { logSpanEnd, logSpanStart } from './tracing/logSpans.js'; | ||
export { SEMANTIC_ATTRIBUTE_CACHE_HIT, SEMANTIC_ATTRIBUTE_CACHE_ITEM_SIZE, SEMANTIC_ATTRIBUTE_CACHE_KEY, SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME, SEMANTIC_ATTRIBUTE_HTTP_REQUEST_METHOD, SEMANTIC_ATTRIBUTE_PROFILE_ID, SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME, SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON, SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT, SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE, SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, SEMANTIC_ATTRIBUTE_URL_FULL } from './semanticAttributes.js'; | ||
export { SEMANTIC_ATTRIBUTE_CACHE_HIT, SEMANTIC_ATTRIBUTE_CACHE_ITEM_SIZE, SEMANTIC_ATTRIBUTE_CACHE_KEY, SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME, SEMANTIC_ATTRIBUTE_HTTP_REQUEST_METHOD, SEMANTIC_ATTRIBUTE_PROFILE_ID, SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME, SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON, SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT, SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE, SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, SEMANTIC_ATTRIBUTE_URL_FULL, SEMANTIC_LINK_ATTRIBUTE_LINK_TYPE } from './semanticAttributes.js'; | ||
export { createEventEnvelope, createSessionEnvelope, createSpanEnvelope } from './envelope.js'; | ||
@@ -62,3 +62,3 @@ export { addEventProcessor, captureCheckIn, captureEvent, captureException, captureMessage, captureSession, close, endSession, flush, isEnabled, isInitialized, lastEventId, setContext, setExtra, setExtras, setTag, setTags, setUser, startSession, withMonitor } from './exports.js'; | ||
export { captureFeedback } from './feedback.js'; | ||
export { _INTERNAL_flushLogsBuffer } from './logs/index.js'; | ||
export { _INTERNAL_captureLog, _INTERNAL_flushLogsBuffer } from './logs/index.js'; | ||
export { applyAggregateErrorsToEvent } from './utils-hoist/aggregate-errors.js'; | ||
@@ -65,0 +65,0 @@ export { getBreadcrumbLogLevelFromHttpStatusCode } from './utils-hoist/breadcrumb-log-level.js'; |
@@ -0,11 +1,124 @@ | ||
import { _getTraceInfoFromScope } from '../client.js'; | ||
import { getClient, getCurrentScope } from '../currentScopes.js'; | ||
import { DEBUG_BUILD } from '../debug-build.js'; | ||
import { SEVERITY_TEXT_TO_SEVERITY_NUMBER } from './constants.js'; | ||
import '../utils-hoist/debug-build.js'; | ||
import '../utils-hoist/logger.js'; | ||
import { logger } from '../utils-hoist/logger.js'; | ||
import '../utils-hoist/time.js'; | ||
import '../utils-hoist/syncpromise.js'; | ||
import '../debug-build.js'; | ||
import { _getSpanForScope } from '../utils/spanOnScope.js'; | ||
import { createOtelLogEnvelope } from './envelope.js'; | ||
const MAX_LOG_BUFFER_SIZE = 100; | ||
const CLIENT_TO_LOG_BUFFER_MAP = new WeakMap(); | ||
/** | ||
* Converts a log attribute to a serialized log attribute. | ||
* | ||
* @param key - The key of the log attribute. | ||
* @param value - The value of the log attribute. | ||
* @returns The serialized log attribute. | ||
*/ | ||
function logAttributeToSerializedLogAttribute(key, value) { | ||
switch (typeof value) { | ||
case 'number': | ||
return { | ||
key, | ||
value: { doubleValue: value }, | ||
}; | ||
case 'boolean': | ||
return { | ||
key, | ||
value: { boolValue: value }, | ||
}; | ||
case 'string': | ||
return { | ||
key, | ||
value: { stringValue: value }, | ||
}; | ||
default: { | ||
let stringValue = ''; | ||
try { | ||
stringValue = JSON.stringify(value) ?? ''; | ||
} catch (_) { | ||
// Do nothing | ||
} | ||
return { | ||
key, | ||
value: { stringValue }, | ||
}; | ||
} | ||
} | ||
} | ||
/** | ||
* Captures a log event and sends it to Sentry. | ||
* | ||
* @param log - The log event to capture. | ||
* @param scope - A scope. Uses the current scope if not provided. | ||
* @param client - A client. Uses the current client if not provided. | ||
* | ||
* @experimental This method will experience breaking changes. This is not yet part of | ||
* the stable Sentry SDK API and can be changed or removed without warning. | ||
*/ | ||
function _INTERNAL_captureLog(log, client = getClient(), scope = getCurrentScope()) { | ||
if (!client) { | ||
DEBUG_BUILD && logger.warn('No client available to capture log.'); | ||
return; | ||
} | ||
const { _experiments, release, environment } = client.getOptions(); | ||
if (!_experiments?.enableLogs) { | ||
DEBUG_BUILD && logger.warn('logging option not enabled, log will not be captured.'); | ||
return; | ||
} | ||
const [, traceContext] = _getTraceInfoFromScope(client, scope); | ||
const { level, message, attributes, severityNumber } = log; | ||
const logAttributes = { | ||
...attributes, | ||
}; | ||
if (release) { | ||
logAttributes.release = release; | ||
} | ||
if (environment) { | ||
logAttributes.environment = environment; | ||
} | ||
const span = _getSpanForScope(scope); | ||
if (span) { | ||
// Add the parent span ID to the log attributes for trace context | ||
logAttributes['sentry.trace.parent_span_id'] = span.spanContext().spanId; | ||
} | ||
const serializedLog = { | ||
severityText: level, | ||
body: { | ||
stringValue: message, | ||
}, | ||
attributes: Object.entries(logAttributes).map(([key, value]) => logAttributeToSerializedLogAttribute(key, value)), | ||
timeUnixNano: `${new Date().getTime().toString()}000000`, | ||
traceId: traceContext?.trace_id, | ||
severityNumber: severityNumber ?? SEVERITY_TEXT_TO_SEVERITY_NUMBER[level], | ||
}; | ||
const logBuffer = CLIENT_TO_LOG_BUFFER_MAP.get(client); | ||
if (logBuffer === undefined) { | ||
CLIENT_TO_LOG_BUFFER_MAP.set(client, [serializedLog]); | ||
// Every time we initialize a new log buffer, we start a new interval to flush the buffer | ||
return; | ||
} | ||
logBuffer.push(serializedLog); | ||
if (logBuffer.length > MAX_LOG_BUFFER_SIZE) { | ||
_INTERNAL_flushLogsBuffer(client, logBuffer); | ||
} | ||
} | ||
/** | ||
* Flushes the logs buffer to Sentry. | ||
@@ -33,3 +146,3 @@ * | ||
export { _INTERNAL_flushLogsBuffer }; | ||
export { _INTERNAL_captureLog, _INTERNAL_flushLogsBuffer, logAttributeToSerializedLogAttribute }; | ||
//# sourceMappingURL=index.js.map |
@@ -1,1 +0,1 @@ | ||
{"type":"module","version":"9.8.0","sideEffects":false} | ||
{"type":"module","version":"9.9.0","sideEffects":false} |
@@ -61,3 +61,15 @@ /** | ||
export { SEMANTIC_ATTRIBUTE_CACHE_HIT, SEMANTIC_ATTRIBUTE_CACHE_ITEM_SIZE, SEMANTIC_ATTRIBUTE_CACHE_KEY, SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME, SEMANTIC_ATTRIBUTE_HTTP_REQUEST_METHOD, SEMANTIC_ATTRIBUTE_PROFILE_ID, SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME, SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON, SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT, SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE, SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, SEMANTIC_ATTRIBUTE_URL_FULL }; | ||
/** | ||
* A span link attribute to mark the link as a special span link. | ||
* | ||
* Known values: | ||
* - `previous_trace`: The span links to the frontend root span of the previous trace. | ||
* - `next_trace`: The span links to the frontend root span of the next trace. (Not set by the SDK) | ||
* | ||
* Other values may be set as appropriate. | ||
* @see https://develop.sentry.dev/sdk/telemetry/traces/span-links/#link-types | ||
*/ | ||
const SEMANTIC_LINK_ATTRIBUTE_LINK_TYPE = 'sentry.link.type'; | ||
export { SEMANTIC_ATTRIBUTE_CACHE_HIT, SEMANTIC_ATTRIBUTE_CACHE_ITEM_SIZE, SEMANTIC_ATTRIBUTE_CACHE_KEY, SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME, SEMANTIC_ATTRIBUTE_HTTP_REQUEST_METHOD, SEMANTIC_ATTRIBUTE_PROFILE_ID, SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME, SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON, SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT, SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE, SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, SEMANTIC_ATTRIBUTE_URL_FULL, SEMANTIC_LINK_ATTRIBUTE_LINK_TYPE }; | ||
//# sourceMappingURL=semanticAttributes.js.map |
import './utils-hoist/debug-build.js'; | ||
import './utils-hoist/logger.js'; | ||
import { dropUndefinedKeys } from './utils-hoist/object.js'; | ||
import { timestampInSeconds } from './utils-hoist/time.js'; | ||
@@ -144,3 +143,3 @@ import { uuid4 } from './utils-hoist/misc.js'; | ||
function sessionToJSON(session) { | ||
return dropUndefinedKeys({ | ||
return { | ||
sid: `${session.sid}`, | ||
@@ -162,3 +161,3 @@ init: session.init, | ||
}, | ||
}); | ||
}; | ||
} | ||
@@ -165,0 +164,0 @@ |
@@ -335,5 +335,3 @@ import { getClient, getCurrentScope } from '../currentScopes.js'; | ||
capturedSpanIsolationScope, | ||
...dropUndefinedKeys({ | ||
dynamicSamplingContext: getDynamicSamplingContextFromSpan(this), | ||
}), | ||
dynamicSamplingContext: getDynamicSamplingContextFromSpan(this), | ||
}, | ||
@@ -340,0 +338,0 @@ ...(source && { |
@@ -245,3 +245,3 @@ import { getSentryCarrier } from '../carrier.js'; | ||
...(dynamicSamplingContext && { | ||
trace: dropUndefinedKeys({ ...dynamicSamplingContext }), | ||
trace: dynamicSamplingContext, | ||
}), | ||
@@ -248,0 +248,0 @@ }; |
@@ -105,2 +105,21 @@ import { isError } from '../is.js'; | ||
// We enhance the not-so-helpful "Failed to fetch" error messages with the host | ||
// Possible messages we handle here: | ||
// * "Failed to fetch" (chromium) | ||
// * "Load failed" (webkit) | ||
// * "NetworkError when attempting to fetch resource." (firefox) | ||
if ( | ||
error instanceof TypeError && | ||
(error.message === 'Failed to fetch' || | ||
error.message === 'Load failed' || | ||
error.message === 'NetworkError when attempting to fetch resource.') | ||
) { | ||
try { | ||
const url = new URL(handlerData.fetchData.url); | ||
error.message = `${error.message} (${url.host})`; | ||
} catch { | ||
// ignore it if errors happen here | ||
} | ||
} | ||
// NOTE: If you are a Sentry user, and you are seeing this stack frame, | ||
@@ -107,0 +126,0 @@ // it means the sentry.javascript SDK caught an error invoking your application code. |
import { htmlTreeAsString } from './browser.js'; | ||
import { DEBUG_BUILD } from './debug-build.js'; | ||
import { isError, isEvent, isInstanceOf, isPrimitive, isElement, isPlainObject } from './is.js'; | ||
import { isError, isEvent, isInstanceOf, isPrimitive, isElement } from './is.js'; | ||
import { logger } from './logger.js'; | ||
@@ -206,18 +206,22 @@ import { truncate } from './string.js'; | ||
function _dropUndefinedKeys(inputValue, memoizationMap) { | ||
if (isPojo(inputValue)) { | ||
// If this node has already been visited due to a circular reference, return the object it was mapped to in the new object | ||
const memoVal = memoizationMap.get(inputValue); | ||
if (memoVal !== undefined) { | ||
return memoVal ; | ||
} | ||
// Early return for primitive values | ||
if (inputValue === null || typeof inputValue !== 'object') { | ||
return inputValue; | ||
} | ||
const returnValue = {}; | ||
// Store the mapping of this value in case we visit it again, in case of circular data | ||
// Check memo map first for all object types | ||
const memoVal = memoizationMap.get(inputValue); | ||
if (memoVal !== undefined) { | ||
return memoVal ; | ||
} | ||
// handle arrays | ||
if (Array.isArray(inputValue)) { | ||
const returnValue = []; | ||
// Store mapping to handle circular references | ||
memoizationMap.set(inputValue, returnValue); | ||
for (const key of Object.getOwnPropertyNames(inputValue)) { | ||
if (typeof inputValue[key] !== 'undefined') { | ||
returnValue[key] = _dropUndefinedKeys(inputValue[key], memoizationMap); | ||
} | ||
} | ||
inputValue.forEach(value => { | ||
returnValue.push(_dropUndefinedKeys(value, memoizationMap)); | ||
}); | ||
@@ -227,15 +231,14 @@ return returnValue ; | ||
if (Array.isArray(inputValue)) { | ||
// If this node has already been visited due to a circular reference, return the array it was mapped to in the new object | ||
const memoVal = memoizationMap.get(inputValue); | ||
if (memoVal !== undefined) { | ||
return memoVal ; | ||
} | ||
const returnValue = []; | ||
// Store the mapping of this value in case we visit it again, in case of circular data | ||
if (isPojo(inputValue)) { | ||
const returnValue = {}; | ||
// Store mapping to handle circular references | ||
memoizationMap.set(inputValue, returnValue); | ||
inputValue.forEach((item) => { | ||
returnValue.push(_dropUndefinedKeys(item, memoizationMap)); | ||
const keys = Object.keys(inputValue); | ||
keys.forEach(key => { | ||
const val = inputValue[key]; | ||
if (val !== undefined) { | ||
returnValue[key] = _dropUndefinedKeys(val, memoizationMap); | ||
} | ||
}); | ||
@@ -246,2 +249,3 @@ | ||
// For other object types, return as is | ||
return inputValue; | ||
@@ -251,12 +255,5 @@ } | ||
function isPojo(input) { | ||
if (!isPlainObject(input)) { | ||
return false; | ||
} | ||
try { | ||
const name = (Object.getPrototypeOf(input) ).constructor.name; | ||
return !name || name === 'Object'; | ||
} catch { | ||
return true; | ||
} | ||
// Plain objects have Object as constructor or no constructor | ||
const constructor = (input ).constructor; | ||
return constructor === Object || constructor === undefined; | ||
} | ||
@@ -263,0 +260,0 @@ |
/** | ||
* Parses string to a URL object | ||
* | ||
* @param url - The URL to parse | ||
* @returns The parsed URL object or undefined if the URL is invalid | ||
*/ | ||
function parseStringToURL(url, base) { | ||
try { | ||
// Use `canParse` to short-circuit the URL constructor if it's not a valid URL | ||
// This is faster than trying to construct the URL and catching the error | ||
// Node 20+, Chrome 120+, Firefox 115+, Safari 17+ | ||
if ('canParse' in URL && !(URL ).canParse(url, base)) { | ||
return undefined; | ||
} | ||
return new URL(url, base); | ||
} catch { | ||
// empty body | ||
} | ||
return undefined; | ||
} | ||
/** | ||
* Parses string form of URL into an object | ||
@@ -61,3 +84,3 @@ * // borrowed from https://tools.ietf.org/html/rfc3986#appendix-B | ||
export { getSanitizedUrlString, parseUrl, stripUrlQueryAndFragment }; | ||
export { getSanitizedUrlString, parseStringToURL, parseUrl, stripUrlQueryAndFragment }; | ||
//# sourceMappingURL=url.js.map |
// This is a magic string replaced by rollup | ||
const SDK_VERSION = "9.8.0" ; | ||
const SDK_VERSION = "9.9.0" ; | ||
export { SDK_VERSION }; | ||
//# sourceMappingURL=version.js.map |
import { getDynamicSamplingContextFromSpan } from '../tracing/dynamicSamplingContext.js'; | ||
import { dropUndefinedKeys } from '../utils-hoist/object.js'; | ||
import { merge } from './merge.js'; | ||
@@ -96,20 +95,16 @@ import { spanToTraceContext, getRootSpan, spanToJSON } from './spanUtils.js'; | ||
const cleanedExtra = dropUndefinedKeys(extra); | ||
if (Object.keys(cleanedExtra).length) { | ||
event.extra = { ...cleanedExtra, ...event.extra }; | ||
if (Object.keys(extra).length) { | ||
event.extra = { ...extra, ...event.extra }; | ||
} | ||
const cleanedTags = dropUndefinedKeys(tags); | ||
if (Object.keys(cleanedTags).length) { | ||
event.tags = { ...cleanedTags, ...event.tags }; | ||
if (Object.keys(tags).length) { | ||
event.tags = { ...tags, ...event.tags }; | ||
} | ||
const cleanedUser = dropUndefinedKeys(user); | ||
if (Object.keys(cleanedUser).length) { | ||
event.user = { ...cleanedUser, ...event.user }; | ||
if (Object.keys(user).length) { | ||
event.user = { ...user, ...event.user }; | ||
} | ||
const cleanedContexts = dropUndefinedKeys(contexts); | ||
if (Object.keys(cleanedContexts).length) { | ||
event.contexts = { ...cleanedContexts, ...event.contexts }; | ||
if (Object.keys(contexts).length) { | ||
event.contexts = { ...contexts, ...event.contexts }; | ||
} | ||
@@ -116,0 +111,0 @@ |
@@ -61,3 +61,3 @@ export { ClientClass as SentryCoreCurrentScopes } from './sdk'; | ||
export { ReportDialogOptions } from './report-dialog'; | ||
export { _INTERNAL_flushLogsBuffer } from './logs'; | ||
export { _INTERNAL_captureLog, _INTERNAL_flushLogsBuffer } from './logs'; | ||
export * from './utils-hoist/index'; | ||
@@ -64,0 +64,0 @@ export * from './types-hoist/index'; |
@@ -22,3 +22,3 @@ import { Client } from '../client'; | ||
*/ | ||
export declare function captureLog(log: Log, scope?: import("..").Scope, client?: Client<import("../types-hoist").ClientOptions<import("../types-hoist").BaseTransportOptions>> | undefined): void; | ||
export declare function _INTERNAL_captureLog(log: Log, client?: Client<import("../types-hoist").ClientOptions<import("../types-hoist").BaseTransportOptions>> | undefined, scope?: import("..").Scope): void; | ||
/** | ||
@@ -25,0 +25,0 @@ * Flushes the logs buffer to Sentry. |
@@ -47,2 +47,13 @@ /** | ||
export declare const SEMANTIC_ATTRIBUTE_URL_FULL = "url.full"; | ||
/** | ||
* A span link attribute to mark the link as a special span link. | ||
* | ||
* Known values: | ||
* - `previous_trace`: The span links to the frontend root span of the previous trace. | ||
* - `next_trace`: The span links to the frontend root span of the next trace. (Not set by the SDK) | ||
* | ||
* Other values may be set as appropriate. | ||
* @see https://develop.sentry.dev/sdk/telemetry/traces/span-links/#link-types | ||
*/ | ||
export declare const SEMANTIC_LINK_ATTRIBUTE_LINK_TYPE = "sentry.link.type"; | ||
//# sourceMappingURL=semanticAttributes.d.ts.map |
@@ -10,2 +10,9 @@ type PartialURL = { | ||
/** | ||
* Parses string to a URL object | ||
* | ||
* @param url - The URL to parse | ||
* @returns The parsed URL object or undefined if the URL is invalid | ||
*/ | ||
export declare function parseStringToURL(url: string, base?: string | URL | undefined): URL | undefined; | ||
/** | ||
* Parses string form of URL into an object | ||
@@ -12,0 +19,0 @@ * // borrowed from https://tools.ietf.org/html/rfc3986#appendix-B |
@@ -61,3 +61,3 @@ export type { ClientClass as SentryCoreCurrentScopes } from './sdk'; | ||
export type { ReportDialogOptions } from './report-dialog'; | ||
export { _INTERNAL_flushLogsBuffer } from './logs'; | ||
export { _INTERNAL_captureLog, _INTERNAL_flushLogsBuffer } from './logs'; | ||
export * from './utils-hoist/index'; | ||
@@ -64,0 +64,0 @@ export * from './types-hoist/index'; |
@@ -22,3 +22,3 @@ import type { Client } from '../client'; | ||
*/ | ||
export declare function captureLog(log: Log, scope?: import("..").Scope, client?: Client<import("../types-hoist").ClientOptions<import("../types-hoist").BaseTransportOptions>> | undefined): void; | ||
export declare function _INTERNAL_captureLog(log: Log, client?: Client<import("../types-hoist").ClientOptions<import("../types-hoist").BaseTransportOptions>> | undefined, scope?: import("..").Scope): void; | ||
/** | ||
@@ -25,0 +25,0 @@ * Flushes the logs buffer to Sentry. |
@@ -47,2 +47,13 @@ /** | ||
export declare const SEMANTIC_ATTRIBUTE_URL_FULL = "url.full"; | ||
/** | ||
* A span link attribute to mark the link as a special span link. | ||
* | ||
* Known values: | ||
* - `previous_trace`: The span links to the frontend root span of the previous trace. | ||
* - `next_trace`: The span links to the frontend root span of the next trace. (Not set by the SDK) | ||
* | ||
* Other values may be set as appropriate. | ||
* @see https://develop.sentry.dev/sdk/telemetry/traces/span-links/#link-types | ||
*/ | ||
export declare const SEMANTIC_LINK_ATTRIBUTE_LINK_TYPE = "sentry.link.type"; | ||
//# sourceMappingURL=semanticAttributes.d.ts.map |
@@ -10,2 +10,9 @@ type PartialURL = { | ||
/** | ||
* Parses string to a URL object | ||
* | ||
* @param url - The URL to parse | ||
* @returns The parsed URL object or undefined if the URL is invalid | ||
*/ | ||
export declare function parseStringToURL(url: string, base?: string | URL | undefined): URL | undefined; | ||
/** | ||
* Parses string form of URL into an object | ||
@@ -12,0 +19,0 @@ * // borrowed from https://tools.ietf.org/html/rfc3986#appendix-B |
{ | ||
"name": "@sentry/core", | ||
"version": "9.8.0", | ||
"version": "9.9.0", | ||
"description": "Base implementation for all Sentry JavaScript SDKs", | ||
@@ -5,0 +5,0 @@ "repository": "git://github.com/getsentry/sentry-javascript.git", |
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
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
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
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
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
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
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
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
Sorry, the diff of this file is not supported yet
3184125
0.75%1002
0.4%37815
0.96%