@opentelemetry/opentelemetry-browser-detector 0.217.0 → 0.219.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/BrowserDetector.js +9 -10
- package/build/esm/BrowserDetector.js.map +1 -1
- package/build/esm/semconv.d.ts +45 -0
- package/build/esm/semconv.js +49 -0
- package/build/esm/semconv.js.map +1 -0
- package/build/esm/types.d.ts +0 -7
- package/build/esm/types.js +5 -7
- package/build/esm/types.js.map +1 -1
- package/build/esm/version.d.ts +1 -1
- package/build/esm/version.js +1 -1
- package/build/esm/version.js.map +1 -1
- package/build/esnext/BrowserDetector.js +9 -10
- package/build/esnext/BrowserDetector.js.map +1 -1
- package/build/esnext/semconv.d.ts +45 -0
- package/build/esnext/semconv.js +49 -0
- package/build/esnext/semconv.js.map +1 -0
- package/build/esnext/types.d.ts +0 -7
- package/build/esnext/types.js +5 -7
- package/build/esnext/types.js.map +1 -1
- package/build/esnext/version.d.ts +1 -1
- package/build/esnext/version.js +1 -1
- package/build/esnext/version.js.map +1 -1
- package/build/src/BrowserDetector.js +9 -10
- package/build/src/BrowserDetector.js.map +1 -1
- package/build/src/semconv.d.ts +45 -0
- package/build/src/semconv.js +52 -0
- package/build/src/semconv.js.map +1 -0
- package/build/src/types.d.ts +0 -7
- package/build/src/types.js +4 -8
- package/build/src/types.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 +10 -9
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { diag } from '@opentelemetry/api';
|
|
6
6
|
import { emptyResource } from '@opentelemetry/resources';
|
|
7
|
-
import {
|
|
7
|
+
import { ATTR_USER_AGENT_ORIGINAL } from '@opentelemetry/semantic-conventions';
|
|
8
|
+
import { ATTR_BROWSER_LANGUAGE, ATTR_BROWSER_PLATFORM, ATTR_BROWSER_BRANDS, ATTR_BROWSER_MOBILE, } from './semconv';
|
|
8
9
|
/**
|
|
9
10
|
* BrowserDetector will be used to detect the resources related to browser.
|
|
10
11
|
*/
|
|
@@ -25,8 +26,8 @@ class BrowserDetector {
|
|
|
25
26
|
* @returns The sanitized resource attributes.
|
|
26
27
|
*/
|
|
27
28
|
_getResourceAttributes(browserResource, _config) {
|
|
28
|
-
if (!browserResource[
|
|
29
|
-
!browserResource[
|
|
29
|
+
if (!browserResource[ATTR_USER_AGENT_ORIGINAL] &&
|
|
30
|
+
!browserResource[ATTR_BROWSER_PLATFORM]) {
|
|
30
31
|
diag.debug('BrowserDetector failed: Unable to find required browser resources. ');
|
|
31
32
|
return emptyResource();
|
|
32
33
|
}
|
|
@@ -40,14 +41,12 @@ function getBrowserAttributes() {
|
|
|
40
41
|
const browserAttribs = {};
|
|
41
42
|
const userAgentData = navigator.userAgentData;
|
|
42
43
|
if (userAgentData) {
|
|
43
|
-
browserAttribs[
|
|
44
|
-
browserAttribs[
|
|
45
|
-
browserAttribs[
|
|
44
|
+
browserAttribs[ATTR_BROWSER_PLATFORM] = userAgentData.platform;
|
|
45
|
+
browserAttribs[ATTR_BROWSER_BRANDS] = userAgentData.brands.map(b => `${b.brand} ${b.version}`);
|
|
46
|
+
browserAttribs[ATTR_BROWSER_MOBILE] = userAgentData.mobile;
|
|
46
47
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
50
|
-
browserAttribs[BROWSER_ATTRIBUTES.LANGUAGE] = navigator.language;
|
|
48
|
+
browserAttribs[ATTR_USER_AGENT_ORIGINAL] = navigator.userAgent;
|
|
49
|
+
browserAttribs[ATTR_BROWSER_LANGUAGE] = navigator.language;
|
|
51
50
|
return browserAttribs;
|
|
52
51
|
}
|
|
53
52
|
export const browserDetector = new BrowserDetector();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BrowserDetector.js","sourceRoot":"","sources":["../../src/BrowserDetector.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAM1C,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"BrowserDetector.js","sourceRoot":"","sources":["../../src/BrowserDetector.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAM1C,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAE/E,OAAO,EACL,qBAAqB,EACrB,qBAAqB,EACrB,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,WAAW,CAAC;AAEnB;;GAEG;AACH,MAAM,eAAe;IACnB,MAAM,CAAC,MAAgC;QACrC,MAAM,SAAS,GACb,OAAO,MAAM,KAAK,WAAW,IAAI,OAAO,QAAQ,KAAK,WAAW,CAAC;QAEnE,IAAI,CAAC,SAAS,EAAE;YACd,OAAO,aAAa,EAAE,CAAC;SACxB;QACD,MAAM,eAAe,GAAe,oBAAoB,EAAE,CAAC;QAC3D,OAAO,IAAI,CAAC,sBAAsB,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;IAC9D,CAAC;IACD;;;;;;OAMG;IACK,sBAAsB,CAC5B,eAA2B,EAC3B,OAAiC;QAEjC,IACE,CAAC,eAAe,CAAC,wBAAwB,CAAC;YAC1C,CAAC,eAAe,CAAC,qBAAqB,CAAC,EACvC;YACA,IAAI,CAAC,KAAK,CACR,qEAAqE,CACtE,CAAC;YACF,OAAO,aAAa,EAAE,CAAC;SACxB;aAAM;YACL,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,CAAC;SACxC;IACH,CAAC;CACF;AAED,8CAA8C;AAC9C,SAAS,oBAAoB;IAC3B,MAAM,cAAc,GAAe,EAAE,CAAC;IACtC,MAAM,aAAa,GACjB,SACD,CAAC,aAAa,CAAC;IAChB,IAAI,aAAa,EAAE;QACjB,cAAc,CAAC,qBAAqB,CAAC,GAAG,aAAa,CAAC,QAAQ,CAAC;QAC/D,cAAc,CAAC,mBAAmB,CAAC,GAAG,aAAa,CAAC,MAAM,CAAC,GAAG,CAC5D,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,OAAO,EAAE,CAC/B,CAAC;QACF,cAAc,CAAC,mBAAmB,CAAC,GAAG,aAAa,CAAC,MAAM,CAAC;KAC5D;IACD,cAAc,CAAC,wBAAwB,CAAC,GAAG,SAAS,CAAC,SAAS,CAAC;IAC/D,cAAc,CAAC,qBAAqB,CAAC,GAAG,SAAS,CAAC,QAAQ,CAAC;IAC3D,OAAO,cAAc,CAAC;AACxB,CAAC;AAED,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,eAAe,EAAE,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { Attributes } from '@opentelemetry/api';\nimport { diag } from '@opentelemetry/api';\nimport type {\n DetectedResource,\n ResourceDetector,\n ResourceDetectionConfig,\n} from '@opentelemetry/resources';\nimport { emptyResource } from '@opentelemetry/resources';\nimport { ATTR_USER_AGENT_ORIGINAL } from '@opentelemetry/semantic-conventions';\nimport type { UserAgentData } from './types';\nimport {\n ATTR_BROWSER_LANGUAGE,\n ATTR_BROWSER_PLATFORM,\n ATTR_BROWSER_BRANDS,\n ATTR_BROWSER_MOBILE,\n} from './semconv';\n\n/**\n * BrowserDetector will be used to detect the resources related to browser.\n */\nclass BrowserDetector implements ResourceDetector {\n detect(config?: ResourceDetectionConfig): DetectedResource {\n const isBrowser =\n typeof window !== 'undefined' && typeof document !== 'undefined';\n\n if (!isBrowser) {\n return emptyResource();\n }\n const browserResource: Attributes = getBrowserAttributes();\n return this._getResourceAttributes(browserResource, config);\n }\n /**\n * Validates browser resource attribute map from browser variables\n *\n * @param browserResource The un-sanitized resource attributes from browser as key/value pairs.\n * @param config: Config\n * @returns The sanitized resource attributes.\n */\n private _getResourceAttributes(\n browserResource: Attributes,\n _config?: ResourceDetectionConfig\n ): DetectedResource {\n if (\n !browserResource[ATTR_USER_AGENT_ORIGINAL] &&\n !browserResource[ATTR_BROWSER_PLATFORM]\n ) {\n diag.debug(\n 'BrowserDetector failed: Unable to find required browser resources. '\n );\n return emptyResource();\n } else {\n return { attributes: browserResource };\n }\n }\n}\n\n// Add Browser related attributes to resources\nfunction getBrowserAttributes(): Attributes {\n const browserAttribs: Attributes = {};\n const userAgentData = (\n navigator as Navigator & { userAgentData?: UserAgentData }\n ).userAgentData;\n if (userAgentData) {\n browserAttribs[ATTR_BROWSER_PLATFORM] = userAgentData.platform;\n browserAttribs[ATTR_BROWSER_BRANDS] = userAgentData.brands.map(\n b => `${b.brand} ${b.version}`\n );\n browserAttribs[ATTR_BROWSER_MOBILE] = userAgentData.mobile;\n }\n browserAttribs[ATTR_USER_AGENT_ORIGINAL] = navigator.userAgent;\n browserAttribs[ATTR_BROWSER_LANGUAGE] = navigator.language;\n return browserAttribs;\n}\n\nexport const browserDetector = new BrowserDetector();\n"]}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Array of brand name and version separated by a space
|
|
3
|
+
*
|
|
4
|
+
* @example [" Not A;Brand 99", "Chromium 99", "Chrome 99"]
|
|
5
|
+
*
|
|
6
|
+
* @note This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`navigator.userAgentData.brands`).
|
|
7
|
+
*
|
|
8
|
+
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
|
|
9
|
+
*/
|
|
10
|
+
export declare const ATTR_BROWSER_BRANDS: "browser.brands";
|
|
11
|
+
/**
|
|
12
|
+
* Preferred language of the user using the browser
|
|
13
|
+
*
|
|
14
|
+
* @example en
|
|
15
|
+
* @example en-US
|
|
16
|
+
* @example fr
|
|
17
|
+
* @example fr-FR
|
|
18
|
+
*
|
|
19
|
+
* @note This value is intended to be taken from the Navigator API `navigator.language`.
|
|
20
|
+
*
|
|
21
|
+
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
|
|
22
|
+
*/
|
|
23
|
+
export declare const ATTR_BROWSER_LANGUAGE: "browser.language";
|
|
24
|
+
/**
|
|
25
|
+
* A boolean that is true if the browser is running on a mobile device
|
|
26
|
+
*
|
|
27
|
+
* @note This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`navigator.userAgentData.mobile`). If unavailable, this attribute **SHOULD** be left unset.
|
|
28
|
+
*
|
|
29
|
+
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
|
|
30
|
+
*/
|
|
31
|
+
export declare const ATTR_BROWSER_MOBILE: "browser.mobile";
|
|
32
|
+
/**
|
|
33
|
+
* The platform on which the browser is running
|
|
34
|
+
*
|
|
35
|
+
* @example Windows
|
|
36
|
+
* @example macOS
|
|
37
|
+
* @example Android
|
|
38
|
+
*
|
|
39
|
+
* @note This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`navigator.userAgentData.platform`). If unavailable, the legacy `navigator.platform` API **SHOULD NOT** be used instead and this attribute **SHOULD** be left unset in order for the values to be consistent.
|
|
40
|
+
* The list of possible values is defined in the [W3C User-Agent Client Hints specification](https://wicg.github.io/ua-client-hints/#sec-ch-ua-platform). Note that some (but not all) of these values can overlap with values in the [`os.type` and `os.name` attributes](./os.md). However, for consistency, the values in the `browser.platform` attribute should capture the exact value that the user agent provides.
|
|
41
|
+
*
|
|
42
|
+
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
|
|
43
|
+
*/
|
|
44
|
+
export declare const ATTR_BROWSER_PLATFORM: "browser.platform";
|
|
45
|
+
//# sourceMappingURL=semconv.d.ts.map
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright The OpenTelemetry Authors
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Array of brand name and version separated by a space
|
|
7
|
+
*
|
|
8
|
+
* @example [" Not A;Brand 99", "Chromium 99", "Chrome 99"]
|
|
9
|
+
*
|
|
10
|
+
* @note This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`navigator.userAgentData.brands`).
|
|
11
|
+
*
|
|
12
|
+
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
|
|
13
|
+
*/
|
|
14
|
+
export const ATTR_BROWSER_BRANDS = 'browser.brands';
|
|
15
|
+
/**
|
|
16
|
+
* Preferred language of the user using the browser
|
|
17
|
+
*
|
|
18
|
+
* @example en
|
|
19
|
+
* @example en-US
|
|
20
|
+
* @example fr
|
|
21
|
+
* @example fr-FR
|
|
22
|
+
*
|
|
23
|
+
* @note This value is intended to be taken from the Navigator API `navigator.language`.
|
|
24
|
+
*
|
|
25
|
+
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
|
|
26
|
+
*/
|
|
27
|
+
export const ATTR_BROWSER_LANGUAGE = 'browser.language';
|
|
28
|
+
/**
|
|
29
|
+
* A boolean that is true if the browser is running on a mobile device
|
|
30
|
+
*
|
|
31
|
+
* @note This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`navigator.userAgentData.mobile`). If unavailable, this attribute **SHOULD** be left unset.
|
|
32
|
+
*
|
|
33
|
+
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
|
|
34
|
+
*/
|
|
35
|
+
export const ATTR_BROWSER_MOBILE = 'browser.mobile';
|
|
36
|
+
/**
|
|
37
|
+
* The platform on which the browser is running
|
|
38
|
+
*
|
|
39
|
+
* @example Windows
|
|
40
|
+
* @example macOS
|
|
41
|
+
* @example Android
|
|
42
|
+
*
|
|
43
|
+
* @note This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`navigator.userAgentData.platform`). If unavailable, the legacy `navigator.platform` API **SHOULD NOT** be used instead and this attribute **SHOULD** be left unset in order for the values to be consistent.
|
|
44
|
+
* The list of possible values is defined in the [W3C User-Agent Client Hints specification](https://wicg.github.io/ua-client-hints/#sec-ch-ua-platform). Note that some (but not all) of these values can overlap with values in the [`os.type` and `os.name` attributes](./os.md). However, for consistency, the values in the `browser.platform` attribute should capture the exact value that the user agent provides.
|
|
45
|
+
*
|
|
46
|
+
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
|
|
47
|
+
*/
|
|
48
|
+
export const ATTR_BROWSER_PLATFORM = 'browser.platform';
|
|
49
|
+
//# sourceMappingURL=semconv.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"semconv.js","sourceRoot":"","sources":["../../src/semconv.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,gBAAyB,CAAC;AAE7D;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,kBAA2B,CAAC;AAEjE;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,gBAAyB,CAAC;AAE7D;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,kBAA2B,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * Array of brand name and version separated by a space\n *\n * @example [\" Not A;Brand 99\", \"Chromium 99\", \"Chrome 99\"]\n *\n * @note This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`navigator.userAgentData.brands`).\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_BROWSER_BRANDS = 'browser.brands' as const;\n\n/**\n * Preferred language of the user using the browser\n *\n * @example en\n * @example en-US\n * @example fr\n * @example fr-FR\n *\n * @note This value is intended to be taken from the Navigator API `navigator.language`.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_BROWSER_LANGUAGE = 'browser.language' as const;\n\n/**\n * A boolean that is true if the browser is running on a mobile device\n *\n * @note This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`navigator.userAgentData.mobile`). If unavailable, this attribute **SHOULD** be left unset.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_BROWSER_MOBILE = 'browser.mobile' as const;\n\n/**\n * The platform on which the browser is running\n *\n * @example Windows\n * @example macOS\n * @example Android\n *\n * @note This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`navigator.userAgentData.platform`). If unavailable, the legacy `navigator.platform` API **SHOULD NOT** be used instead and this attribute **SHOULD** be left unset in order for the values to be consistent.\n * The list of possible values is defined in the [W3C User-Agent Client Hints specification](https://wicg.github.io/ua-client-hints/#sec-ch-ua-platform). Note that some (but not all) of these values can overlap with values in the [`os.type` and `os.name` attributes](./os.md). However, for consistency, the values in the `browser.platform` attribute should capture the exact value that the user agent provides.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_BROWSER_PLATFORM = 'browser.platform' as const;\n"]}
|
package/build/esm/types.d.ts
CHANGED
|
@@ -6,11 +6,4 @@ export type UserAgentData = {
|
|
|
6
6
|
platform: string;
|
|
7
7
|
mobile: boolean;
|
|
8
8
|
};
|
|
9
|
-
export declare const BROWSER_ATTRIBUTES: {
|
|
10
|
-
PLATFORM: string;
|
|
11
|
-
BRANDS: string;
|
|
12
|
-
MOBILE: string;
|
|
13
|
-
LANGUAGE: string;
|
|
14
|
-
USER_AGENT: string;
|
|
15
|
-
};
|
|
16
9
|
//# sourceMappingURL=types.d.ts.map
|
package/build/esm/types.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
USER_AGENT: 'browser.user_agent',
|
|
7
|
-
};
|
|
1
|
+
/*
|
|
2
|
+
* Copyright The OpenTelemetry Authors
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
export {};
|
|
8
6
|
//# sourceMappingURL=types.js.map
|
package/build/esm/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport type UserAgentData = {\n brands: { brand: string; version: string }[];\n platform: string;\n mobile: boolean;\n};\n"]}
|
package/build/esm/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.219.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/build/esm/version.js
CHANGED
package/build/esm/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,4DAA4D;AAC5D,MAAM,CAAC,MAAM,OAAO,GAAG,SAAS,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\n// this is autogenerated file, see scripts/version-update.js\nexport const VERSION = '0.
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,4DAA4D;AAC5D,MAAM,CAAC,MAAM,OAAO,GAAG,SAAS,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\n// this is autogenerated file, see scripts/version-update.js\nexport const VERSION = '0.219.0';\n"]}
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { diag } from '@opentelemetry/api';
|
|
6
6
|
import { emptyResource } from '@opentelemetry/resources';
|
|
7
|
-
import {
|
|
7
|
+
import { ATTR_USER_AGENT_ORIGINAL } from '@opentelemetry/semantic-conventions';
|
|
8
|
+
import { ATTR_BROWSER_LANGUAGE, ATTR_BROWSER_PLATFORM, ATTR_BROWSER_BRANDS, ATTR_BROWSER_MOBILE, } from './semconv';
|
|
8
9
|
/**
|
|
9
10
|
* BrowserDetector will be used to detect the resources related to browser.
|
|
10
11
|
*/
|
|
@@ -25,8 +26,8 @@ class BrowserDetector {
|
|
|
25
26
|
* @returns The sanitized resource attributes.
|
|
26
27
|
*/
|
|
27
28
|
_getResourceAttributes(browserResource, _config) {
|
|
28
|
-
if (!browserResource[
|
|
29
|
-
!browserResource[
|
|
29
|
+
if (!browserResource[ATTR_USER_AGENT_ORIGINAL] &&
|
|
30
|
+
!browserResource[ATTR_BROWSER_PLATFORM]) {
|
|
30
31
|
diag.debug('BrowserDetector failed: Unable to find required browser resources. ');
|
|
31
32
|
return emptyResource();
|
|
32
33
|
}
|
|
@@ -40,14 +41,12 @@ function getBrowserAttributes() {
|
|
|
40
41
|
const browserAttribs = {};
|
|
41
42
|
const userAgentData = navigator.userAgentData;
|
|
42
43
|
if (userAgentData) {
|
|
43
|
-
browserAttribs[
|
|
44
|
-
browserAttribs[
|
|
45
|
-
browserAttribs[
|
|
44
|
+
browserAttribs[ATTR_BROWSER_PLATFORM] = userAgentData.platform;
|
|
45
|
+
browserAttribs[ATTR_BROWSER_BRANDS] = userAgentData.brands.map(b => `${b.brand} ${b.version}`);
|
|
46
|
+
browserAttribs[ATTR_BROWSER_MOBILE] = userAgentData.mobile;
|
|
46
47
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
50
|
-
browserAttribs[BROWSER_ATTRIBUTES.LANGUAGE] = navigator.language;
|
|
48
|
+
browserAttribs[ATTR_USER_AGENT_ORIGINAL] = navigator.userAgent;
|
|
49
|
+
browserAttribs[ATTR_BROWSER_LANGUAGE] = navigator.language;
|
|
51
50
|
return browserAttribs;
|
|
52
51
|
}
|
|
53
52
|
export const browserDetector = new BrowserDetector();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BrowserDetector.js","sourceRoot":"","sources":["../../src/BrowserDetector.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAM1C,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"BrowserDetector.js","sourceRoot":"","sources":["../../src/BrowserDetector.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAM1C,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAE/E,OAAO,EACL,qBAAqB,EACrB,qBAAqB,EACrB,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,WAAW,CAAC;AAEnB;;GAEG;AACH,MAAM,eAAe;IACnB,MAAM,CAAC,MAAgC;QACrC,MAAM,SAAS,GACb,OAAO,MAAM,KAAK,WAAW,IAAI,OAAO,QAAQ,KAAK,WAAW,CAAC;QAEnE,IAAI,CAAC,SAAS,EAAE;YACd,OAAO,aAAa,EAAE,CAAC;SACxB;QACD,MAAM,eAAe,GAAe,oBAAoB,EAAE,CAAC;QAC3D,OAAO,IAAI,CAAC,sBAAsB,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;IAC9D,CAAC;IACD;;;;;;OAMG;IACK,sBAAsB,CAC5B,eAA2B,EAC3B,OAAiC;QAEjC,IACE,CAAC,eAAe,CAAC,wBAAwB,CAAC;YAC1C,CAAC,eAAe,CAAC,qBAAqB,CAAC,EACvC;YACA,IAAI,CAAC,KAAK,CACR,qEAAqE,CACtE,CAAC;YACF,OAAO,aAAa,EAAE,CAAC;SACxB;aAAM;YACL,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,CAAC;SACxC;IACH,CAAC;CACF;AAED,8CAA8C;AAC9C,SAAS,oBAAoB;IAC3B,MAAM,cAAc,GAAe,EAAE,CAAC;IACtC,MAAM,aAAa,GACjB,SACD,CAAC,aAAa,CAAC;IAChB,IAAI,aAAa,EAAE;QACjB,cAAc,CAAC,qBAAqB,CAAC,GAAG,aAAa,CAAC,QAAQ,CAAC;QAC/D,cAAc,CAAC,mBAAmB,CAAC,GAAG,aAAa,CAAC,MAAM,CAAC,GAAG,CAC5D,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,OAAO,EAAE,CAC/B,CAAC;QACF,cAAc,CAAC,mBAAmB,CAAC,GAAG,aAAa,CAAC,MAAM,CAAC;KAC5D;IACD,cAAc,CAAC,wBAAwB,CAAC,GAAG,SAAS,CAAC,SAAS,CAAC;IAC/D,cAAc,CAAC,qBAAqB,CAAC,GAAG,SAAS,CAAC,QAAQ,CAAC;IAC3D,OAAO,cAAc,CAAC;AACxB,CAAC;AAED,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,eAAe,EAAE,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { Attributes } from '@opentelemetry/api';\nimport { diag } from '@opentelemetry/api';\nimport type {\n DetectedResource,\n ResourceDetector,\n ResourceDetectionConfig,\n} from '@opentelemetry/resources';\nimport { emptyResource } from '@opentelemetry/resources';\nimport { ATTR_USER_AGENT_ORIGINAL } from '@opentelemetry/semantic-conventions';\nimport type { UserAgentData } from './types';\nimport {\n ATTR_BROWSER_LANGUAGE,\n ATTR_BROWSER_PLATFORM,\n ATTR_BROWSER_BRANDS,\n ATTR_BROWSER_MOBILE,\n} from './semconv';\n\n/**\n * BrowserDetector will be used to detect the resources related to browser.\n */\nclass BrowserDetector implements ResourceDetector {\n detect(config?: ResourceDetectionConfig): DetectedResource {\n const isBrowser =\n typeof window !== 'undefined' && typeof document !== 'undefined';\n\n if (!isBrowser) {\n return emptyResource();\n }\n const browserResource: Attributes = getBrowserAttributes();\n return this._getResourceAttributes(browserResource, config);\n }\n /**\n * Validates browser resource attribute map from browser variables\n *\n * @param browserResource The un-sanitized resource attributes from browser as key/value pairs.\n * @param config: Config\n * @returns The sanitized resource attributes.\n */\n private _getResourceAttributes(\n browserResource: Attributes,\n _config?: ResourceDetectionConfig\n ): DetectedResource {\n if (\n !browserResource[ATTR_USER_AGENT_ORIGINAL] &&\n !browserResource[ATTR_BROWSER_PLATFORM]\n ) {\n diag.debug(\n 'BrowserDetector failed: Unable to find required browser resources. '\n );\n return emptyResource();\n } else {\n return { attributes: browserResource };\n }\n }\n}\n\n// Add Browser related attributes to resources\nfunction getBrowserAttributes(): Attributes {\n const browserAttribs: Attributes = {};\n const userAgentData = (\n navigator as Navigator & { userAgentData?: UserAgentData }\n ).userAgentData;\n if (userAgentData) {\n browserAttribs[ATTR_BROWSER_PLATFORM] = userAgentData.platform;\n browserAttribs[ATTR_BROWSER_BRANDS] = userAgentData.brands.map(\n b => `${b.brand} ${b.version}`\n );\n browserAttribs[ATTR_BROWSER_MOBILE] = userAgentData.mobile;\n }\n browserAttribs[ATTR_USER_AGENT_ORIGINAL] = navigator.userAgent;\n browserAttribs[ATTR_BROWSER_LANGUAGE] = navigator.language;\n return browserAttribs;\n}\n\nexport const browserDetector = new BrowserDetector();\n"]}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Array of brand name and version separated by a space
|
|
3
|
+
*
|
|
4
|
+
* @example [" Not A;Brand 99", "Chromium 99", "Chrome 99"]
|
|
5
|
+
*
|
|
6
|
+
* @note This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`navigator.userAgentData.brands`).
|
|
7
|
+
*
|
|
8
|
+
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
|
|
9
|
+
*/
|
|
10
|
+
export declare const ATTR_BROWSER_BRANDS: "browser.brands";
|
|
11
|
+
/**
|
|
12
|
+
* Preferred language of the user using the browser
|
|
13
|
+
*
|
|
14
|
+
* @example en
|
|
15
|
+
* @example en-US
|
|
16
|
+
* @example fr
|
|
17
|
+
* @example fr-FR
|
|
18
|
+
*
|
|
19
|
+
* @note This value is intended to be taken from the Navigator API `navigator.language`.
|
|
20
|
+
*
|
|
21
|
+
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
|
|
22
|
+
*/
|
|
23
|
+
export declare const ATTR_BROWSER_LANGUAGE: "browser.language";
|
|
24
|
+
/**
|
|
25
|
+
* A boolean that is true if the browser is running on a mobile device
|
|
26
|
+
*
|
|
27
|
+
* @note This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`navigator.userAgentData.mobile`). If unavailable, this attribute **SHOULD** be left unset.
|
|
28
|
+
*
|
|
29
|
+
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
|
|
30
|
+
*/
|
|
31
|
+
export declare const ATTR_BROWSER_MOBILE: "browser.mobile";
|
|
32
|
+
/**
|
|
33
|
+
* The platform on which the browser is running
|
|
34
|
+
*
|
|
35
|
+
* @example Windows
|
|
36
|
+
* @example macOS
|
|
37
|
+
* @example Android
|
|
38
|
+
*
|
|
39
|
+
* @note This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`navigator.userAgentData.platform`). If unavailable, the legacy `navigator.platform` API **SHOULD NOT** be used instead and this attribute **SHOULD** be left unset in order for the values to be consistent.
|
|
40
|
+
* The list of possible values is defined in the [W3C User-Agent Client Hints specification](https://wicg.github.io/ua-client-hints/#sec-ch-ua-platform). Note that some (but not all) of these values can overlap with values in the [`os.type` and `os.name` attributes](./os.md). However, for consistency, the values in the `browser.platform` attribute should capture the exact value that the user agent provides.
|
|
41
|
+
*
|
|
42
|
+
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
|
|
43
|
+
*/
|
|
44
|
+
export declare const ATTR_BROWSER_PLATFORM: "browser.platform";
|
|
45
|
+
//# sourceMappingURL=semconv.d.ts.map
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright The OpenTelemetry Authors
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Array of brand name and version separated by a space
|
|
7
|
+
*
|
|
8
|
+
* @example [" Not A;Brand 99", "Chromium 99", "Chrome 99"]
|
|
9
|
+
*
|
|
10
|
+
* @note This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`navigator.userAgentData.brands`).
|
|
11
|
+
*
|
|
12
|
+
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
|
|
13
|
+
*/
|
|
14
|
+
export const ATTR_BROWSER_BRANDS = 'browser.brands';
|
|
15
|
+
/**
|
|
16
|
+
* Preferred language of the user using the browser
|
|
17
|
+
*
|
|
18
|
+
* @example en
|
|
19
|
+
* @example en-US
|
|
20
|
+
* @example fr
|
|
21
|
+
* @example fr-FR
|
|
22
|
+
*
|
|
23
|
+
* @note This value is intended to be taken from the Navigator API `navigator.language`.
|
|
24
|
+
*
|
|
25
|
+
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
|
|
26
|
+
*/
|
|
27
|
+
export const ATTR_BROWSER_LANGUAGE = 'browser.language';
|
|
28
|
+
/**
|
|
29
|
+
* A boolean that is true if the browser is running on a mobile device
|
|
30
|
+
*
|
|
31
|
+
* @note This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`navigator.userAgentData.mobile`). If unavailable, this attribute **SHOULD** be left unset.
|
|
32
|
+
*
|
|
33
|
+
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
|
|
34
|
+
*/
|
|
35
|
+
export const ATTR_BROWSER_MOBILE = 'browser.mobile';
|
|
36
|
+
/**
|
|
37
|
+
* The platform on which the browser is running
|
|
38
|
+
*
|
|
39
|
+
* @example Windows
|
|
40
|
+
* @example macOS
|
|
41
|
+
* @example Android
|
|
42
|
+
*
|
|
43
|
+
* @note This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`navigator.userAgentData.platform`). If unavailable, the legacy `navigator.platform` API **SHOULD NOT** be used instead and this attribute **SHOULD** be left unset in order for the values to be consistent.
|
|
44
|
+
* The list of possible values is defined in the [W3C User-Agent Client Hints specification](https://wicg.github.io/ua-client-hints/#sec-ch-ua-platform). Note that some (but not all) of these values can overlap with values in the [`os.type` and `os.name` attributes](./os.md). However, for consistency, the values in the `browser.platform` attribute should capture the exact value that the user agent provides.
|
|
45
|
+
*
|
|
46
|
+
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
|
|
47
|
+
*/
|
|
48
|
+
export const ATTR_BROWSER_PLATFORM = 'browser.platform';
|
|
49
|
+
//# sourceMappingURL=semconv.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"semconv.js","sourceRoot":"","sources":["../../src/semconv.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,gBAAyB,CAAC;AAE7D;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,kBAA2B,CAAC;AAEjE;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,gBAAyB,CAAC;AAE7D;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,kBAA2B,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * Array of brand name and version separated by a space\n *\n * @example [\" Not A;Brand 99\", \"Chromium 99\", \"Chrome 99\"]\n *\n * @note This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`navigator.userAgentData.brands`).\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_BROWSER_BRANDS = 'browser.brands' as const;\n\n/**\n * Preferred language of the user using the browser\n *\n * @example en\n * @example en-US\n * @example fr\n * @example fr-FR\n *\n * @note This value is intended to be taken from the Navigator API `navigator.language`.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_BROWSER_LANGUAGE = 'browser.language' as const;\n\n/**\n * A boolean that is true if the browser is running on a mobile device\n *\n * @note This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`navigator.userAgentData.mobile`). If unavailable, this attribute **SHOULD** be left unset.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_BROWSER_MOBILE = 'browser.mobile' as const;\n\n/**\n * The platform on which the browser is running\n *\n * @example Windows\n * @example macOS\n * @example Android\n *\n * @note This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`navigator.userAgentData.platform`). If unavailable, the legacy `navigator.platform` API **SHOULD NOT** be used instead and this attribute **SHOULD** be left unset in order for the values to be consistent.\n * The list of possible values is defined in the [W3C User-Agent Client Hints specification](https://wicg.github.io/ua-client-hints/#sec-ch-ua-platform). Note that some (but not all) of these values can overlap with values in the [`os.type` and `os.name` attributes](./os.md). However, for consistency, the values in the `browser.platform` attribute should capture the exact value that the user agent provides.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_BROWSER_PLATFORM = 'browser.platform' as const;\n"]}
|
package/build/esnext/types.d.ts
CHANGED
|
@@ -6,11 +6,4 @@ export type UserAgentData = {
|
|
|
6
6
|
platform: string;
|
|
7
7
|
mobile: boolean;
|
|
8
8
|
};
|
|
9
|
-
export declare const BROWSER_ATTRIBUTES: {
|
|
10
|
-
PLATFORM: string;
|
|
11
|
-
BRANDS: string;
|
|
12
|
-
MOBILE: string;
|
|
13
|
-
LANGUAGE: string;
|
|
14
|
-
USER_AGENT: string;
|
|
15
|
-
};
|
|
16
9
|
//# sourceMappingURL=types.d.ts.map
|
package/build/esnext/types.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
USER_AGENT: 'browser.user_agent',
|
|
7
|
-
};
|
|
1
|
+
/*
|
|
2
|
+
* Copyright The OpenTelemetry Authors
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
export {};
|
|
8
6
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport type UserAgentData = {\n brands: { brand: string; version: string }[];\n platform: string;\n mobile: boolean;\n};\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.219.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/build/esnext/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,4DAA4D;AAC5D,MAAM,CAAC,MAAM,OAAO,GAAG,SAAS,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\n// this is autogenerated file, see scripts/version-update.js\nexport const VERSION = '0.
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,4DAA4D;AAC5D,MAAM,CAAC,MAAM,OAAO,GAAG,SAAS,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\n// this is autogenerated file, see scripts/version-update.js\nexport const VERSION = '0.219.0';\n"]}
|
|
@@ -7,7 +7,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
7
7
|
exports.browserDetector = void 0;
|
|
8
8
|
const api_1 = require("@opentelemetry/api");
|
|
9
9
|
const resources_1 = require("@opentelemetry/resources");
|
|
10
|
-
const
|
|
10
|
+
const semantic_conventions_1 = require("@opentelemetry/semantic-conventions");
|
|
11
|
+
const semconv_1 = require("./semconv");
|
|
11
12
|
/**
|
|
12
13
|
* BrowserDetector will be used to detect the resources related to browser.
|
|
13
14
|
*/
|
|
@@ -28,8 +29,8 @@ class BrowserDetector {
|
|
|
28
29
|
* @returns The sanitized resource attributes.
|
|
29
30
|
*/
|
|
30
31
|
_getResourceAttributes(browserResource, _config) {
|
|
31
|
-
if (!browserResource[
|
|
32
|
-
!browserResource[
|
|
32
|
+
if (!browserResource[semantic_conventions_1.ATTR_USER_AGENT_ORIGINAL] &&
|
|
33
|
+
!browserResource[semconv_1.ATTR_BROWSER_PLATFORM]) {
|
|
33
34
|
api_1.diag.debug('BrowserDetector failed: Unable to find required browser resources. ');
|
|
34
35
|
return (0, resources_1.emptyResource)();
|
|
35
36
|
}
|
|
@@ -43,14 +44,12 @@ function getBrowserAttributes() {
|
|
|
43
44
|
const browserAttribs = {};
|
|
44
45
|
const userAgentData = navigator.userAgentData;
|
|
45
46
|
if (userAgentData) {
|
|
46
|
-
browserAttribs[
|
|
47
|
-
browserAttribs[
|
|
48
|
-
browserAttribs[
|
|
47
|
+
browserAttribs[semconv_1.ATTR_BROWSER_PLATFORM] = userAgentData.platform;
|
|
48
|
+
browserAttribs[semconv_1.ATTR_BROWSER_BRANDS] = userAgentData.brands.map(b => `${b.brand} ${b.version}`);
|
|
49
|
+
browserAttribs[semconv_1.ATTR_BROWSER_MOBILE] = userAgentData.mobile;
|
|
49
50
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}
|
|
53
|
-
browserAttribs[types_1.BROWSER_ATTRIBUTES.LANGUAGE] = navigator.language;
|
|
51
|
+
browserAttribs[semantic_conventions_1.ATTR_USER_AGENT_ORIGINAL] = navigator.userAgent;
|
|
52
|
+
browserAttribs[semconv_1.ATTR_BROWSER_LANGUAGE] = navigator.language;
|
|
54
53
|
return browserAttribs;
|
|
55
54
|
}
|
|
56
55
|
exports.browserDetector = new BrowserDetector();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BrowserDetector.js","sourceRoot":"","sources":["../../src/BrowserDetector.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,4CAA0C;AAM1C,wDAAyD;
|
|
1
|
+
{"version":3,"file":"BrowserDetector.js","sourceRoot":"","sources":["../../src/BrowserDetector.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,4CAA0C;AAM1C,wDAAyD;AACzD,8EAA+E;AAE/E,uCAKmB;AAEnB;;GAEG;AACH,MAAM,eAAe;IACnB,MAAM,CAAC,MAAgC;QACrC,MAAM,SAAS,GACb,OAAO,MAAM,KAAK,WAAW,IAAI,OAAO,QAAQ,KAAK,WAAW,CAAC;QAEnE,IAAI,CAAC,SAAS,EAAE;YACd,OAAO,IAAA,yBAAa,GAAE,CAAC;SACxB;QACD,MAAM,eAAe,GAAe,oBAAoB,EAAE,CAAC;QAC3D,OAAO,IAAI,CAAC,sBAAsB,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;IAC9D,CAAC;IACD;;;;;;OAMG;IACK,sBAAsB,CAC5B,eAA2B,EAC3B,OAAiC;QAEjC,IACE,CAAC,eAAe,CAAC,+CAAwB,CAAC;YAC1C,CAAC,eAAe,CAAC,+BAAqB,CAAC,EACvC;YACA,UAAI,CAAC,KAAK,CACR,qEAAqE,CACtE,CAAC;YACF,OAAO,IAAA,yBAAa,GAAE,CAAC;SACxB;aAAM;YACL,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,CAAC;SACxC;IACH,CAAC;CACF;AAED,8CAA8C;AAC9C,SAAS,oBAAoB;IAC3B,MAAM,cAAc,GAAe,EAAE,CAAC;IACtC,MAAM,aAAa,GACjB,SACD,CAAC,aAAa,CAAC;IAChB,IAAI,aAAa,EAAE;QACjB,cAAc,CAAC,+BAAqB,CAAC,GAAG,aAAa,CAAC,QAAQ,CAAC;QAC/D,cAAc,CAAC,6BAAmB,CAAC,GAAG,aAAa,CAAC,MAAM,CAAC,GAAG,CAC5D,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,OAAO,EAAE,CAC/B,CAAC;QACF,cAAc,CAAC,6BAAmB,CAAC,GAAG,aAAa,CAAC,MAAM,CAAC;KAC5D;IACD,cAAc,CAAC,+CAAwB,CAAC,GAAG,SAAS,CAAC,SAAS,CAAC;IAC/D,cAAc,CAAC,+BAAqB,CAAC,GAAG,SAAS,CAAC,QAAQ,CAAC;IAC3D,OAAO,cAAc,CAAC;AACxB,CAAC;AAEY,QAAA,eAAe,GAAG,IAAI,eAAe,EAAE,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { Attributes } from '@opentelemetry/api';\nimport { diag } from '@opentelemetry/api';\nimport type {\n DetectedResource,\n ResourceDetector,\n ResourceDetectionConfig,\n} from '@opentelemetry/resources';\nimport { emptyResource } from '@opentelemetry/resources';\nimport { ATTR_USER_AGENT_ORIGINAL } from '@opentelemetry/semantic-conventions';\nimport type { UserAgentData } from './types';\nimport {\n ATTR_BROWSER_LANGUAGE,\n ATTR_BROWSER_PLATFORM,\n ATTR_BROWSER_BRANDS,\n ATTR_BROWSER_MOBILE,\n} from './semconv';\n\n/**\n * BrowserDetector will be used to detect the resources related to browser.\n */\nclass BrowserDetector implements ResourceDetector {\n detect(config?: ResourceDetectionConfig): DetectedResource {\n const isBrowser =\n typeof window !== 'undefined' && typeof document !== 'undefined';\n\n if (!isBrowser) {\n return emptyResource();\n }\n const browserResource: Attributes = getBrowserAttributes();\n return this._getResourceAttributes(browserResource, config);\n }\n /**\n * Validates browser resource attribute map from browser variables\n *\n * @param browserResource The un-sanitized resource attributes from browser as key/value pairs.\n * @param config: Config\n * @returns The sanitized resource attributes.\n */\n private _getResourceAttributes(\n browserResource: Attributes,\n _config?: ResourceDetectionConfig\n ): DetectedResource {\n if (\n !browserResource[ATTR_USER_AGENT_ORIGINAL] &&\n !browserResource[ATTR_BROWSER_PLATFORM]\n ) {\n diag.debug(\n 'BrowserDetector failed: Unable to find required browser resources. '\n );\n return emptyResource();\n } else {\n return { attributes: browserResource };\n }\n }\n}\n\n// Add Browser related attributes to resources\nfunction getBrowserAttributes(): Attributes {\n const browserAttribs: Attributes = {};\n const userAgentData = (\n navigator as Navigator & { userAgentData?: UserAgentData }\n ).userAgentData;\n if (userAgentData) {\n browserAttribs[ATTR_BROWSER_PLATFORM] = userAgentData.platform;\n browserAttribs[ATTR_BROWSER_BRANDS] = userAgentData.brands.map(\n b => `${b.brand} ${b.version}`\n );\n browserAttribs[ATTR_BROWSER_MOBILE] = userAgentData.mobile;\n }\n browserAttribs[ATTR_USER_AGENT_ORIGINAL] = navigator.userAgent;\n browserAttribs[ATTR_BROWSER_LANGUAGE] = navigator.language;\n return browserAttribs;\n}\n\nexport const browserDetector = new BrowserDetector();\n"]}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Array of brand name and version separated by a space
|
|
3
|
+
*
|
|
4
|
+
* @example [" Not A;Brand 99", "Chromium 99", "Chrome 99"]
|
|
5
|
+
*
|
|
6
|
+
* @note This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`navigator.userAgentData.brands`).
|
|
7
|
+
*
|
|
8
|
+
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
|
|
9
|
+
*/
|
|
10
|
+
export declare const ATTR_BROWSER_BRANDS: "browser.brands";
|
|
11
|
+
/**
|
|
12
|
+
* Preferred language of the user using the browser
|
|
13
|
+
*
|
|
14
|
+
* @example en
|
|
15
|
+
* @example en-US
|
|
16
|
+
* @example fr
|
|
17
|
+
* @example fr-FR
|
|
18
|
+
*
|
|
19
|
+
* @note This value is intended to be taken from the Navigator API `navigator.language`.
|
|
20
|
+
*
|
|
21
|
+
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
|
|
22
|
+
*/
|
|
23
|
+
export declare const ATTR_BROWSER_LANGUAGE: "browser.language";
|
|
24
|
+
/**
|
|
25
|
+
* A boolean that is true if the browser is running on a mobile device
|
|
26
|
+
*
|
|
27
|
+
* @note This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`navigator.userAgentData.mobile`). If unavailable, this attribute **SHOULD** be left unset.
|
|
28
|
+
*
|
|
29
|
+
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
|
|
30
|
+
*/
|
|
31
|
+
export declare const ATTR_BROWSER_MOBILE: "browser.mobile";
|
|
32
|
+
/**
|
|
33
|
+
* The platform on which the browser is running
|
|
34
|
+
*
|
|
35
|
+
* @example Windows
|
|
36
|
+
* @example macOS
|
|
37
|
+
* @example Android
|
|
38
|
+
*
|
|
39
|
+
* @note This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`navigator.userAgentData.platform`). If unavailable, the legacy `navigator.platform` API **SHOULD NOT** be used instead and this attribute **SHOULD** be left unset in order for the values to be consistent.
|
|
40
|
+
* The list of possible values is defined in the [W3C User-Agent Client Hints specification](https://wicg.github.io/ua-client-hints/#sec-ch-ua-platform). Note that some (but not all) of these values can overlap with values in the [`os.type` and `os.name` attributes](./os.md). However, for consistency, the values in the `browser.platform` attribute should capture the exact value that the user agent provides.
|
|
41
|
+
*
|
|
42
|
+
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
|
|
43
|
+
*/
|
|
44
|
+
export declare const ATTR_BROWSER_PLATFORM: "browser.platform";
|
|
45
|
+
//# sourceMappingURL=semconv.d.ts.map
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright The OpenTelemetry Authors
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.ATTR_BROWSER_PLATFORM = exports.ATTR_BROWSER_MOBILE = exports.ATTR_BROWSER_LANGUAGE = exports.ATTR_BROWSER_BRANDS = void 0;
|
|
8
|
+
/**
|
|
9
|
+
* Array of brand name and version separated by a space
|
|
10
|
+
*
|
|
11
|
+
* @example [" Not A;Brand 99", "Chromium 99", "Chrome 99"]
|
|
12
|
+
*
|
|
13
|
+
* @note This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`navigator.userAgentData.brands`).
|
|
14
|
+
*
|
|
15
|
+
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
|
|
16
|
+
*/
|
|
17
|
+
exports.ATTR_BROWSER_BRANDS = 'browser.brands';
|
|
18
|
+
/**
|
|
19
|
+
* Preferred language of the user using the browser
|
|
20
|
+
*
|
|
21
|
+
* @example en
|
|
22
|
+
* @example en-US
|
|
23
|
+
* @example fr
|
|
24
|
+
* @example fr-FR
|
|
25
|
+
*
|
|
26
|
+
* @note This value is intended to be taken from the Navigator API `navigator.language`.
|
|
27
|
+
*
|
|
28
|
+
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
|
|
29
|
+
*/
|
|
30
|
+
exports.ATTR_BROWSER_LANGUAGE = 'browser.language';
|
|
31
|
+
/**
|
|
32
|
+
* A boolean that is true if the browser is running on a mobile device
|
|
33
|
+
*
|
|
34
|
+
* @note This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`navigator.userAgentData.mobile`). If unavailable, this attribute **SHOULD** be left unset.
|
|
35
|
+
*
|
|
36
|
+
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
|
|
37
|
+
*/
|
|
38
|
+
exports.ATTR_BROWSER_MOBILE = 'browser.mobile';
|
|
39
|
+
/**
|
|
40
|
+
* The platform on which the browser is running
|
|
41
|
+
*
|
|
42
|
+
* @example Windows
|
|
43
|
+
* @example macOS
|
|
44
|
+
* @example Android
|
|
45
|
+
*
|
|
46
|
+
* @note This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`navigator.userAgentData.platform`). If unavailable, the legacy `navigator.platform` API **SHOULD NOT** be used instead and this attribute **SHOULD** be left unset in order for the values to be consistent.
|
|
47
|
+
* The list of possible values is defined in the [W3C User-Agent Client Hints specification](https://wicg.github.io/ua-client-hints/#sec-ch-ua-platform). Note that some (but not all) of these values can overlap with values in the [`os.type` and `os.name` attributes](./os.md). However, for consistency, the values in the `browser.platform` attribute should capture the exact value that the user agent provides.
|
|
48
|
+
*
|
|
49
|
+
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
|
|
50
|
+
*/
|
|
51
|
+
exports.ATTR_BROWSER_PLATFORM = 'browser.platform';
|
|
52
|
+
//# sourceMappingURL=semconv.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"semconv.js","sourceRoot":"","sources":["../../src/semconv.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH;;;;;;;;GAQG;AACU,QAAA,mBAAmB,GAAG,gBAAyB,CAAC;AAE7D;;;;;;;;;;;GAWG;AACU,QAAA,qBAAqB,GAAG,kBAA2B,CAAC;AAEjE;;;;;;GAMG;AACU,QAAA,mBAAmB,GAAG,gBAAyB,CAAC;AAE7D;;;;;;;;;;;GAWG;AACU,QAAA,qBAAqB,GAAG,kBAA2B,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * Array of brand name and version separated by a space\n *\n * @example [\" Not A;Brand 99\", \"Chromium 99\", \"Chrome 99\"]\n *\n * @note This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`navigator.userAgentData.brands`).\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_BROWSER_BRANDS = 'browser.brands' as const;\n\n/**\n * Preferred language of the user using the browser\n *\n * @example en\n * @example en-US\n * @example fr\n * @example fr-FR\n *\n * @note This value is intended to be taken from the Navigator API `navigator.language`.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_BROWSER_LANGUAGE = 'browser.language' as const;\n\n/**\n * A boolean that is true if the browser is running on a mobile device\n *\n * @note This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`navigator.userAgentData.mobile`). If unavailable, this attribute **SHOULD** be left unset.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_BROWSER_MOBILE = 'browser.mobile' as const;\n\n/**\n * The platform on which the browser is running\n *\n * @example Windows\n * @example macOS\n * @example Android\n *\n * @note This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`navigator.userAgentData.platform`). If unavailable, the legacy `navigator.platform` API **SHOULD NOT** be used instead and this attribute **SHOULD** be left unset in order for the values to be consistent.\n * The list of possible values is defined in the [W3C User-Agent Client Hints specification](https://wicg.github.io/ua-client-hints/#sec-ch-ua-platform). Note that some (but not all) of these values can overlap with values in the [`os.type` and `os.name` attributes](./os.md). However, for consistency, the values in the `browser.platform` attribute should capture the exact value that the user agent provides.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_BROWSER_PLATFORM = 'browser.platform' as const;\n"]}
|
package/build/src/types.d.ts
CHANGED
|
@@ -6,11 +6,4 @@ export type UserAgentData = {
|
|
|
6
6
|
platform: string;
|
|
7
7
|
mobile: boolean;
|
|
8
8
|
};
|
|
9
|
-
export declare const BROWSER_ATTRIBUTES: {
|
|
10
|
-
PLATFORM: string;
|
|
11
|
-
BRANDS: string;
|
|
12
|
-
MOBILE: string;
|
|
13
|
-
LANGUAGE: string;
|
|
14
|
-
USER_AGENT: string;
|
|
15
|
-
};
|
|
16
9
|
//# sourceMappingURL=types.d.ts.map
|
package/build/src/types.js
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright The OpenTelemetry Authors
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
2
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BROWSER_ATTRIBUTES = void 0;
|
|
4
|
-
exports.BROWSER_ATTRIBUTES = {
|
|
5
|
-
PLATFORM: 'browser.platform',
|
|
6
|
-
BRANDS: 'browser.brands',
|
|
7
|
-
MOBILE: 'browser.mobile',
|
|
8
|
-
LANGUAGE: 'browser.language',
|
|
9
|
-
USER_AGENT: 'browser.user_agent',
|
|
10
|
-
};
|
|
11
7
|
//# sourceMappingURL=types.js.map
|
package/build/src/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport type UserAgentData = {\n brands: { brand: string; version: string }[];\n platform: string;\n mobile: boolean;\n};\n"]}
|
package/build/src/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.219.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/build/src/version.js
CHANGED
package/build/src/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,4DAA4D;AAC/C,QAAA,OAAO,GAAG,SAAS,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\n// this is autogenerated file, see scripts/version-update.js\nexport const VERSION = '0.
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,4DAA4D;AAC/C,QAAA,OAAO,GAAG,SAAS,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\n// this is autogenerated file, see scripts/version-update.js\nexport const VERSION = '0.219.0';\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opentelemetry/opentelemetry-browser-detector",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.219.0",
|
|
4
4
|
"description": "OpenTelemetry Resource Detector for Browser",
|
|
5
5
|
"main": "build/src/index.js",
|
|
6
6
|
"module": "build/esm/index.js",
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
"prepublishOnly": "npm run compile",
|
|
12
12
|
"compile": "tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json",
|
|
13
13
|
"clean": "tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json",
|
|
14
|
-
"lint": "eslint .
|
|
15
|
-
"lint:fix": "eslint . --
|
|
14
|
+
"lint": "eslint .",
|
|
15
|
+
"lint:fix": "eslint . --fix",
|
|
16
16
|
"test": "nyc mocha 'test/**/*.test.ts'",
|
|
17
17
|
"test:browser": "karma start --single-run",
|
|
18
18
|
"tdd": "npm run test -- --watch-extensions ts --watch",
|
|
@@ -52,13 +52,13 @@
|
|
|
52
52
|
"access": "public"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
"@babel/core": "7.
|
|
56
|
-
"@babel/preset-env": "7.
|
|
55
|
+
"@babel/core": "7.29.0",
|
|
56
|
+
"@babel/preset-env": "7.29.5",
|
|
57
57
|
"@opentelemetry/api": "1.9.1",
|
|
58
58
|
"@types/mocha": "10.0.10",
|
|
59
59
|
"@types/node": "18.19.130",
|
|
60
60
|
"@types/sinon": "17.0.4",
|
|
61
|
-
"babel-plugin-istanbul": "
|
|
61
|
+
"babel-plugin-istanbul": "8.0.0",
|
|
62
62
|
"karma": "6.4.4",
|
|
63
63
|
"karma-chrome-launcher": "3.1.0",
|
|
64
64
|
"karma-coverage": "2.2.1",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"mocha": "11.7.5",
|
|
69
69
|
"nyc": "17.1.0",
|
|
70
70
|
"sinon": "18.0.1",
|
|
71
|
-
"ts-loader": "9.5.
|
|
71
|
+
"ts-loader": "9.5.7",
|
|
72
72
|
"typescript": "5.0.4",
|
|
73
73
|
"webpack": "5.104.1",
|
|
74
74
|
"webpack-cli": "7.0.2"
|
|
@@ -77,8 +77,9 @@
|
|
|
77
77
|
"@opentelemetry/api": "^1.3.0"
|
|
78
78
|
},
|
|
79
79
|
"dependencies": {
|
|
80
|
-
"@opentelemetry/resources": "2.
|
|
80
|
+
"@opentelemetry/resources": "2.8.0",
|
|
81
|
+
"@opentelemetry/semantic-conventions": "^1.29.0"
|
|
81
82
|
},
|
|
82
83
|
"homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/browser-detector",
|
|
83
|
-
"gitHead": "
|
|
84
|
+
"gitHead": "13a035bc695996cf4aec885fef7b9866f48bc555"
|
|
84
85
|
}
|