@opentelemetry/sdk-trace-web 0.26.0 → 1.1.0
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 +1 -7
- package/build/src/StackContextManager.js +1 -0
- package/build/src/StackContextManager.js.map +1 -1
- package/build/src/WebTracerProvider.js.map +1 -1
- package/build/src/enums/PerformanceTimingNames.js.map +1 -1
- package/build/src/index.js.map +1 -1
- package/build/src/types.js.map +1 -1
- package/build/src/utils.d.ts +27 -3
- package/build/src/utils.js +39 -26
- package/build/src/utils.js.map +1 -1
- package/build/src/version.d.ts +1 -1
- package/build/src/version.js +1 -1
- package/build/src/version.js.map +1 -1
- package/package.json +31 -24
- package/build/esm/StackContextManager.d.ts +0 -50
- package/build/esm/StackContextManager.js +0 -127
- package/build/esm/StackContextManager.js.map +0 -1
- package/build/esm/WebTracerProvider.d.ts +0 -24
- package/build/esm/WebTracerProvider.js +0 -74
- package/build/esm/WebTracerProvider.js.map +0 -1
- package/build/esm/enums/PerformanceTimingNames.d.ts +0 -25
- package/build/esm/enums/PerformanceTimingNames.js +0 -41
- package/build/esm/enums/PerformanceTimingNames.js.map +0 -1
- package/build/esm/index.d.ts +0 -6
- package/build/esm/index.js +0 -21
- package/build/esm/index.js.map +0 -1
- package/build/esm/types.d.ts +0 -46
- package/build/esm/types.js +0 -17
- package/build/esm/types.js.map +0 -1
- package/build/esm/utils.d.ts +0 -57
- package/build/esm/utils.js +0 -302
- package/build/esm/utils.js.map +0 -1
- package/build/esm/version.d.ts +0 -2
- package/build/esm/version.js +0 -18
- package/build/esm/version.js.map +0 -1
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright The OpenTelemetry Authors
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* https://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
|
|
17
|
-
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
18
|
-
to[j] = from[i];
|
|
19
|
-
return to;
|
|
20
|
-
};
|
|
21
|
-
import { ROOT_CONTEXT } from '@opentelemetry/api';
|
|
22
|
-
/**
|
|
23
|
-
* Stack Context Manager for managing the state in web
|
|
24
|
-
* it doesn't fully support the async calls though
|
|
25
|
-
*/
|
|
26
|
-
var StackContextManager = /** @class */ (function () {
|
|
27
|
-
function StackContextManager() {
|
|
28
|
-
/**
|
|
29
|
-
* whether the context manager is enabled or not
|
|
30
|
-
*/
|
|
31
|
-
this._enabled = false;
|
|
32
|
-
/**
|
|
33
|
-
* Keeps the reference to current context
|
|
34
|
-
*/
|
|
35
|
-
this._currentContext = ROOT_CONTEXT;
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
*
|
|
39
|
-
* @param context
|
|
40
|
-
* @param target Function to be executed within the context
|
|
41
|
-
*/
|
|
42
|
-
StackContextManager.prototype._bindFunction = function (context, target) {
|
|
43
|
-
if (context === void 0) { context = ROOT_CONTEXT; }
|
|
44
|
-
var manager = this;
|
|
45
|
-
var contextWrapper = function () {
|
|
46
|
-
var _this = this;
|
|
47
|
-
var args = [];
|
|
48
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
49
|
-
args[_i] = arguments[_i];
|
|
50
|
-
}
|
|
51
|
-
return manager.with(context, function () { return target.apply(_this, args); });
|
|
52
|
-
};
|
|
53
|
-
Object.defineProperty(contextWrapper, 'length', {
|
|
54
|
-
enumerable: false,
|
|
55
|
-
configurable: true,
|
|
56
|
-
writable: false,
|
|
57
|
-
value: target.length,
|
|
58
|
-
});
|
|
59
|
-
return contextWrapper;
|
|
60
|
-
};
|
|
61
|
-
/**
|
|
62
|
-
* Returns the active context
|
|
63
|
-
*/
|
|
64
|
-
StackContextManager.prototype.active = function () {
|
|
65
|
-
return this._currentContext;
|
|
66
|
-
};
|
|
67
|
-
/**
|
|
68
|
-
* Binds a the certain context or the active one to the target function and then returns the target
|
|
69
|
-
* @param context A context (span) to be bind to target
|
|
70
|
-
* @param target a function or event emitter. When target or one of its callbacks is called,
|
|
71
|
-
* the provided context will be used as the active context for the duration of the call.
|
|
72
|
-
*/
|
|
73
|
-
StackContextManager.prototype.bind = function (context, target) {
|
|
74
|
-
// if no specific context to propagate is given, we use the current one
|
|
75
|
-
if (context === undefined) {
|
|
76
|
-
context = this.active();
|
|
77
|
-
}
|
|
78
|
-
if (typeof target === 'function') {
|
|
79
|
-
return this._bindFunction(context, target);
|
|
80
|
-
}
|
|
81
|
-
return target;
|
|
82
|
-
};
|
|
83
|
-
/**
|
|
84
|
-
* Disable the context manager (clears the current context)
|
|
85
|
-
*/
|
|
86
|
-
StackContextManager.prototype.disable = function () {
|
|
87
|
-
this._currentContext = ROOT_CONTEXT;
|
|
88
|
-
this._enabled = false;
|
|
89
|
-
return this;
|
|
90
|
-
};
|
|
91
|
-
/**
|
|
92
|
-
* Enables the context manager and creates a default(root) context
|
|
93
|
-
*/
|
|
94
|
-
StackContextManager.prototype.enable = function () {
|
|
95
|
-
if (this._enabled) {
|
|
96
|
-
return this;
|
|
97
|
-
}
|
|
98
|
-
this._enabled = true;
|
|
99
|
-
this._currentContext = ROOT_CONTEXT;
|
|
100
|
-
return this;
|
|
101
|
-
};
|
|
102
|
-
/**
|
|
103
|
-
* Calls the callback function [fn] with the provided [context]. If [context] is undefined then it will use the window.
|
|
104
|
-
* The context will be set as active
|
|
105
|
-
* @param context
|
|
106
|
-
* @param fn Callback function
|
|
107
|
-
* @param thisArg optional receiver to be used for calling fn
|
|
108
|
-
* @param args optional arguments forwarded to fn
|
|
109
|
-
*/
|
|
110
|
-
StackContextManager.prototype.with = function (context, fn, thisArg) {
|
|
111
|
-
var args = [];
|
|
112
|
-
for (var _i = 3; _i < arguments.length; _i++) {
|
|
113
|
-
args[_i - 3] = arguments[_i];
|
|
114
|
-
}
|
|
115
|
-
var previousContext = this._currentContext;
|
|
116
|
-
this._currentContext = context || ROOT_CONTEXT;
|
|
117
|
-
try {
|
|
118
|
-
return fn.call.apply(fn, __spreadArray([thisArg], args));
|
|
119
|
-
}
|
|
120
|
-
finally {
|
|
121
|
-
this._currentContext = previousContext;
|
|
122
|
-
}
|
|
123
|
-
};
|
|
124
|
-
return StackContextManager;
|
|
125
|
-
}());
|
|
126
|
-
export { StackContextManager };
|
|
127
|
-
//# sourceMappingURL=StackContextManager.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"StackContextManager.js","sourceRoot":"","sources":["../../src/StackContextManager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;;;;;;AAEH,OAAO,EAA2B,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAE3E;;;GAGG;AACH;IAAA;QACE;;WAEG;QACK,aAAQ,GAAG,KAAK,CAAC;QAEzB;;WAEG;QACI,oBAAe,GAAG,YAAY,CAAC;IA4FxC,CAAC;IA1FC;;;;OAIG;IACK,2CAAa,GAArB,UACE,OAAsB,EACtB,MAAS;QADT,wBAAA,EAAA,sBAAsB;QAGtB,IAAM,OAAO,GAAG,IAAI,CAAC;QACrB,IAAM,cAAc,GAAG;YAAA,iBAEtB;YAF+C,cAAkB;iBAAlB,UAAkB,EAAlB,qBAAkB,EAAlB,IAAkB;gBAAlB,yBAAkB;;YAChE,OAAO,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,cAAM,OAAA,MAAM,CAAC,KAAK,CAAC,KAAI,EAAE,IAAI,CAAC,EAAxB,CAAwB,CAAC,CAAC;QAC/D,CAAC,CAAC;QACF,MAAM,CAAC,cAAc,CAAC,cAAc,EAAE,QAAQ,EAAE;YAC9C,UAAU,EAAE,KAAK;YACjB,YAAY,EAAE,IAAI;YAClB,QAAQ,EAAE,KAAK;YACf,KAAK,EAAE,MAAM,CAAC,MAAM;SACrB,CAAC,CAAC;QACH,OAAQ,cAA+B,CAAC;IAC1C,CAAC;IAED;;OAEG;IACH,oCAAM,GAAN;QACE,OAAO,IAAI,CAAC,eAAe,CAAC;IAC9B,CAAC;IAED;;;;;OAKG;IACH,kCAAI,GAAJ,UAAQ,OAAgB,EAAE,MAAS;QACjC,uEAAuE;QACvE,IAAI,OAAO,KAAK,SAAS,EAAE;YACzB,OAAO,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;SACzB;QACD,IAAI,OAAO,MAAM,KAAK,UAAU,EAAE;YAChC,OAAO,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;SAC5C;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;IAED;;OAEG;IACH,qCAAO,GAAP;QACE,IAAI,CAAC,eAAe,GAAG,YAAY,CAAC;QACpC,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;QACtB,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;OAEG;IACH,oCAAM,GAAN;QACE,IAAI,IAAI,CAAC,QAAQ,EAAE;YACjB,OAAO,IAAI,CAAC;SACb;QACD,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACrB,IAAI,CAAC,eAAe,GAAG,YAAY,CAAC;QACpC,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;;;OAOG;IACH,kCAAI,GAAJ,UACE,OAAuB,EACvB,EAAK,EACL,OAA8B;QAC9B,cAAU;aAAV,UAAU,EAAV,qBAAU,EAAV,IAAU;YAAV,6BAAU;;QAEV,IAAM,eAAe,GAAG,IAAI,CAAC,eAAe,CAAC;QAC7C,IAAI,CAAC,eAAe,GAAG,OAAO,IAAI,YAAY,CAAC;QAE/C,IAAI;YACF,OAAO,EAAE,CAAC,IAAI,OAAP,EAAE,iBAAM,OAAO,GAAK,IAAI,GAAE;SAClC;gBAAS;YACR,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;SACxC;IACH,CAAC;IACH,0BAAC;AAAD,CAAC,AArGD,IAqGC"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { BasicTracerProvider, SDKRegistrationConfig, TracerConfig } from '@opentelemetry/sdk-trace-base';
|
|
2
|
-
/**
|
|
3
|
-
* WebTracerConfig provides an interface for configuring a Web Tracer.
|
|
4
|
-
*/
|
|
5
|
-
export declare type WebTracerConfig = TracerConfig;
|
|
6
|
-
/**
|
|
7
|
-
* This class represents a web tracer with {@link StackContextManager}
|
|
8
|
-
*/
|
|
9
|
-
export declare class WebTracerProvider extends BasicTracerProvider {
|
|
10
|
-
/**
|
|
11
|
-
* Constructs a new Tracer instance.
|
|
12
|
-
* @param config Web Tracer config
|
|
13
|
-
*/
|
|
14
|
-
constructor(config?: WebTracerConfig);
|
|
15
|
-
/**
|
|
16
|
-
* Register this TracerProvider for use with the OpenTelemetry API.
|
|
17
|
-
* Undefined values may be replaced with defaults, and
|
|
18
|
-
* null values will be skipped.
|
|
19
|
-
*
|
|
20
|
-
* @param config Configuration object for SDK registration
|
|
21
|
-
*/
|
|
22
|
-
register(config?: SDKRegistrationConfig): void;
|
|
23
|
-
}
|
|
24
|
-
//# sourceMappingURL=WebTracerProvider.d.ts.map
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright The OpenTelemetry Authors
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* https://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
var __extends = (this && this.__extends) || (function () {
|
|
17
|
-
var extendStatics = function (d, b) {
|
|
18
|
-
extendStatics = Object.setPrototypeOf ||
|
|
19
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
20
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
21
|
-
return extendStatics(d, b);
|
|
22
|
-
};
|
|
23
|
-
return function (d, b) {
|
|
24
|
-
if (typeof b !== "function" && b !== null)
|
|
25
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
26
|
-
extendStatics(d, b);
|
|
27
|
-
function __() { this.constructor = d; }
|
|
28
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
29
|
-
};
|
|
30
|
-
})();
|
|
31
|
-
import { BasicTracerProvider, } from '@opentelemetry/sdk-trace-base';
|
|
32
|
-
import { StackContextManager } from './StackContextManager';
|
|
33
|
-
/**
|
|
34
|
-
* This class represents a web tracer with {@link StackContextManager}
|
|
35
|
-
*/
|
|
36
|
-
var WebTracerProvider = /** @class */ (function (_super) {
|
|
37
|
-
__extends(WebTracerProvider, _super);
|
|
38
|
-
/**
|
|
39
|
-
* Constructs a new Tracer instance.
|
|
40
|
-
* @param config Web Tracer config
|
|
41
|
-
*/
|
|
42
|
-
function WebTracerProvider(config) {
|
|
43
|
-
if (config === void 0) { config = {}; }
|
|
44
|
-
var _this = _super.call(this, config) || this;
|
|
45
|
-
if (config.contextManager) {
|
|
46
|
-
throw ('contextManager should be defined in register method not in' +
|
|
47
|
-
' constructor');
|
|
48
|
-
}
|
|
49
|
-
if (config.propagator) {
|
|
50
|
-
throw 'propagator should be defined in register method not in constructor';
|
|
51
|
-
}
|
|
52
|
-
return _this;
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Register this TracerProvider for use with the OpenTelemetry API.
|
|
56
|
-
* Undefined values may be replaced with defaults, and
|
|
57
|
-
* null values will be skipped.
|
|
58
|
-
*
|
|
59
|
-
* @param config Configuration object for SDK registration
|
|
60
|
-
*/
|
|
61
|
-
WebTracerProvider.prototype.register = function (config) {
|
|
62
|
-
if (config === void 0) { config = {}; }
|
|
63
|
-
if (config.contextManager === undefined) {
|
|
64
|
-
config.contextManager = new StackContextManager();
|
|
65
|
-
}
|
|
66
|
-
if (config.contextManager) {
|
|
67
|
-
config.contextManager.enable();
|
|
68
|
-
}
|
|
69
|
-
_super.prototype.register.call(this, config);
|
|
70
|
-
};
|
|
71
|
-
return WebTracerProvider;
|
|
72
|
-
}(BasicTracerProvider));
|
|
73
|
-
export { WebTracerProvider };
|
|
74
|
-
//# sourceMappingURL=WebTracerProvider.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"WebTracerProvider.js","sourceRoot":"","sources":["../../src/WebTracerProvider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;;;;;AAEH,OAAO,EACL,mBAAmB,GAGpB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAO5D;;GAEG;AACH;IAAuC,qCAAmB;IACxD;;;OAGG;IACH,2BAAY,MAA4B;QAA5B,uBAAA,EAAA,WAA4B;QAAxC,YACE,kBAAM,MAAM,CAAC,SAWd;QATC,IAAK,MAAgC,CAAC,cAAc,EAAE;YACpD,MAAM,CACJ,4DAA4D;gBAC5D,cAAc,CACf,CAAC;SACH;QACD,IAAK,MAAgC,CAAC,UAAU,EAAE;YAChD,MAAM,oEAAoE,CAAC;SAC5E;;IACH,CAAC;IAED;;;;;;OAMG;IACM,oCAAQ,GAAjB,UAAkB,MAAkC;QAAlC,uBAAA,EAAA,WAAkC;QAClD,IAAI,MAAM,CAAC,cAAc,KAAK,SAAS,EAAE;YACvC,MAAM,CAAC,cAAc,GAAG,IAAI,mBAAmB,EAAE,CAAC;SACnD;QACD,IAAI,MAAM,CAAC,cAAc,EAAE;YACzB,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,CAAC;SAChC;QAED,iBAAM,QAAQ,YAAC,MAAM,CAAC,CAAC;IACzB,CAAC;IACH,wBAAC;AAAD,CAAC,AApCD,CAAuC,mBAAmB,GAoCzD"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
export declare enum PerformanceTimingNames {
|
|
2
|
-
CONNECT_END = "connectEnd",
|
|
3
|
-
CONNECT_START = "connectStart",
|
|
4
|
-
DECODED_BODY_SIZE = "decodedBodySize",
|
|
5
|
-
DOM_COMPLETE = "domComplete",
|
|
6
|
-
DOM_CONTENT_LOADED_EVENT_END = "domContentLoadedEventEnd",
|
|
7
|
-
DOM_CONTENT_LOADED_EVENT_START = "domContentLoadedEventStart",
|
|
8
|
-
DOM_INTERACTIVE = "domInteractive",
|
|
9
|
-
DOMAIN_LOOKUP_END = "domainLookupEnd",
|
|
10
|
-
DOMAIN_LOOKUP_START = "domainLookupStart",
|
|
11
|
-
ENCODED_BODY_SIZE = "encodedBodySize",
|
|
12
|
-
FETCH_START = "fetchStart",
|
|
13
|
-
LOAD_EVENT_END = "loadEventEnd",
|
|
14
|
-
LOAD_EVENT_START = "loadEventStart",
|
|
15
|
-
NAVIGATION_START = "navigationStart",
|
|
16
|
-
REDIRECT_END = "redirectEnd",
|
|
17
|
-
REDIRECT_START = "redirectStart",
|
|
18
|
-
REQUEST_START = "requestStart",
|
|
19
|
-
RESPONSE_END = "responseEnd",
|
|
20
|
-
RESPONSE_START = "responseStart",
|
|
21
|
-
SECURE_CONNECTION_START = "secureConnectionStart",
|
|
22
|
-
UNLOAD_EVENT_END = "unloadEventEnd",
|
|
23
|
-
UNLOAD_EVENT_START = "unloadEventStart"
|
|
24
|
-
}
|
|
25
|
-
//# sourceMappingURL=PerformanceTimingNames.d.ts.map
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright The OpenTelemetry Authors
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* https://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
export var PerformanceTimingNames;
|
|
17
|
-
(function (PerformanceTimingNames) {
|
|
18
|
-
PerformanceTimingNames["CONNECT_END"] = "connectEnd";
|
|
19
|
-
PerformanceTimingNames["CONNECT_START"] = "connectStart";
|
|
20
|
-
PerformanceTimingNames["DECODED_BODY_SIZE"] = "decodedBodySize";
|
|
21
|
-
PerformanceTimingNames["DOM_COMPLETE"] = "domComplete";
|
|
22
|
-
PerformanceTimingNames["DOM_CONTENT_LOADED_EVENT_END"] = "domContentLoadedEventEnd";
|
|
23
|
-
PerformanceTimingNames["DOM_CONTENT_LOADED_EVENT_START"] = "domContentLoadedEventStart";
|
|
24
|
-
PerformanceTimingNames["DOM_INTERACTIVE"] = "domInteractive";
|
|
25
|
-
PerformanceTimingNames["DOMAIN_LOOKUP_END"] = "domainLookupEnd";
|
|
26
|
-
PerformanceTimingNames["DOMAIN_LOOKUP_START"] = "domainLookupStart";
|
|
27
|
-
PerformanceTimingNames["ENCODED_BODY_SIZE"] = "encodedBodySize";
|
|
28
|
-
PerformanceTimingNames["FETCH_START"] = "fetchStart";
|
|
29
|
-
PerformanceTimingNames["LOAD_EVENT_END"] = "loadEventEnd";
|
|
30
|
-
PerformanceTimingNames["LOAD_EVENT_START"] = "loadEventStart";
|
|
31
|
-
PerformanceTimingNames["NAVIGATION_START"] = "navigationStart";
|
|
32
|
-
PerformanceTimingNames["REDIRECT_END"] = "redirectEnd";
|
|
33
|
-
PerformanceTimingNames["REDIRECT_START"] = "redirectStart";
|
|
34
|
-
PerformanceTimingNames["REQUEST_START"] = "requestStart";
|
|
35
|
-
PerformanceTimingNames["RESPONSE_END"] = "responseEnd";
|
|
36
|
-
PerformanceTimingNames["RESPONSE_START"] = "responseStart";
|
|
37
|
-
PerformanceTimingNames["SECURE_CONNECTION_START"] = "secureConnectionStart";
|
|
38
|
-
PerformanceTimingNames["UNLOAD_EVENT_END"] = "unloadEventEnd";
|
|
39
|
-
PerformanceTimingNames["UNLOAD_EVENT_START"] = "unloadEventStart";
|
|
40
|
-
})(PerformanceTimingNames || (PerformanceTimingNames = {}));
|
|
41
|
-
//# sourceMappingURL=PerformanceTimingNames.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PerformanceTimingNames.js","sourceRoot":"","sources":["../../../src/enums/PerformanceTimingNames.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,MAAM,CAAN,IAAY,sBAuBX;AAvBD,WAAY,sBAAsB;IAChC,oDAA0B,CAAA;IAC1B,wDAA8B,CAAA;IAC9B,+DAAqC,CAAA;IACrC,sDAA4B,CAAA;IAC5B,mFAAyD,CAAA;IACzD,uFAA6D,CAAA;IAC7D,4DAAkC,CAAA;IAClC,+DAAqC,CAAA;IACrC,mEAAyC,CAAA;IACzC,+DAAqC,CAAA;IACrC,oDAA0B,CAAA;IAC1B,yDAA+B,CAAA;IAC/B,6DAAmC,CAAA;IACnC,8DAAoC,CAAA;IACpC,sDAA4B,CAAA;IAC5B,0DAAgC,CAAA;IAChC,wDAA8B,CAAA;IAC9B,sDAA4B,CAAA;IAC5B,0DAAgC,CAAA;IAChC,2EAAiD,CAAA;IACjD,6DAAmC,CAAA;IACnC,iEAAuC,CAAA;AACzC,CAAC,EAvBW,sBAAsB,KAAtB,sBAAsB,QAuBjC"}
|
package/build/esm/index.d.ts
DELETED
package/build/esm/index.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright The OpenTelemetry Authors
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* https://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
export * from './WebTracerProvider';
|
|
17
|
-
export * from './StackContextManager';
|
|
18
|
-
export * from './enums/PerformanceTimingNames';
|
|
19
|
-
export * from './types';
|
|
20
|
-
export * from './utils';
|
|
21
|
-
//# sourceMappingURL=index.js.map
|
package/build/esm/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC"}
|
package/build/esm/types.d.ts
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { PerformanceTimingNames } from './enums/PerformanceTimingNames';
|
|
2
|
-
export declare type PerformanceEntries = {
|
|
3
|
-
[PerformanceTimingNames.CONNECT_END]?: number;
|
|
4
|
-
[PerformanceTimingNames.CONNECT_START]?: number;
|
|
5
|
-
[PerformanceTimingNames.DECODED_BODY_SIZE]?: number;
|
|
6
|
-
[PerformanceTimingNames.DOM_COMPLETE]?: number;
|
|
7
|
-
[PerformanceTimingNames.DOM_CONTENT_LOADED_EVENT_END]?: number;
|
|
8
|
-
[PerformanceTimingNames.DOM_CONTENT_LOADED_EVENT_START]?: number;
|
|
9
|
-
[PerformanceTimingNames.DOM_INTERACTIVE]?: number;
|
|
10
|
-
[PerformanceTimingNames.DOMAIN_LOOKUP_END]?: number;
|
|
11
|
-
[PerformanceTimingNames.DOMAIN_LOOKUP_START]?: number;
|
|
12
|
-
[PerformanceTimingNames.ENCODED_BODY_SIZE]?: number;
|
|
13
|
-
[PerformanceTimingNames.FETCH_START]?: number;
|
|
14
|
-
[PerformanceTimingNames.LOAD_EVENT_END]?: number;
|
|
15
|
-
[PerformanceTimingNames.LOAD_EVENT_START]?: number;
|
|
16
|
-
[PerformanceTimingNames.REDIRECT_END]?: number;
|
|
17
|
-
[PerformanceTimingNames.REDIRECT_START]?: number;
|
|
18
|
-
[PerformanceTimingNames.REQUEST_START]?: number;
|
|
19
|
-
[PerformanceTimingNames.RESPONSE_END]?: number;
|
|
20
|
-
[PerformanceTimingNames.RESPONSE_START]?: number;
|
|
21
|
-
[PerformanceTimingNames.SECURE_CONNECTION_START]?: number;
|
|
22
|
-
[PerformanceTimingNames.UNLOAD_EVENT_END]?: number;
|
|
23
|
-
[PerformanceTimingNames.UNLOAD_EVENT_START]?: number;
|
|
24
|
-
};
|
|
25
|
-
/**
|
|
26
|
-
* This interface defines a fallback to read performance metrics,
|
|
27
|
-
* this happens for example on Safari Mac
|
|
28
|
-
*/
|
|
29
|
-
export interface PerformanceLegacy {
|
|
30
|
-
timing?: PerformanceEntries;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* This interface is used in {@link getResource} function to return
|
|
34
|
-
* main request and it's corresponding PreFlight request
|
|
35
|
-
*/
|
|
36
|
-
export interface PerformanceResourceTimingInfo {
|
|
37
|
-
corsPreFlightRequest?: PerformanceResourceTiming;
|
|
38
|
-
mainRequest?: PerformanceResourceTiming;
|
|
39
|
-
}
|
|
40
|
-
declare type PropagateTraceHeaderCorsUrl = string | RegExp;
|
|
41
|
-
/**
|
|
42
|
-
* urls which should include trace headers when origin doesn't match
|
|
43
|
-
*/
|
|
44
|
-
export declare type PropagateTraceHeaderCorsUrls = PropagateTraceHeaderCorsUrl | PropagateTraceHeaderCorsUrl[];
|
|
45
|
-
export {};
|
|
46
|
-
//# sourceMappingURL=types.d.ts.map
|
package/build/esm/types.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright The OpenTelemetry Authors
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* https://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
import { PerformanceTimingNames } from './enums/PerformanceTimingNames';
|
|
17
|
-
//# sourceMappingURL=types.js.map
|
package/build/esm/types.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC"}
|
package/build/esm/utils.d.ts
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { PerformanceEntries, PerformanceResourceTimingInfo, PropagateTraceHeaderCorsUrls } from './types';
|
|
2
|
-
import * as api from '@opentelemetry/api';
|
|
3
|
-
export declare function getUrlNormalizingAnchor(): HTMLAnchorElement;
|
|
4
|
-
/**
|
|
5
|
-
* Helper function to be able to use enum as typed key in type and in interface when using forEach
|
|
6
|
-
* @param obj
|
|
7
|
-
* @param key
|
|
8
|
-
*/
|
|
9
|
-
export declare function hasKey<O>(obj: O, key: keyof any): key is keyof O;
|
|
10
|
-
/**
|
|
11
|
-
* Helper function for starting an event on span based on {@link PerformanceEntries}
|
|
12
|
-
* @param span
|
|
13
|
-
* @param performanceName name of performance entry for time start
|
|
14
|
-
* @param entries
|
|
15
|
-
*/
|
|
16
|
-
export declare function addSpanNetworkEvent(span: api.Span, performanceName: string, entries: PerformanceEntries): api.Span | undefined;
|
|
17
|
-
/**
|
|
18
|
-
* Helper function for adding network events
|
|
19
|
-
* @param span
|
|
20
|
-
* @param resource
|
|
21
|
-
*/
|
|
22
|
-
export declare function addSpanNetworkEvents(span: api.Span, resource: PerformanceEntries): void;
|
|
23
|
-
/**
|
|
24
|
-
* sort resources by startTime
|
|
25
|
-
* @param filteredResources
|
|
26
|
-
*/
|
|
27
|
-
export declare function sortResources(filteredResources: PerformanceResourceTiming[]): PerformanceResourceTiming[];
|
|
28
|
-
/**
|
|
29
|
-
* Get closest performance resource ignoring the resources that have been
|
|
30
|
-
* already used.
|
|
31
|
-
* @param spanUrl
|
|
32
|
-
* @param startTimeHR
|
|
33
|
-
* @param endTimeHR
|
|
34
|
-
* @param resources
|
|
35
|
-
* @param ignoredResources
|
|
36
|
-
* @param initiatorType
|
|
37
|
-
*/
|
|
38
|
-
export declare function getResource(spanUrl: string, startTimeHR: api.HrTime, endTimeHR: api.HrTime, resources: PerformanceResourceTiming[], ignoredResources?: WeakSet<PerformanceResourceTiming>, initiatorType?: string): PerformanceResourceTimingInfo;
|
|
39
|
-
/**
|
|
40
|
-
* Parses url using anchor element
|
|
41
|
-
* @param url
|
|
42
|
-
*/
|
|
43
|
-
export declare function parseUrl(url: string): HTMLAnchorElement;
|
|
44
|
-
/**
|
|
45
|
-
* Get element XPath
|
|
46
|
-
* @param target - target element
|
|
47
|
-
* @param optimised - when id attribute of element is present the xpath can be
|
|
48
|
-
* simplified to contain id
|
|
49
|
-
*/
|
|
50
|
-
export declare function getElementXPath(target: any, optimised?: boolean): string;
|
|
51
|
-
/**
|
|
52
|
-
* Checks if trace headers should be propagated
|
|
53
|
-
* @param spanUrl
|
|
54
|
-
* @private
|
|
55
|
-
*/
|
|
56
|
-
export declare function shouldPropagateTraceHeaders(spanUrl: string, propagateTraceHeaderCorsUrls?: PropagateTraceHeaderCorsUrls): boolean;
|
|
57
|
-
//# sourceMappingURL=utils.d.ts.map
|