@sentry/opentelemetry 8.0.0-alpha.1 → 8.0.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/cjs/index.js +2120 -55
- package/cjs/index.js.map +1 -1
- package/esm/index.js +2091 -22
- package/esm/index.js.map +1 -1
- package/esm/package.json +1 -0
- package/package.json +18 -5
- package/types/asyncContextStrategy.d.ts.map +1 -1
- package/types/constants.d.ts +3 -5
- package/types/constants.d.ts.map +1 -1
- package/types/contextManager.d.ts.map +1 -1
- package/types/custom/getCurrentHub.d.ts.map +1 -1
- package/types/index.d.ts +6 -7
- package/types/index.d.ts.map +1 -1
- package/types/propagator.d.ts +26 -2
- package/types/propagator.d.ts.map +1 -1
- package/types/sampler.d.ts.map +1 -1
- package/types/semanticAttributes.d.ts +2 -7
- package/types/semanticAttributes.d.ts.map +1 -1
- package/types/setupEventContextTrace.d.ts.map +1 -1
- package/types/spanExporter.d.ts.map +1 -1
- package/types/spanProcessor.d.ts.map +1 -1
- package/types/trace.d.ts +14 -1
- package/types/trace.d.ts.map +1 -1
- package/types/types.d.ts +3 -4
- package/types/types.d.ts.map +1 -1
- package/types/utils/captureExceptionForTimedEvent.d.ts +1 -2
- package/types/utils/captureExceptionForTimedEvent.d.ts.map +1 -1
- package/types/utils/contextData.d.ts +1 -21
- package/types/utils/contextData.d.ts.map +1 -1
- package/types/utils/dynamicSamplingContext.d.ts.map +1 -1
- package/types/utils/getActiveSpan.d.ts +0 -5
- package/types/utils/getActiveSpan.d.ts.map +1 -1
- package/types/utils/groupSpansWithParents.d.ts.map +1 -1
- package/types/utils/mapStatus.d.ts +2 -2
- package/types/utils/mapStatus.d.ts.map +1 -1
- package/types/utils/setupCheck.d.ts +9 -0
- package/types/utils/setupCheck.d.ts.map +1 -0
- package/types/utils/spanData.d.ts +1 -14
- package/types/utils/spanData.d.ts.map +1 -1
- package/types-ts3.8/constants.d.ts +3 -5
- package/types-ts3.8/index.d.ts +6 -7
- package/types-ts3.8/propagator.d.ts +26 -2
- package/types-ts3.8/semanticAttributes.d.ts +2 -7
- package/types-ts3.8/trace.d.ts +14 -1
- package/types-ts3.8/types.d.ts +3 -4
- package/types-ts3.8/utils/captureExceptionForTimedEvent.d.ts +1 -2
- package/types-ts3.8/utils/contextData.d.ts +1 -21
- package/types-ts3.8/utils/getActiveSpan.d.ts +0 -5
- package/types-ts3.8/utils/mapStatus.d.ts +2 -2
- package/types-ts3.8/utils/setupCheck.d.ts +9 -0
- package/types-ts3.8/utils/spanData.d.ts +1 -14
- package/cjs/asyncContextStrategy.js +0 -114
- package/cjs/asyncContextStrategy.js.map +0 -1
- package/cjs/constants.js +0 -32
- package/cjs/constants.js.map +0 -1
- package/cjs/contextManager.js +0 -82
- package/cjs/contextManager.js.map +0 -1
- package/cjs/custom/client.js +0 -64
- package/cjs/custom/client.js.map +0 -1
- package/cjs/custom/getCurrentHub.js +0 -106
- package/cjs/custom/getCurrentHub.js.map +0 -1
- package/cjs/custom/hub.js +0 -13
- package/cjs/custom/hub.js.map +0 -1
- package/cjs/custom/hubextensions.js +0 -37
- package/cjs/custom/hubextensions.js.map +0 -1
- package/cjs/custom/transaction.js +0 -26
- package/cjs/custom/transaction.js.map +0 -1
- package/cjs/debug-build.js +0 -11
- package/cjs/debug-build.js.map +0 -1
- package/cjs/propagator.js +0 -159
- package/cjs/propagator.js.map +0 -1
- package/cjs/sampler.js +0 -186
- package/cjs/sampler.js.map +0 -1
- package/cjs/semanticAttributes.js +0 -12
- package/cjs/semanticAttributes.js.map +0 -1
- package/cjs/setupEventContextTrace.js +0 -40
- package/cjs/setupEventContextTrace.js.map +0 -1
- package/cjs/spanExporter.js +0 -314
- package/cjs/spanExporter.js.map +0 -1
- package/cjs/spanProcessor.js +0 -95
- package/cjs/spanProcessor.js.map +0 -1
- package/cjs/trace.js +0 -222
- package/cjs/trace.js.map +0 -1
- package/cjs/utils/addOriginToSpan.js +0 -11
- package/cjs/utils/addOriginToSpan.js.map +0 -1
- package/cjs/utils/captureExceptionForTimedEvent.js +0 -59
- package/cjs/utils/captureExceptionForTimedEvent.js.map +0 -1
- package/cjs/utils/contextData.js +0 -79
- package/cjs/utils/contextData.js.map +0 -1
- package/cjs/utils/convertOtelTimeToSeconds.js +0 -9
- package/cjs/utils/convertOtelTimeToSeconds.js.map +0 -1
- package/cjs/utils/dynamicSamplingContext.js +0 -64
- package/cjs/utils/dynamicSamplingContext.js.map +0 -1
- package/cjs/utils/getActiveSpan.js +0 -29
- package/cjs/utils/getActiveSpan.js.map +0 -1
- package/cjs/utils/getRequestSpanData.js +0 -48
- package/cjs/utils/getRequestSpanData.js.map +0 -1
- package/cjs/utils/getSpanKind.js +0 -21
- package/cjs/utils/getSpanKind.js.map +0 -1
- package/cjs/utils/groupSpansWithParents.js +0 -74
- package/cjs/utils/groupSpansWithParents.js.map +0 -1
- package/cjs/utils/isSentryRequest.js +0 -29
- package/cjs/utils/isSentryRequest.js.map +0 -1
- package/cjs/utils/mapStatus.js +0 -76
- package/cjs/utils/mapStatus.js.map +0 -1
- package/cjs/utils/parseSpanDescription.js +0 -158
- package/cjs/utils/parseSpanDescription.js.map +0 -1
- package/cjs/utils/spanData.js +0 -72
- package/cjs/utils/spanData.js.map +0 -1
- package/cjs/utils/spanTypes.js +0 -77
- package/cjs/utils/spanTypes.js.map +0 -1
- package/esm/asyncContextStrategy.js +0 -112
- package/esm/asyncContextStrategy.js.map +0 -1
- package/esm/constants.js +0 -22
- package/esm/constants.js.map +0 -1
- package/esm/contextManager.js +0 -77
- package/esm/contextManager.js.map +0 -1
- package/esm/custom/client.js +0 -59
- package/esm/custom/client.js.map +0 -1
- package/esm/custom/getCurrentHub.js +0 -101
- package/esm/custom/getCurrentHub.js.map +0 -1
- package/esm/custom/hub.js +0 -11
- package/esm/custom/hub.js.map +0 -1
- package/esm/custom/hubextensions.js +0 -35
- package/esm/custom/hubextensions.js.map +0 -1
- package/esm/custom/transaction.js +0 -24
- package/esm/custom/transaction.js.map +0 -1
- package/esm/debug-build.js +0 -9
- package/esm/debug-build.js.map +0 -1
- package/esm/propagator.js +0 -154
- package/esm/propagator.js.map +0 -1
- package/esm/sampler.js +0 -184
- package/esm/sampler.js.map +0 -1
- package/esm/semanticAttributes.js +0 -10
- package/esm/semanticAttributes.js.map +0 -1
- package/esm/setupEventContextTrace.js +0 -38
- package/esm/setupEventContextTrace.js.map +0 -1
- package/esm/spanExporter.js +0 -312
- package/esm/spanExporter.js.map +0 -1
- package/esm/spanProcessor.js +0 -93
- package/esm/spanProcessor.js.map +0 -1
- package/esm/trace.js +0 -217
- package/esm/trace.js.map +0 -1
- package/esm/utils/addOriginToSpan.js +0 -9
- package/esm/utils/addOriginToSpan.js.map +0 -1
- package/esm/utils/captureExceptionForTimedEvent.js +0 -57
- package/esm/utils/captureExceptionForTimedEvent.js.map +0 -1
- package/esm/utils/contextData.js +0 -70
- package/esm/utils/contextData.js.map +0 -1
- package/esm/utils/convertOtelTimeToSeconds.js +0 -7
- package/esm/utils/convertOtelTimeToSeconds.js.map +0 -1
- package/esm/utils/dynamicSamplingContext.js +0 -59
- package/esm/utils/dynamicSamplingContext.js.map +0 -1
- package/esm/utils/getActiveSpan.js +0 -26
- package/esm/utils/getActiveSpan.js.map +0 -1
- package/esm/utils/getRequestSpanData.js +0 -46
- package/esm/utils/getRequestSpanData.js.map +0 -1
- package/esm/utils/getSpanKind.js +0 -19
- package/esm/utils/getSpanKind.js.map +0 -1
- package/esm/utils/groupSpansWithParents.js +0 -72
- package/esm/utils/groupSpansWithParents.js.map +0 -1
- package/esm/utils/isSentryRequest.js +0 -27
- package/esm/utils/isSentryRequest.js.map +0 -1
- package/esm/utils/mapStatus.js +0 -74
- package/esm/utils/mapStatus.js.map +0 -1
- package/esm/utils/parseSpanDescription.js +0 -154
- package/esm/utils/parseSpanDescription.js.map +0 -1
- package/esm/utils/spanData.js +0 -63
- package/esm/utils/spanData.js.map +0 -1
- package/esm/utils/spanTypes.js +0 -70
- package/esm/utils/spanTypes.js.map +0 -1
- package/types/custom/hubextensions.d.ts +0 -5
- package/types/custom/hubextensions.d.ts.map +0 -1
- package/types/custom/transaction.d.ts +0 -8
- package/types/custom/transaction.d.ts.map +0 -1
- package/types-ts3.8/custom/hubextensions.d.ts +0 -5
- package/types-ts3.8/custom/transaction.d.ts +0 -8
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
import { SpanKind } from '@opentelemetry/api';
|
|
2
|
-
import { SemanticAttributes } from '@opentelemetry/semantic-conventions';
|
|
3
|
-
import { parseUrl, getSanitizedUrlString, stripUrlQueryAndFragment } from '@sentry/utils';
|
|
4
|
-
import { getSpanKind } from './getSpanKind.js';
|
|
5
|
-
import { spanHasAttributes, spanHasName } from './spanTypes.js';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Extract better op/description from an otel span.
|
|
9
|
-
*
|
|
10
|
-
* Based on https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/7422ce2a06337f68a59b552b8c5a2ac125d6bae5/exporter/sentryexporter/sentry_exporter.go#L306
|
|
11
|
-
*/
|
|
12
|
-
function parseSpanDescription(span) {
|
|
13
|
-
const attributes = spanHasAttributes(span) ? span.attributes : {};
|
|
14
|
-
const name = spanHasName(span) ? span.name : '<unknown>';
|
|
15
|
-
|
|
16
|
-
// if http.method exists, this is an http request span
|
|
17
|
-
const httpMethod = attributes[SemanticAttributes.HTTP_METHOD];
|
|
18
|
-
if (httpMethod) {
|
|
19
|
-
return descriptionForHttpMethod({ attributes, name, kind: getSpanKind(span) }, httpMethod);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
// If db.type exists then this is a database call span.
|
|
23
|
-
const dbSystem = attributes[SemanticAttributes.DB_SYSTEM];
|
|
24
|
-
if (dbSystem) {
|
|
25
|
-
return descriptionForDbSystem({ attributes, name });
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
// If rpc.service exists then this is a rpc call span.
|
|
29
|
-
const rpcService = attributes[SemanticAttributes.RPC_SERVICE];
|
|
30
|
-
if (rpcService) {
|
|
31
|
-
return {
|
|
32
|
-
op: 'rpc',
|
|
33
|
-
description: name,
|
|
34
|
-
source: 'route',
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
// If messaging.system exists then this is a messaging system span.
|
|
39
|
-
const messagingSystem = attributes[SemanticAttributes.MESSAGING_SYSTEM];
|
|
40
|
-
if (messagingSystem) {
|
|
41
|
-
return {
|
|
42
|
-
op: 'message',
|
|
43
|
-
description: name,
|
|
44
|
-
source: 'route',
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
// If faas.trigger exists then this is a function as a service span.
|
|
49
|
-
const faasTrigger = attributes[SemanticAttributes.FAAS_TRIGGER];
|
|
50
|
-
if (faasTrigger) {
|
|
51
|
-
return { op: faasTrigger.toString(), description: name, source: 'route' };
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
return { op: undefined, description: name, source: 'custom' };
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
function descriptionForDbSystem({ attributes, name }) {
|
|
58
|
-
// Use DB statement (Ex "SELECT * FROM table") if possible as description.
|
|
59
|
-
const statement = attributes[SemanticAttributes.DB_STATEMENT];
|
|
60
|
-
|
|
61
|
-
const description = statement ? statement.toString() : name;
|
|
62
|
-
|
|
63
|
-
return { op: 'db', description, source: 'task' };
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
/** Only exported for tests. */
|
|
67
|
-
function descriptionForHttpMethod(
|
|
68
|
-
{ name, kind, attributes },
|
|
69
|
-
httpMethod,
|
|
70
|
-
) {
|
|
71
|
-
const opParts = ['http'];
|
|
72
|
-
|
|
73
|
-
switch (kind) {
|
|
74
|
-
case SpanKind.CLIENT:
|
|
75
|
-
opParts.push('client');
|
|
76
|
-
break;
|
|
77
|
-
case SpanKind.SERVER:
|
|
78
|
-
opParts.push('server');
|
|
79
|
-
break;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
const { urlPath, url, query, fragment, hasRoute } = getSanitizedUrl(attributes, kind);
|
|
83
|
-
|
|
84
|
-
if (!urlPath) {
|
|
85
|
-
return { op: opParts.join('.'), description: name, source: 'custom' };
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
// Ex. description="GET /api/users".
|
|
89
|
-
const description = `${httpMethod} ${urlPath}`;
|
|
90
|
-
|
|
91
|
-
// If `httpPath` is a root path, then we can categorize the transaction source as route.
|
|
92
|
-
const source = hasRoute || urlPath === '/' ? 'route' : 'url';
|
|
93
|
-
|
|
94
|
-
const data = {};
|
|
95
|
-
|
|
96
|
-
if (url) {
|
|
97
|
-
data.url = url;
|
|
98
|
-
}
|
|
99
|
-
if (query) {
|
|
100
|
-
data['http.query'] = query;
|
|
101
|
-
}
|
|
102
|
-
if (fragment) {
|
|
103
|
-
data['http.fragment'] = fragment;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
return {
|
|
107
|
-
op: opParts.join('.'),
|
|
108
|
-
description,
|
|
109
|
-
source,
|
|
110
|
-
data,
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
/** Exported for tests only */
|
|
115
|
-
function getSanitizedUrl(
|
|
116
|
-
attributes,
|
|
117
|
-
kind,
|
|
118
|
-
)
|
|
119
|
-
|
|
120
|
-
{
|
|
121
|
-
// This is the relative path of the URL, e.g. /sub
|
|
122
|
-
const httpTarget = attributes[SemanticAttributes.HTTP_TARGET];
|
|
123
|
-
// This is the full URL, including host & query params etc., e.g. https://example.com/sub?foo=bar
|
|
124
|
-
const httpUrl = attributes[SemanticAttributes.HTTP_URL];
|
|
125
|
-
// This is the normalized route name - may not always be available!
|
|
126
|
-
const httpRoute = attributes[SemanticAttributes.HTTP_ROUTE];
|
|
127
|
-
|
|
128
|
-
const parsedUrl = typeof httpUrl === 'string' ? parseUrl(httpUrl) : undefined;
|
|
129
|
-
const url = parsedUrl ? getSanitizedUrlString(parsedUrl) : undefined;
|
|
130
|
-
const query = parsedUrl && parsedUrl.search ? parsedUrl.search : undefined;
|
|
131
|
-
const fragment = parsedUrl && parsedUrl.hash ? parsedUrl.hash : undefined;
|
|
132
|
-
|
|
133
|
-
if (typeof httpRoute === 'string') {
|
|
134
|
-
return { urlPath: httpRoute, url, query, fragment, hasRoute: true };
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
if (kind === SpanKind.SERVER && typeof httpTarget === 'string') {
|
|
138
|
-
return { urlPath: stripUrlQueryAndFragment(httpTarget), url, query, fragment, hasRoute: false };
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
if (parsedUrl) {
|
|
142
|
-
return { urlPath: url, url, query, fragment, hasRoute: false };
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
// fall back to target even for client spans, if no URL is present
|
|
146
|
-
if (typeof httpTarget === 'string') {
|
|
147
|
-
return { urlPath: stripUrlQueryAndFragment(httpTarget), url, query, fragment, hasRoute: false };
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
return { urlPath: undefined, url, query, fragment, hasRoute: false };
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
export { descriptionForHttpMethod, getSanitizedUrl, parseSpanDescription };
|
|
154
|
-
//# sourceMappingURL=parseSpanDescription.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parseSpanDescription.js","sources":["../../../src/utils/parseSpanDescription.ts"],"sourcesContent":["import type { AttributeValue, Attributes } from '@opentelemetry/api';\nimport { SpanKind } from '@opentelemetry/api';\nimport { SemanticAttributes } from '@opentelemetry/semantic-conventions';\nimport type { TransactionSource } from '@sentry/types';\nimport { getSanitizedUrlString, parseUrl, stripUrlQueryAndFragment } from '@sentry/utils';\n\nimport type { AbstractSpan } from '../types';\nimport { getSpanKind } from './getSpanKind';\nimport { spanHasAttributes, spanHasName } from './spanTypes';\n\ninterface SpanDescription {\n op: string | undefined;\n description: string;\n source: TransactionSource;\n data?: Record<string, string>;\n}\n\n/**\n * Extract better op/description from an otel span.\n *\n * Based on https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/7422ce2a06337f68a59b552b8c5a2ac125d6bae5/exporter/sentryexporter/sentry_exporter.go#L306\n */\nexport function parseSpanDescription(span: AbstractSpan): SpanDescription {\n const attributes = spanHasAttributes(span) ? span.attributes : {};\n const name = spanHasName(span) ? span.name : '<unknown>';\n\n // if http.method exists, this is an http request span\n const httpMethod = attributes[SemanticAttributes.HTTP_METHOD];\n if (httpMethod) {\n return descriptionForHttpMethod({ attributes, name, kind: getSpanKind(span) }, httpMethod);\n }\n\n // If db.type exists then this is a database call span.\n const dbSystem = attributes[SemanticAttributes.DB_SYSTEM];\n if (dbSystem) {\n return descriptionForDbSystem({ attributes, name });\n }\n\n // If rpc.service exists then this is a rpc call span.\n const rpcService = attributes[SemanticAttributes.RPC_SERVICE];\n if (rpcService) {\n return {\n op: 'rpc',\n description: name,\n source: 'route',\n };\n }\n\n // If messaging.system exists then this is a messaging system span.\n const messagingSystem = attributes[SemanticAttributes.MESSAGING_SYSTEM];\n if (messagingSystem) {\n return {\n op: 'message',\n description: name,\n source: 'route',\n };\n }\n\n // If faas.trigger exists then this is a function as a service span.\n const faasTrigger = attributes[SemanticAttributes.FAAS_TRIGGER];\n if (faasTrigger) {\n return { op: faasTrigger.toString(), description: name, source: 'route' };\n }\n\n return { op: undefined, description: name, source: 'custom' };\n}\n\nfunction descriptionForDbSystem({ attributes, name }: { attributes: Attributes; name: string }): SpanDescription {\n // Use DB statement (Ex \"SELECT * FROM table\") if possible as description.\n const statement = attributes[SemanticAttributes.DB_STATEMENT];\n\n const description = statement ? statement.toString() : name;\n\n return { op: 'db', description, source: 'task' };\n}\n\n/** Only exported for tests. */\nexport function descriptionForHttpMethod(\n { name, kind, attributes }: { name: string; attributes: Attributes; kind: SpanKind },\n httpMethod: AttributeValue,\n): SpanDescription {\n const opParts = ['http'];\n\n switch (kind) {\n case SpanKind.CLIENT:\n opParts.push('client');\n break;\n case SpanKind.SERVER:\n opParts.push('server');\n break;\n }\n\n const { urlPath, url, query, fragment, hasRoute } = getSanitizedUrl(attributes, kind);\n\n if (!urlPath) {\n return { op: opParts.join('.'), description: name, source: 'custom' };\n }\n\n // Ex. description=\"GET /api/users\".\n const description = `${httpMethod} ${urlPath}`;\n\n // If `httpPath` is a root path, then we can categorize the transaction source as route.\n const source: TransactionSource = hasRoute || urlPath === '/' ? 'route' : 'url';\n\n const data: Record<string, string> = {};\n\n if (url) {\n data.url = url;\n }\n if (query) {\n data['http.query'] = query;\n }\n if (fragment) {\n data['http.fragment'] = fragment;\n }\n\n return {\n op: opParts.join('.'),\n description,\n source,\n data,\n };\n}\n\n/** Exported for tests only */\nexport function getSanitizedUrl(\n attributes: Attributes,\n kind: SpanKind,\n): {\n url: string | undefined;\n urlPath: string | undefined;\n query: string | undefined;\n fragment: string | undefined;\n hasRoute: boolean;\n} {\n // This is the relative path of the URL, e.g. /sub\n const httpTarget = attributes[SemanticAttributes.HTTP_TARGET];\n // This is the full URL, including host & query params etc., e.g. https://example.com/sub?foo=bar\n const httpUrl = attributes[SemanticAttributes.HTTP_URL];\n // This is the normalized route name - may not always be available!\n const httpRoute = attributes[SemanticAttributes.HTTP_ROUTE];\n\n const parsedUrl = typeof httpUrl === 'string' ? parseUrl(httpUrl) : undefined;\n const url = parsedUrl ? getSanitizedUrlString(parsedUrl) : undefined;\n const query = parsedUrl && parsedUrl.search ? parsedUrl.search : undefined;\n const fragment = parsedUrl && parsedUrl.hash ? parsedUrl.hash : undefined;\n\n if (typeof httpRoute === 'string') {\n return { urlPath: httpRoute, url, query, fragment, hasRoute: true };\n }\n\n if (kind === SpanKind.SERVER && typeof httpTarget === 'string') {\n return { urlPath: stripUrlQueryAndFragment(httpTarget), url, query, fragment, hasRoute: false };\n }\n\n if (parsedUrl) {\n return { urlPath: url, url, query, fragment, hasRoute: false };\n }\n\n // fall back to target even for client spans, if no URL is present\n if (typeof httpTarget === 'string') {\n return { urlPath: stripUrlQueryAndFragment(httpTarget), url, query, fragment, hasRoute: false };\n }\n\n return { urlPath: undefined, url, query, fragment, hasRoute: false };\n}\n"],"names":[],"mappings":";;;;;;AAiBA;AACA;AACA;AACA;AACA;AACO,SAAS,oBAAoB,CAAC,IAAI,EAAiC;AAC1E,EAAE,MAAM,UAAA,GAAa,iBAAiB,CAAC,IAAI,CAAE,GAAE,IAAI,CAAC,UAAW,GAAE,EAAE,CAAA;AACnE,EAAE,MAAM,IAAA,GAAO,WAAW,CAAC,IAAI,CAAE,GAAE,IAAI,CAAC,IAAK,GAAE,WAAW,CAAA;AAC1D;AACA;AACA,EAAE,MAAM,aAAa,UAAU,CAAC,kBAAkB,CAAC,WAAW,CAAC,CAAA;AAC/D,EAAE,IAAI,UAAU,EAAE;AAClB,IAAI,OAAO,wBAAwB,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,WAAW,CAAC,IAAI,GAAG,EAAE,UAAU,CAAC,CAAA;AAC9F,GAAE;AACF;AACA;AACA,EAAE,MAAM,WAAW,UAAU,CAAC,kBAAkB,CAAC,SAAS,CAAC,CAAA;AAC3D,EAAE,IAAI,QAAQ,EAAE;AAChB,IAAI,OAAO,sBAAsB,CAAC,EAAE,UAAU,EAAE,IAAA,EAAM,CAAC,CAAA;AACvD,GAAE;AACF;AACA;AACA,EAAE,MAAM,aAAa,UAAU,CAAC,kBAAkB,CAAC,WAAW,CAAC,CAAA;AAC/D,EAAE,IAAI,UAAU,EAAE;AAClB,IAAI,OAAO;AACX,MAAM,EAAE,EAAE,KAAK;AACf,MAAM,WAAW,EAAE,IAAI;AACvB,MAAM,MAAM,EAAE,OAAO;AACrB,KAAK,CAAA;AACL,GAAE;AACF;AACA;AACA,EAAE,MAAM,kBAAkB,UAAU,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,CAAA;AACzE,EAAE,IAAI,eAAe,EAAE;AACvB,IAAI,OAAO;AACX,MAAM,EAAE,EAAE,SAAS;AACnB,MAAM,WAAW,EAAE,IAAI;AACvB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EAAA,QAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA;AACA;;;;"}
|
package/esm/utils/spanData.js
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
// We store the parent span, scopes & metadata in separate weakmaps, so we can access them for a given span
|
|
2
|
-
// This way we can enhance the data that an OTEL Span natively gives us
|
|
3
|
-
// and since we are using weakmaps, we do not need to clean up after ourselves
|
|
4
|
-
const SpanScopes = new WeakMap
|
|
5
|
-
|
|
6
|
-
();
|
|
7
|
-
const SpanHub = new WeakMap();
|
|
8
|
-
const SpanParent = new WeakMap();
|
|
9
|
-
const SpanMetadata = new WeakMap();
|
|
10
|
-
|
|
11
|
-
/** Set the Sentry hub on an OTEL span. */
|
|
12
|
-
function setSpanHub(span, hub) {
|
|
13
|
-
SpanHub.set(span, hub);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
/** Get the Sentry hub of an OTEL span. */
|
|
17
|
-
function getSpanHub(span) {
|
|
18
|
-
return SpanHub.get(span);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
/** Set the parent OTEL span on an OTEL span. */
|
|
22
|
-
function setSpanParent(span, parentSpan) {
|
|
23
|
-
SpanParent.set(span, parentSpan);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
/** Get the parent OTEL span of an OTEL span. */
|
|
27
|
-
function getSpanParent(span) {
|
|
28
|
-
return SpanParent.get(span);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/** Set metadata for an OTEL span. */
|
|
32
|
-
function setSpanMetadata(span, metadata) {
|
|
33
|
-
SpanMetadata.set(span, metadata);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
/** Get metadata for an OTEL span. */
|
|
37
|
-
function getSpanMetadata(span) {
|
|
38
|
-
return SpanMetadata.get(span);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Set the Sentry scope to be used for finishing a given OTEL span.
|
|
43
|
-
* This is different from `setCapturedScopesOnSpan`, as that works on _sentry_ spans,
|
|
44
|
-
* while here we are basically "caching" this on the otel spans.
|
|
45
|
-
*/
|
|
46
|
-
function setSpanScopes(
|
|
47
|
-
span,
|
|
48
|
-
scopes
|
|
49
|
-
|
|
50
|
-
,
|
|
51
|
-
) {
|
|
52
|
-
SpanScopes.set(span, scopes);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
/** Get the Sentry scopes to use for finishing an OTEL span. */
|
|
56
|
-
function getSpanScopes(span)
|
|
57
|
-
|
|
58
|
-
{
|
|
59
|
-
return SpanScopes.get(span);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export { getSpanHub, getSpanMetadata, getSpanParent, getSpanScopes, setSpanHub, setSpanMetadata, setSpanParent, setSpanScopes };
|
|
63
|
-
//# sourceMappingURL=spanData.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"spanData.js","sources":["../../../src/utils/spanData.ts"],"sourcesContent":["import type { Span } from '@opentelemetry/api';\nimport type { Hub, Scope, TransactionMetadata } from '@sentry/types';\n\nimport type { AbstractSpan } from '../types';\n\n// We store the parent span, scopes & metadata in separate weakmaps, so we can access them for a given span\n// This way we can enhance the data that an OTEL Span natively gives us\n// and since we are using weakmaps, we do not need to clean up after ourselves\nconst SpanScopes = new WeakMap<\n AbstractSpan,\n {\n scope: Scope;\n isolationScope: Scope;\n }\n>();\nconst SpanHub = new WeakMap<AbstractSpan, Hub>();\nconst SpanParent = new WeakMap<AbstractSpan, Span>();\nconst SpanMetadata = new WeakMap<AbstractSpan, Partial<TransactionMetadata>>();\n\n/** Set the Sentry hub on an OTEL span. */\nexport function setSpanHub(span: AbstractSpan, hub: Hub): void {\n SpanHub.set(span, hub);\n}\n\n/** Get the Sentry hub of an OTEL span. */\nexport function getSpanHub(span: AbstractSpan): Hub | undefined {\n return SpanHub.get(span);\n}\n\n/** Set the parent OTEL span on an OTEL span. */\nexport function setSpanParent(span: AbstractSpan, parentSpan: Span): void {\n SpanParent.set(span, parentSpan);\n}\n\n/** Get the parent OTEL span of an OTEL span. */\nexport function getSpanParent(span: AbstractSpan): Span | undefined {\n return SpanParent.get(span);\n}\n\n/** Set metadata for an OTEL span. */\nexport function setSpanMetadata(span: AbstractSpan, metadata: Partial<TransactionMetadata>): void {\n SpanMetadata.set(span, metadata);\n}\n\n/** Get metadata for an OTEL span. */\nexport function getSpanMetadata(span: AbstractSpan): Partial<TransactionMetadata> | undefined {\n return SpanMetadata.get(span);\n}\n\n/**\n * Set the Sentry scope to be used for finishing a given OTEL span.\n * This is different from `setCapturedScopesOnSpan`, as that works on _sentry_ spans,\n * while here we are basically \"caching\" this on the otel spans.\n */\nexport function setSpanScopes(\n span: AbstractSpan,\n scopes: {\n scope: Scope;\n isolationScope: Scope;\n },\n): void {\n SpanScopes.set(span, scopes);\n}\n\n/** Get the Sentry scopes to use for finishing an OTEL span. */\nexport function getSpanScopes(span: AbstractSpan):\n | {\n scope: Scope;\n isolationScope: Scope;\n }\n | undefined {\n return SpanScopes.get(span);\n}\n"],"names":[],"mappings":"AAKA;AACA;AACA;AACA,MAAM,UAAA,GAAa,IAAI,OAAO;;AAM9B,EAAG,CAAA;AACH,MAAM,OAAQ,GAAE,IAAI,OAAO,EAAqB,CAAA;AAChD,MAAM,UAAW,GAAE,IAAI,OAAO,EAAsB,CAAA;AACpD,MAAM,YAAa,GAAE,IAAI,OAAO,EAA8C,CAAA;AAC9E;AACA;AACO,SAAS,UAAU,CAAC,IAAI,EAAgB,GAAG,EAAa;AAC/D,EAAE,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,CAAA;AACxB,CAAA;AACA;AACA;AACO,SAAS,UAAU,CAAC,IAAI,EAAiC;AAChE,EAAE,OAAO,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;AAC1B,CAAA;AACA;AACA;AACO,SAAS,aAAa,CAAC,IAAI,EAAgB,UAAU,EAAc;AAC1E,EAAE,UAAU,CAAC,GAAG,CAAC,IAAI,EAAE,UAAU,CAAC,CAAA;AAClC,CAAA;AACA;AACA;AACO,SAAS,aAAa,CAAC,IAAI,EAAkC;AACpE,EAAE,OAAO,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;AAC7B,CAAA;AACA;AACA;AACO,SAAS,eAAe,CAAC,IAAI,EAAgB,QAAQ,EAAsC;AAClG,EAAE,YAAY,CAAC,GAAG,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAA;AAClC,CAAA;AACA;AACA;AACO,SAAS,eAAe,CAAC,IAAI,EAA0D;AAC9F,EAAE,OAAO,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;AAC/B,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,aAAa;AAC7B,EAAE,IAAI;AACN,EAAE,MAAM;;AAGN;AACF,EAAQ;AACR,EAAE,UAAU,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA;AAC9B,CAAA;AACA;AACA;AACO,SAAS,aAAa,CAAC,IAAI;;AAKhC,CAAY;AACd,EAAE,OAAO,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;AAC7B;;;;"}
|
package/esm/utils/spanTypes.js
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Check if a given span has attributes.
|
|
3
|
-
* This is necessary because the base `Span` type does not have attributes,
|
|
4
|
-
* so in places where we are passed a generic span, we need to check if we want to access them.
|
|
5
|
-
*/
|
|
6
|
-
function spanHasAttributes(
|
|
7
|
-
span,
|
|
8
|
-
) {
|
|
9
|
-
const castSpan = span ;
|
|
10
|
-
return !!castSpan.attributes && typeof castSpan.attributes === 'object';
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Check if a given span has a kind.
|
|
15
|
-
* This is necessary because the base `Span` type does not have a kind,
|
|
16
|
-
* so in places where we are passed a generic span, we need to check if we want to access it.
|
|
17
|
-
*/
|
|
18
|
-
function spanHasKind(span) {
|
|
19
|
-
const castSpan = span ;
|
|
20
|
-
return !!castSpan.kind;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Check if a given span has a status.
|
|
25
|
-
* This is necessary because the base `Span` type does not have a status,
|
|
26
|
-
* so in places where we are passed a generic span, we need to check if we want to access it.
|
|
27
|
-
*/
|
|
28
|
-
function spanHasStatus(
|
|
29
|
-
span,
|
|
30
|
-
) {
|
|
31
|
-
const castSpan = span ;
|
|
32
|
-
return !!castSpan.status;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Check if a given span has a name.
|
|
37
|
-
* This is necessary because the base `Span` type does not have a name,
|
|
38
|
-
* so in places where we are passed a generic span, we need to check if we want to access it.
|
|
39
|
-
*/
|
|
40
|
-
function spanHasName(span) {
|
|
41
|
-
const castSpan = span ;
|
|
42
|
-
return !!castSpan.name;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Check if a given span has a kind.
|
|
47
|
-
* This is necessary because the base `Span` type does not have a kind,
|
|
48
|
-
* so in places where we are passed a generic span, we need to check if we want to access it.
|
|
49
|
-
*/
|
|
50
|
-
function spanHasParentId(
|
|
51
|
-
span,
|
|
52
|
-
) {
|
|
53
|
-
const castSpan = span ;
|
|
54
|
-
return !!castSpan.parentSpanId;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Check if a given span has events.
|
|
59
|
-
* This is necessary because the base `Span` type does not have events,
|
|
60
|
-
* so in places where we are passed a generic span, we need to check if we want to access it.
|
|
61
|
-
*/
|
|
62
|
-
function spanHasEvents(
|
|
63
|
-
span,
|
|
64
|
-
) {
|
|
65
|
-
const castSpan = span ;
|
|
66
|
-
return Array.isArray(castSpan.events);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export { spanHasAttributes, spanHasEvents, spanHasKind, spanHasName, spanHasParentId, spanHasStatus };
|
|
70
|
-
//# sourceMappingURL=spanTypes.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"spanTypes.js","sources":["../../../src/utils/spanTypes.ts"],"sourcesContent":["import type { SpanKind, SpanStatus } from '@opentelemetry/api';\nimport type { ReadableSpan, TimedEvent } from '@opentelemetry/sdk-trace-base';\n\nimport type { AbstractSpan } from '../types';\n\n/**\n * Check if a given span has attributes.\n * This is necessary because the base `Span` type does not have attributes,\n * so in places where we are passed a generic span, we need to check if we want to access them.\n */\nexport function spanHasAttributes<SpanType extends AbstractSpan>(\n span: SpanType,\n): span is SpanType & { attributes: ReadableSpan['attributes'] } {\n const castSpan = span as ReadableSpan;\n return !!castSpan.attributes && typeof castSpan.attributes === 'object';\n}\n\n/**\n * Check if a given span has a kind.\n * This is necessary because the base `Span` type does not have a kind,\n * so in places where we are passed a generic span, we need to check if we want to access it.\n */\nexport function spanHasKind<SpanType extends AbstractSpan>(span: SpanType): span is SpanType & { kind: SpanKind } {\n const castSpan = span as ReadableSpan;\n return !!castSpan.kind;\n}\n\n/**\n * Check if a given span has a status.\n * This is necessary because the base `Span` type does not have a status,\n * so in places where we are passed a generic span, we need to check if we want to access it.\n */\nexport function spanHasStatus<SpanType extends AbstractSpan>(\n span: SpanType,\n): span is SpanType & { status: SpanStatus } {\n const castSpan = span as ReadableSpan;\n return !!castSpan.status;\n}\n\n/**\n * Check if a given span has a name.\n * This is necessary because the base `Span` type does not have a name,\n * so in places where we are passed a generic span, we need to check if we want to access it.\n */\nexport function spanHasName<SpanType extends AbstractSpan>(span: SpanType): span is SpanType & { name: string } {\n const castSpan = span as ReadableSpan;\n return !!castSpan.name;\n}\n\n/**\n * Check if a given span has a kind.\n * This is necessary because the base `Span` type does not have a kind,\n * so in places where we are passed a generic span, we need to check if we want to access it.\n */\nexport function spanHasParentId<SpanType extends AbstractSpan>(\n span: SpanType,\n): span is SpanType & { parentSpanId: string } {\n const castSpan = span as ReadableSpan;\n return !!castSpan.parentSpanId;\n}\n\n/**\n * Check if a given span has events.\n * This is necessary because the base `Span` type does not have events,\n * so in places where we are passed a generic span, we need to check if we want to access it.\n */\nexport function spanHasEvents<SpanType extends AbstractSpan>(\n span: SpanType,\n): span is SpanType & { events: TimedEvent[] } {\n const castSpan = span as ReadableSpan;\n return Array.isArray(castSpan.events);\n}\n"],"names":[],"mappings":"AAKA;AACA;AACA;AACA;AACA;AACO,SAAS,iBAAiB;AACjC,EAAE,IAAI;AACN,EAAiE;AACjE,EAAE,MAAM,QAAS,GAAE,IAAK,EAAA;AACxB,EAAE,OAAO,CAAC,CAAC,QAAQ,CAAC,UAAA,IAAc,OAAO,QAAQ,CAAC,UAAW,KAAI,QAAQ,CAAA;AACzE,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,WAAW,CAAgC,IAAI,EAAmD;AAClH,EAAE,MAAM,QAAS,GAAE,IAAK,EAAA;AACxB,EAAE,OAAO,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAA;AACxB,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,aAAa;AAC7B,EAAE,IAAI;AACN,EAA6C;AAC7C,EAAE,MAAM,QAAS,GAAE,IAAK,EAAA;AACxB,EAAE,OAAO,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAA;AAC1B,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,WAAW,CAAgC,IAAI,EAAiD;AAChH,EAAE,MAAM,QAAS,GAAE,IAAK,EAAA;AACxB,EAAE,OAAO,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAA;AACxB,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,eAAe;AAC/B,EAAE,IAAI;AACN,EAA+C;AAC/C,EAAE,MAAM,QAAS,GAAE,IAAK,EAAA;AACxB,EAAE,OAAO,CAAC,CAAC,QAAQ,CAAC,YAAY,CAAA;AAChC,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,aAAa;AAC7B,EAAE,IAAI;AACN,EAA+C;AAC/C,EAAE,MAAM,QAAS,GAAE,IAAK,EAAA;AACxB,EAAE,OAAO,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAA;AACvC;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hubextensions.d.ts","sourceRoot":"","sources":["../../../src/custom/hubextensions.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,IAAI,CAY3C"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Transaction } from '@sentry/core';
|
|
2
|
-
import type { Hub as HubInterface, TransactionContext } from '@sentry/types';
|
|
3
|
-
/**
|
|
4
|
-
* This is a fork of core's tracing/hubextensions.ts _startTransaction,
|
|
5
|
-
* with some OTEL specifics.
|
|
6
|
-
*/
|
|
7
|
-
export declare function startTransaction(hub: HubInterface, transactionContext: TransactionContext): Transaction;
|
|
8
|
-
//# sourceMappingURL=transaction.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"transaction.d.ts","sourceRoot":"","sources":["../../../src/custom/transaction.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,EAAE,GAAG,IAAI,YAAY,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAE7E;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,YAAY,EAAE,kBAAkB,EAAE,kBAAkB,GAAG,WAAW,CAcvG"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Transaction } from '@sentry/core';
|
|
2
|
-
import { Hub as HubInterface, TransactionContext } from '@sentry/types';
|
|
3
|
-
/**
|
|
4
|
-
* This is a fork of core's tracing/hubextensions.ts _startTransaction,
|
|
5
|
-
* with some OTEL specifics.
|
|
6
|
-
*/
|
|
7
|
-
export declare function startTransaction(hub: HubInterface, transactionContext: TransactionContext): Transaction;
|
|
8
|
-
//# sourceMappingURL=transaction.d.ts.map
|