@opentelemetry/auto-instrumentations-web 0.34.0 → 0.35.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/build/esm/index.d.ts +2 -0
- package/build/esm/index.js +17 -0
- package/build/esm/index.js.map +1 -0
- package/build/esm/utils.d.ts +18 -0
- package/build/esm/utils.js +57 -0
- package/build/esm/utils.js.map +1 -0
- package/build/esnext/index.d.ts +2 -0
- package/build/esnext/index.js +17 -0
- package/build/esnext/index.js.map +1 -0
- package/build/esnext/utils.d.ts +18 -0
- package/build/esnext/utils.js +54 -0
- package/build/esnext/utils.js.map +1 -0
- package/package.json +19 -12
|
@@ -0,0 +1,17 @@
|
|
|
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 { getWebAutoInstrumentations } from './utils';
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,0BAA0B,EAA4B,MAAM,SAAS,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport { getWebAutoInstrumentations, InstrumentationConfigMap } from './utils';\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Instrumentation } from '@opentelemetry/instrumentation';
|
|
2
|
+
import { DocumentLoadInstrumentation } from '@opentelemetry/instrumentation-document-load';
|
|
3
|
+
import { FetchInstrumentation } from '@opentelemetry/instrumentation-fetch';
|
|
4
|
+
import { UserInteractionInstrumentation } from '@opentelemetry/instrumentation-user-interaction';
|
|
5
|
+
import { XMLHttpRequestInstrumentation } from '@opentelemetry/instrumentation-xml-http-request';
|
|
6
|
+
declare const InstrumentationMap: {
|
|
7
|
+
'@opentelemetry/instrumentation-document-load': typeof DocumentLoadInstrumentation;
|
|
8
|
+
'@opentelemetry/instrumentation-fetch': typeof FetchInstrumentation;
|
|
9
|
+
'@opentelemetry/instrumentation-user-interaction': typeof UserInteractionInstrumentation;
|
|
10
|
+
'@opentelemetry/instrumentation-xml-http-request': typeof XMLHttpRequestInstrumentation;
|
|
11
|
+
};
|
|
12
|
+
declare type ConfigArg<T> = T extends new (...args: infer U) => unknown ? U[0] : never;
|
|
13
|
+
export declare type InstrumentationConfigMap = {
|
|
14
|
+
[Name in keyof typeof InstrumentationMap]?: ConfigArg<(typeof InstrumentationMap)[Name]>;
|
|
15
|
+
};
|
|
16
|
+
export declare function getWebAutoInstrumentations(inputConfigs?: InstrumentationConfigMap): Instrumentation[];
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1,57 @@
|
|
|
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 { diag } from '@opentelemetry/api';
|
|
17
|
+
import { DocumentLoadInstrumentation } from '@opentelemetry/instrumentation-document-load';
|
|
18
|
+
import { FetchInstrumentation } from '@opentelemetry/instrumentation-fetch';
|
|
19
|
+
import { UserInteractionInstrumentation } from '@opentelemetry/instrumentation-user-interaction';
|
|
20
|
+
import { XMLHttpRequestInstrumentation } from '@opentelemetry/instrumentation-xml-http-request';
|
|
21
|
+
var InstrumentationMap = {
|
|
22
|
+
'@opentelemetry/instrumentation-document-load': DocumentLoadInstrumentation,
|
|
23
|
+
'@opentelemetry/instrumentation-fetch': FetchInstrumentation,
|
|
24
|
+
'@opentelemetry/instrumentation-user-interaction': UserInteractionInstrumentation,
|
|
25
|
+
'@opentelemetry/instrumentation-xml-http-request': XMLHttpRequestInstrumentation,
|
|
26
|
+
};
|
|
27
|
+
export function getWebAutoInstrumentations(inputConfigs) {
|
|
28
|
+
var _a;
|
|
29
|
+
if (inputConfigs === void 0) { inputConfigs = {}; }
|
|
30
|
+
for (var _i = 0, _b = Object.keys(inputConfigs); _i < _b.length; _i++) {
|
|
31
|
+
var name_1 = _b[_i];
|
|
32
|
+
if (!Object.prototype.hasOwnProperty.call(InstrumentationMap, name_1)) {
|
|
33
|
+
diag.error("Provided instrumentation name \"" + name_1 + "\" not found");
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
var instrumentations = [];
|
|
38
|
+
for (var _c = 0, _d = Object.keys(InstrumentationMap); _c < _d.length; _c++) {
|
|
39
|
+
var name_2 = _d[_c];
|
|
40
|
+
var Instance = InstrumentationMap[name_2];
|
|
41
|
+
// Defaults are defined by the instrumentation itself
|
|
42
|
+
var userConfig = (_a = inputConfigs[name_2]) !== null && _a !== void 0 ? _a : {};
|
|
43
|
+
if (userConfig.enabled === false) {
|
|
44
|
+
diag.debug("Disabling instrumentation for " + name_2);
|
|
45
|
+
continue;
|
|
46
|
+
}
|
|
47
|
+
try {
|
|
48
|
+
diag.debug("Loading instrumentation for " + name_2);
|
|
49
|
+
instrumentations.push(new Instance(userConfig));
|
|
50
|
+
}
|
|
51
|
+
catch (e) {
|
|
52
|
+
diag.error(e);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return instrumentations;
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAK1C,OAAO,EAAE,2BAA2B,EAAE,MAAM,8CAA8C,CAAC;AAC3F,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAC5E,OAAO,EAAE,8BAA8B,EAAE,MAAM,iDAAiD,CAAC;AACjG,OAAO,EAAE,6BAA6B,EAAE,MAAM,iDAAiD,CAAC;AAEhG,IAAM,kBAAkB,GAAG;IACzB,8CAA8C,EAAE,2BAA2B;IAC3E,sCAAsC,EAAE,oBAAoB;IAC5D,iDAAiD,EAC/C,8BAA8B;IAChC,iDAAiD,EAC/C,6BAA6B;CAChC,CAAC;AAUF,MAAM,UAAU,0BAA0B,CACxC,YAA2C;;IAA3C,6BAAA,EAAA,iBAA2C;IAE3C,KAAmB,UAAyB,EAAzB,KAAA,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,EAAzB,cAAyB,EAAzB,IAAyB,EAAE;QAAzC,IAAM,MAAI,SAAA;QACb,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,kBAAkB,EAAE,MAAI,CAAC,EAAE;YACnE,IAAI,CAAC,KAAK,CAAC,qCAAkC,MAAI,iBAAa,CAAC,CAAC;YAChE,SAAS;SACV;KACF;IAED,IAAM,gBAAgB,GAAsB,EAAE,CAAC;IAE/C,KAAmB,UAElB,EAFkB,KAAA,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAEhD,EAFkB,cAElB,EAFkB,IAElB,EAAE;QAFE,IAAM,MAAI,SAAA;QAGb,IAAM,QAAQ,GAAG,kBAAkB,CAAC,MAAI,CAAC,CAAC;QAC1C,qDAAqD;QACrD,IAAM,UAAU,GAA0B,MAAA,YAAY,CAAC,MAAI,CAAC,mCAAI,EAAE,CAAC;QAEnE,IAAI,UAAU,CAAC,OAAO,KAAK,KAAK,EAAE;YAChC,IAAI,CAAC,KAAK,CAAC,mCAAiC,MAAM,CAAC,CAAC;YACpD,SAAS;SACV;QAED,IAAI;YACF,IAAI,CAAC,KAAK,CAAC,iCAA+B,MAAM,CAAC,CAAC;YAClD,gBAAgB,CAAC,IAAI,CAAC,IAAI,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC;SACjD;QAAC,OAAO,CAAM,EAAE;YACf,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;SACf;KACF;IAED,OAAO,gBAAgB,CAAC;AAC1B,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { diag } from '@opentelemetry/api';\nimport {\n Instrumentation,\n InstrumentationConfig,\n} from '@opentelemetry/instrumentation';\nimport { DocumentLoadInstrumentation } from '@opentelemetry/instrumentation-document-load';\nimport { FetchInstrumentation } from '@opentelemetry/instrumentation-fetch';\nimport { UserInteractionInstrumentation } from '@opentelemetry/instrumentation-user-interaction';\nimport { XMLHttpRequestInstrumentation } from '@opentelemetry/instrumentation-xml-http-request';\n\nconst InstrumentationMap = {\n '@opentelemetry/instrumentation-document-load': DocumentLoadInstrumentation,\n '@opentelemetry/instrumentation-fetch': FetchInstrumentation,\n '@opentelemetry/instrumentation-user-interaction':\n UserInteractionInstrumentation,\n '@opentelemetry/instrumentation-xml-http-request':\n XMLHttpRequestInstrumentation,\n};\n\n// Config types inferred automatically from the first argument of the constructor\ntype ConfigArg<T> = T extends new (...args: infer U) => unknown ? U[0] : never;\nexport type InstrumentationConfigMap = {\n [Name in keyof typeof InstrumentationMap]?: ConfigArg<\n (typeof InstrumentationMap)[Name]\n >;\n};\n\nexport function getWebAutoInstrumentations(\n inputConfigs: InstrumentationConfigMap = {}\n): Instrumentation[] {\n for (const name of Object.keys(inputConfigs)) {\n if (!Object.prototype.hasOwnProperty.call(InstrumentationMap, name)) {\n diag.error(`Provided instrumentation name \"${name}\" not found`);\n continue;\n }\n }\n\n const instrumentations: Instrumentation[] = [];\n\n for (const name of Object.keys(InstrumentationMap) as Array<\n keyof typeof InstrumentationMap\n >) {\n const Instance = InstrumentationMap[name];\n // Defaults are defined by the instrumentation itself\n const userConfig: InstrumentationConfig = inputConfigs[name] ?? {};\n\n if (userConfig.enabled === false) {\n diag.debug(`Disabling instrumentation for ${name}`);\n continue;\n }\n\n try {\n diag.debug(`Loading instrumentation for ${name}`);\n instrumentations.push(new Instance(userConfig));\n } catch (e: any) {\n diag.error(e);\n }\n }\n\n return instrumentations;\n}\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
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 { getWebAutoInstrumentations } from './utils';
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,0BAA0B,EAA4B,MAAM,SAAS,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport { getWebAutoInstrumentations, InstrumentationConfigMap } from './utils';\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Instrumentation } from '@opentelemetry/instrumentation';
|
|
2
|
+
import { DocumentLoadInstrumentation } from '@opentelemetry/instrumentation-document-load';
|
|
3
|
+
import { FetchInstrumentation } from '@opentelemetry/instrumentation-fetch';
|
|
4
|
+
import { UserInteractionInstrumentation } from '@opentelemetry/instrumentation-user-interaction';
|
|
5
|
+
import { XMLHttpRequestInstrumentation } from '@opentelemetry/instrumentation-xml-http-request';
|
|
6
|
+
declare const InstrumentationMap: {
|
|
7
|
+
'@opentelemetry/instrumentation-document-load': typeof DocumentLoadInstrumentation;
|
|
8
|
+
'@opentelemetry/instrumentation-fetch': typeof FetchInstrumentation;
|
|
9
|
+
'@opentelemetry/instrumentation-user-interaction': typeof UserInteractionInstrumentation;
|
|
10
|
+
'@opentelemetry/instrumentation-xml-http-request': typeof XMLHttpRequestInstrumentation;
|
|
11
|
+
};
|
|
12
|
+
declare type ConfigArg<T> = T extends new (...args: infer U) => unknown ? U[0] : never;
|
|
13
|
+
export declare type InstrumentationConfigMap = {
|
|
14
|
+
[Name in keyof typeof InstrumentationMap]?: ConfigArg<(typeof InstrumentationMap)[Name]>;
|
|
15
|
+
};
|
|
16
|
+
export declare function getWebAutoInstrumentations(inputConfigs?: InstrumentationConfigMap): Instrumentation[];
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1,54 @@
|
|
|
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 { diag } from '@opentelemetry/api';
|
|
17
|
+
import { DocumentLoadInstrumentation } from '@opentelemetry/instrumentation-document-load';
|
|
18
|
+
import { FetchInstrumentation } from '@opentelemetry/instrumentation-fetch';
|
|
19
|
+
import { UserInteractionInstrumentation } from '@opentelemetry/instrumentation-user-interaction';
|
|
20
|
+
import { XMLHttpRequestInstrumentation } from '@opentelemetry/instrumentation-xml-http-request';
|
|
21
|
+
const InstrumentationMap = {
|
|
22
|
+
'@opentelemetry/instrumentation-document-load': DocumentLoadInstrumentation,
|
|
23
|
+
'@opentelemetry/instrumentation-fetch': FetchInstrumentation,
|
|
24
|
+
'@opentelemetry/instrumentation-user-interaction': UserInteractionInstrumentation,
|
|
25
|
+
'@opentelemetry/instrumentation-xml-http-request': XMLHttpRequestInstrumentation,
|
|
26
|
+
};
|
|
27
|
+
export function getWebAutoInstrumentations(inputConfigs = {}) {
|
|
28
|
+
var _a;
|
|
29
|
+
for (const name of Object.keys(inputConfigs)) {
|
|
30
|
+
if (!Object.prototype.hasOwnProperty.call(InstrumentationMap, name)) {
|
|
31
|
+
diag.error(`Provided instrumentation name "${name}" not found`);
|
|
32
|
+
continue;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
const instrumentations = [];
|
|
36
|
+
for (const name of Object.keys(InstrumentationMap)) {
|
|
37
|
+
const Instance = InstrumentationMap[name];
|
|
38
|
+
// Defaults are defined by the instrumentation itself
|
|
39
|
+
const userConfig = (_a = inputConfigs[name]) !== null && _a !== void 0 ? _a : {};
|
|
40
|
+
if (userConfig.enabled === false) {
|
|
41
|
+
diag.debug(`Disabling instrumentation for ${name}`);
|
|
42
|
+
continue;
|
|
43
|
+
}
|
|
44
|
+
try {
|
|
45
|
+
diag.debug(`Loading instrumentation for ${name}`);
|
|
46
|
+
instrumentations.push(new Instance(userConfig));
|
|
47
|
+
}
|
|
48
|
+
catch (e) {
|
|
49
|
+
diag.error(e);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return instrumentations;
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAK1C,OAAO,EAAE,2BAA2B,EAAE,MAAM,8CAA8C,CAAC;AAC3F,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAC5E,OAAO,EAAE,8BAA8B,EAAE,MAAM,iDAAiD,CAAC;AACjG,OAAO,EAAE,6BAA6B,EAAE,MAAM,iDAAiD,CAAC;AAEhG,MAAM,kBAAkB,GAAG;IACzB,8CAA8C,EAAE,2BAA2B;IAC3E,sCAAsC,EAAE,oBAAoB;IAC5D,iDAAiD,EAC/C,8BAA8B;IAChC,iDAAiD,EAC/C,6BAA6B;CAChC,CAAC;AAUF,MAAM,UAAU,0BAA0B,CACxC,eAAyC,EAAE;;IAE3C,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,EAAE;QAC5C,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,kBAAkB,EAAE,IAAI,CAAC,EAAE;YACnE,IAAI,CAAC,KAAK,CAAC,kCAAkC,IAAI,aAAa,CAAC,CAAC;YAChE,SAAS;SACV;KACF;IAED,MAAM,gBAAgB,GAAsB,EAAE,CAAC;IAE/C,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAEhD,EAAE;QACD,MAAM,QAAQ,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAC;QAC1C,qDAAqD;QACrD,MAAM,UAAU,GAA0B,MAAA,YAAY,CAAC,IAAI,CAAC,mCAAI,EAAE,CAAC;QAEnE,IAAI,UAAU,CAAC,OAAO,KAAK,KAAK,EAAE;YAChC,IAAI,CAAC,KAAK,CAAC,iCAAiC,IAAI,EAAE,CAAC,CAAC;YACpD,SAAS;SACV;QAED,IAAI;YACF,IAAI,CAAC,KAAK,CAAC,+BAA+B,IAAI,EAAE,CAAC,CAAC;YAClD,gBAAgB,CAAC,IAAI,CAAC,IAAI,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC;SACjD;QAAC,OAAO,CAAM,EAAE;YACf,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;SACf;KACF;IAED,OAAO,gBAAgB,CAAC;AAC1B,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { diag } from '@opentelemetry/api';\nimport {\n Instrumentation,\n InstrumentationConfig,\n} from '@opentelemetry/instrumentation';\nimport { DocumentLoadInstrumentation } from '@opentelemetry/instrumentation-document-load';\nimport { FetchInstrumentation } from '@opentelemetry/instrumentation-fetch';\nimport { UserInteractionInstrumentation } from '@opentelemetry/instrumentation-user-interaction';\nimport { XMLHttpRequestInstrumentation } from '@opentelemetry/instrumentation-xml-http-request';\n\nconst InstrumentationMap = {\n '@opentelemetry/instrumentation-document-load': DocumentLoadInstrumentation,\n '@opentelemetry/instrumentation-fetch': FetchInstrumentation,\n '@opentelemetry/instrumentation-user-interaction':\n UserInteractionInstrumentation,\n '@opentelemetry/instrumentation-xml-http-request':\n XMLHttpRequestInstrumentation,\n};\n\n// Config types inferred automatically from the first argument of the constructor\ntype ConfigArg<T> = T extends new (...args: infer U) => unknown ? U[0] : never;\nexport type InstrumentationConfigMap = {\n [Name in keyof typeof InstrumentationMap]?: ConfigArg<\n (typeof InstrumentationMap)[Name]\n >;\n};\n\nexport function getWebAutoInstrumentations(\n inputConfigs: InstrumentationConfigMap = {}\n): Instrumentation[] {\n for (const name of Object.keys(inputConfigs)) {\n if (!Object.prototype.hasOwnProperty.call(InstrumentationMap, name)) {\n diag.error(`Provided instrumentation name \"${name}\" not found`);\n continue;\n }\n }\n\n const instrumentations: Instrumentation[] = [];\n\n for (const name of Object.keys(InstrumentationMap) as Array<\n keyof typeof InstrumentationMap\n >) {\n const Instance = InstrumentationMap[name];\n // Defaults are defined by the instrumentation itself\n const userConfig: InstrumentationConfig = inputConfigs[name] ?? {};\n\n if (userConfig.enabled === false) {\n diag.debug(`Disabling instrumentation for ${name}`);\n continue;\n }\n\n try {\n diag.debug(`Loading instrumentation for ${name}`);\n instrumentations.push(new Instance(userConfig));\n } catch (e: any) {\n diag.error(e);\n }\n }\n\n return instrumentations;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opentelemetry/auto-instrumentations-web",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.35.0",
|
|
4
4
|
"description": "Metapackage which bundles opentelemetry node core and contrib instrumentations",
|
|
5
5
|
"author": "OpenTelemetry Authors",
|
|
6
6
|
"homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/metapackages/auto-instrumentations-web#readme",
|
|
@@ -13,18 +13,19 @@
|
|
|
13
13
|
},
|
|
14
14
|
"main": "build/src/index.js",
|
|
15
15
|
"module": "build/esm/index.js",
|
|
16
|
+
"esnext": "build/esnext/index.js",
|
|
16
17
|
"types": "build/src/index.d.ts",
|
|
17
18
|
"repository": "open-telemetry/opentelemetry-js-contrib",
|
|
18
19
|
"scripts": {
|
|
19
|
-
"clean": "tsc --build --clean tsconfig.json tsconfig.esm.json",
|
|
20
|
-
"compile": "tsc --build tsconfig.json tsconfig.esm.json",
|
|
20
|
+
"clean": "tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json",
|
|
21
|
+
"compile": "tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json",
|
|
21
22
|
"lint": "eslint . --ext .ts",
|
|
22
23
|
"lint:fix": "eslint . --ext .ts --fix",
|
|
23
24
|
"precompile": "tsc --version && lerna run version:update --scope @opentelemetry/auto-instrumentations-web --include-dependencies",
|
|
24
25
|
"prewatch": "npm run precompile",
|
|
25
|
-
"
|
|
26
|
+
"prepublishOnly": "npm run compile",
|
|
26
27
|
"test:browser": "nyc karma start --single-run",
|
|
27
|
-
"watch": "tsc --build --watch tsconfig.json tsconfig.esm.json"
|
|
28
|
+
"watch": "tsc --build --watch tsconfig.json tsconfig.esm.json tsconfig.esnext.json"
|
|
28
29
|
},
|
|
29
30
|
"bugs": {
|
|
30
31
|
"url": "https://github.com/open-telemetry/opentelemetry-js-contrib/issues"
|
|
@@ -60,16 +61,22 @@
|
|
|
60
61
|
"webpack-merge": "5.8.0"
|
|
61
62
|
},
|
|
62
63
|
"dependencies": {
|
|
63
|
-
"@opentelemetry/instrumentation": "^0.
|
|
64
|
-
"@opentelemetry/instrumentation-document-load": "^0.34.
|
|
65
|
-
"@opentelemetry/instrumentation-fetch": "^0.
|
|
66
|
-
"@opentelemetry/instrumentation-user-interaction": "^0.34.
|
|
67
|
-
"@opentelemetry/instrumentation-xml-http-request": "^0.
|
|
64
|
+
"@opentelemetry/instrumentation": "^0.46.0",
|
|
65
|
+
"@opentelemetry/instrumentation-document-load": "^0.34.1",
|
|
66
|
+
"@opentelemetry/instrumentation-fetch": "^0.46.0",
|
|
67
|
+
"@opentelemetry/instrumentation-user-interaction": "^0.34.1",
|
|
68
|
+
"@opentelemetry/instrumentation-xml-http-request": "^0.46.0"
|
|
68
69
|
},
|
|
69
70
|
"files": [
|
|
70
71
|
"build/src/**/*.js",
|
|
71
72
|
"build/src/**/*.js.map",
|
|
72
|
-
"build/src/**/*.d.ts"
|
|
73
|
+
"build/src/**/*.d.ts",
|
|
74
|
+
"build/esm/**/*.js",
|
|
75
|
+
"build/esm/**/*.js.map",
|
|
76
|
+
"build/esm/**/*.d.ts",
|
|
77
|
+
"build/esnext/**/*.js",
|
|
78
|
+
"build/esnext/**/*.js.map",
|
|
79
|
+
"build/esnext/**/*.d.ts"
|
|
73
80
|
],
|
|
74
|
-
"gitHead": "
|
|
81
|
+
"gitHead": "90928231259bbbdf6980f184bc7420503048b77e"
|
|
75
82
|
}
|