@opentelemetry/resource-detector-alibaba-cloud 0.31.5 → 0.31.8
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/detectors/AlibabaCloudEcsDetector.js +17 -17
- package/build/esm/detectors/AlibabaCloudEcsDetector.js.map +1 -1
- package/build/esm/semconv.d.ts +85 -0
- package/build/esm/semconv.js +105 -0
- package/build/esm/semconv.js.map +1 -0
- package/build/src/detectors/AlibabaCloudEcsDetector.js +17 -17
- package/build/src/detectors/AlibabaCloudEcsDetector.js.map +1 -1
- package/build/src/semconv.d.ts +85 -0
- package/build/src/semconv.js +108 -0
- package/build/src/semconv.js.map +1 -0
- package/package.json +4 -5
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import { context, diag } from '@opentelemetry/api';
|
|
17
17
|
import { suppressTracing } from '@opentelemetry/core';
|
|
18
|
-
import {
|
|
18
|
+
import { CLOUD_PLATFORM_VALUE_ALIBABA_CLOUD_ECS, CLOUD_PROVIDER_VALUE_ALIBABA_CLOUD, ATTR_CLOUD_ACCOUNT_ID, ATTR_CLOUD_AVAILABILITY_ZONE, ATTR_CLOUD_PLATFORM, ATTR_CLOUD_PROVIDER, ATTR_CLOUD_REGION, ATTR_HOST_ID, ATTR_HOST_NAME, ATTR_HOST_TYPE, } from '../semconv';
|
|
19
19
|
import * as http from 'http';
|
|
20
20
|
/**
|
|
21
21
|
* The AlibabaCloudEcsDetector can be used to detect if a process is running in
|
|
@@ -41,14 +41,14 @@ class AlibabaCloudEcsDetector {
|
|
|
41
41
|
detect() {
|
|
42
42
|
const dataPromise = context.with(suppressTracing(context.active()), () => this._gatherData());
|
|
43
43
|
const attrNames = [
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
44
|
+
ATTR_CLOUD_PROVIDER,
|
|
45
|
+
ATTR_CLOUD_PLATFORM,
|
|
46
|
+
ATTR_CLOUD_ACCOUNT_ID,
|
|
47
|
+
ATTR_CLOUD_REGION,
|
|
48
|
+
ATTR_CLOUD_AVAILABILITY_ZONE,
|
|
49
|
+
ATTR_HOST_ID,
|
|
50
|
+
ATTR_HOST_TYPE,
|
|
51
|
+
ATTR_HOST_NAME,
|
|
52
52
|
];
|
|
53
53
|
const attributes = {};
|
|
54
54
|
attrNames.forEach(name => {
|
|
@@ -63,14 +63,14 @@ class AlibabaCloudEcsDetector {
|
|
|
63
63
|
const { 'owner-account-id': accountId, 'instance-id': instanceId, 'instance-type': instanceType, 'region-id': region, 'zone-id': availabilityZone, } = await this._fetchIdentity();
|
|
64
64
|
const hostname = await this._fetchHost();
|
|
65
65
|
return {
|
|
66
|
-
[
|
|
67
|
-
[
|
|
68
|
-
[
|
|
69
|
-
[
|
|
70
|
-
[
|
|
71
|
-
[
|
|
72
|
-
[
|
|
73
|
-
[
|
|
66
|
+
[ATTR_CLOUD_PROVIDER]: CLOUD_PROVIDER_VALUE_ALIBABA_CLOUD,
|
|
67
|
+
[ATTR_CLOUD_PLATFORM]: CLOUD_PLATFORM_VALUE_ALIBABA_CLOUD_ECS,
|
|
68
|
+
[ATTR_CLOUD_ACCOUNT_ID]: accountId,
|
|
69
|
+
[ATTR_CLOUD_REGION]: region,
|
|
70
|
+
[ATTR_CLOUD_AVAILABILITY_ZONE]: availabilityZone,
|
|
71
|
+
[ATTR_HOST_ID]: instanceId,
|
|
72
|
+
[ATTR_HOST_TYPE]: instanceType,
|
|
73
|
+
[ATTR_HOST_NAME]: hostname,
|
|
74
74
|
};
|
|
75
75
|
}
|
|
76
76
|
catch (err) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AlibabaCloudEcsDetector.js","sourceRoot":"","sources":["../../../src/detectors/AlibabaCloudEcsDetector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAMtD,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"AlibabaCloudEcsDetector.js","sourceRoot":"","sources":["../../../src/detectors/AlibabaCloudEcsDetector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAMtD,OAAO,EACL,sCAAsC,EACtC,kCAAkC,EAClC,qBAAqB,EACrB,4BAA4B,EAC5B,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,EACjB,YAAY,EACZ,cAAc,EACd,cAAc,GACf,MAAM,YAAY,CAAC;AAEpB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAE7B;;;;GAIG;AACH,MAAM,uBAAuB;IAC3B;;;OAGG;IACM,2BAA2B,GAAG,iBAAiB,CAAC;IAChD,6CAA6C,GACpD,4CAA4C,CAAC;IACtC,yCAAyC,GAChD,4BAA4B,CAAC;IACtB,qBAAqB,GAAG,IAAI,CAAC;IAEtC;;;;;;OAMG;IACH,MAAM;QACJ,MAAM,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,GAAG,EAAE,CACvE,IAAI,CAAC,WAAW,EAAE,CACnB,CAAC;QAEF,MAAM,SAAS,GAAG;YAChB,mBAAmB;YACnB,mBAAmB;YACnB,qBAAqB;YACrB,iBAAiB;YACjB,4BAA4B;YAC5B,YAAY;YACZ,cAAc;YACd,cAAc;SACf,CAAC;QAEF,MAAM,UAAU,GAAG,EAAgC,CAAC;QACpD,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;YACvB,yEAAyE;YACzE,UAAU,CAAC,IAAI,CAAC,GAAG,WAAW,CAAC,IAAI,CAAC,IA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AG,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,CAAC,EAAE;oBACpB,MAAM,CAAC,GAAG,CAAC,CAAC;gBACd,CAAC,CAAC,CAAC;gBACH,GAAG,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE;oBACjB,OAAO,CAAC,OAAO,CAAC,CAAC;gBACnB,CAAC,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;YACH,GAAG,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,CAAC,EAAE;gBACpB,YAAY,CAAC,SAAS,CAAC,CAAC;gBACxB,MAAM,CAAC,GAAG,CAAC,CAAC;YACd,CAAC,CAAC,CAAC;YACH,GAAG,CAAC,GAAG,EAAE,CAAC;QACZ,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAED,MAAM,CAAC,MAAM,uBAAuB,GAAG,IAAI,uBAAuB,EAAE,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 { context, diag } from '@opentelemetry/api';\nimport { suppressTracing } from '@opentelemetry/core';\nimport {\n ResourceDetector,\n DetectedResource,\n DetectedResourceAttributes,\n} from '@opentelemetry/resources';\nimport {\n CLOUD_PLATFORM_VALUE_ALIBABA_CLOUD_ECS,\n CLOUD_PROVIDER_VALUE_ALIBABA_CLOUD,\n ATTR_CLOUD_ACCOUNT_ID,\n ATTR_CLOUD_AVAILABILITY_ZONE,\n ATTR_CLOUD_PLATFORM,\n ATTR_CLOUD_PROVIDER,\n ATTR_CLOUD_REGION,\n ATTR_HOST_ID,\n ATTR_HOST_NAME,\n ATTR_HOST_TYPE,\n} from '../semconv';\n\nimport * as http from 'http';\n\n/**\n * The AlibabaCloudEcsDetector can be used to detect if a process is running in\n * AlibabaCloud ECS and return a {@link Resource} populated with metadata about\n * the ECS instance. Returns an empty Resource if detection fails.\n */\nclass AlibabaCloudEcsDetector implements ResourceDetector {\n /**\n * See https://www.alibabacloud.com/help/doc-detail/67254.htm for\n * documentation about the AlibabaCloud instance identity document.\n */\n readonly ALIBABA_CLOUD_IDMS_ENDPOINT = '100.100.100.200';\n readonly ALIBABA_CLOUD_INSTANCE_IDENTITY_DOCUMENT_PATH =\n '/latest/dynamic/instance-identity/document';\n readonly ALIBABA_CLOUD_INSTANCE_HOST_DOCUMENT_PATH =\n '/latest/meta-data/hostname';\n readonly MILLISECONDS_TIME_OUT = 1000;\n\n /**\n * Attempts to connect and obtain an AlibabaCloud instance Identity document.\n * If the connection is successful it returns a promise containing a\n * {@link Resource} populated with instance metadata.\n *\n * @param config (unused) The resource detection config\n */\n detect(): DetectedResource {\n const dataPromise = context.with(suppressTracing(context.active()), () =>\n this._gatherData()\n );\n\n const attrNames = [\n ATTR_CLOUD_PROVIDER,\n ATTR_CLOUD_PLATFORM,\n ATTR_CLOUD_ACCOUNT_ID,\n ATTR_CLOUD_REGION,\n ATTR_CLOUD_AVAILABILITY_ZONE,\n ATTR_HOST_ID,\n ATTR_HOST_TYPE,\n ATTR_HOST_NAME,\n ];\n\n const attributes = {} as DetectedResourceAttributes;\n attrNames.forEach(name => {\n // Each resource attribute is determined asynchronously in _gatherData().\n attributes[name] = dataPromise.then(data => data[name]);\n });\n\n return { attributes };\n }\n\n /** Gets identity and host info and returns them as attribs. Empty object if fails */\n async _gatherData(): Promise<DetectedResourceAttributes> {\n try {\n const {\n 'owner-account-id': accountId,\n 'instance-id': instanceId,\n 'instance-type': instanceType,\n 'region-id': region,\n 'zone-id': availabilityZone,\n } = await this._fetchIdentity();\n const hostname = await this._fetchHost();\n\n return {\n [ATTR_CLOUD_PROVIDER]: CLOUD_PROVIDER_VALUE_ALIBABA_CLOUD,\n [ATTR_CLOUD_PLATFORM]: CLOUD_PLATFORM_VALUE_ALIBABA_CLOUD_ECS,\n [ATTR_CLOUD_ACCOUNT_ID]: accountId,\n [ATTR_CLOUD_REGION]: region,\n [ATTR_CLOUD_AVAILABILITY_ZONE]: availabilityZone,\n [ATTR_HOST_ID]: instanceId,\n [ATTR_HOST_TYPE]: instanceType,\n [ATTR_HOST_NAME]: hostname,\n };\n } catch (err: any) {\n diag.debug(\n `${this.constructor.name}: did not detect resource: ${err?.message}`\n );\n return {};\n }\n }\n\n /**\n * Fetch AlibabaCloud instance document url with http requests. If the\n * application is running on an ECS instance, we should be able to get back a\n * valid JSON document. Parses that document and stores the identity\n * properties in a local map.\n */\n private async _fetchIdentity(): Promise<any> {\n const options = {\n host: this.ALIBABA_CLOUD_IDMS_ENDPOINT,\n path: this.ALIBABA_CLOUD_INSTANCE_IDENTITY_DOCUMENT_PATH,\n method: 'GET',\n timeout: this.MILLISECONDS_TIME_OUT,\n };\n const identity = await this._fetchString(options);\n return JSON.parse(identity);\n }\n\n private async _fetchHost(): Promise<string> {\n const options = {\n host: this.ALIBABA_CLOUD_IDMS_ENDPOINT,\n path: this.ALIBABA_CLOUD_INSTANCE_HOST_DOCUMENT_PATH,\n method: 'GET',\n timeout: this.MILLISECONDS_TIME_OUT,\n };\n return await this._fetchString(options);\n }\n\n private async _fetchString(options: http.RequestOptions): Promise<string> {\n return new Promise((resolve, reject) => {\n const timeoutId = setTimeout(() => {\n req.destroy(new Error('ECS metadata api request timed out.'));\n }, this.MILLISECONDS_TIME_OUT);\n\n const req = http.request(options, res => {\n clearTimeout(timeoutId);\n const { statusCode } = res;\n if (\n typeof statusCode !== 'number' ||\n !(statusCode >= 200 && statusCode < 300)\n ) {\n res.destroy();\n return reject(\n new Error(`Failed to load page, status code: ${statusCode}`)\n );\n }\n\n res.setEncoding('utf8');\n let rawData = '';\n res.on('data', chunk => (rawData += chunk));\n res.on('error', err => {\n reject(err);\n });\n res.on('end', () => {\n resolve(rawData);\n });\n });\n req.on('error', err => {\n clearTimeout(timeoutId);\n reject(err);\n });\n req.end();\n });\n }\n}\n\nexport const alibabaCloudEcsDetector = new AlibabaCloudEcsDetector();\n"]}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The cloud account ID the resource is assigned to.
|
|
3
|
+
*
|
|
4
|
+
* @example 111111111111
|
|
5
|
+
* @example opentelemetry
|
|
6
|
+
*
|
|
7
|
+
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
|
|
8
|
+
*/
|
|
9
|
+
export declare const ATTR_CLOUD_ACCOUNT_ID: "cloud.account.id";
|
|
10
|
+
/**
|
|
11
|
+
* Cloud regions often have multiple, isolated locations known as zones to increase availability. Availability zone represents the zone where the resource is running.
|
|
12
|
+
*
|
|
13
|
+
* @example us-east-1c
|
|
14
|
+
*
|
|
15
|
+
* @note Availability zones are called "zones" on Alibaba Cloud and Google Cloud.
|
|
16
|
+
*
|
|
17
|
+
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
|
|
18
|
+
*/
|
|
19
|
+
export declare const ATTR_CLOUD_AVAILABILITY_ZONE: "cloud.availability_zone";
|
|
20
|
+
/**
|
|
21
|
+
* The cloud platform in use.
|
|
22
|
+
*
|
|
23
|
+
* @note The prefix of the service **SHOULD** match the one specified in `cloud.provider`.
|
|
24
|
+
*
|
|
25
|
+
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
|
|
26
|
+
*/
|
|
27
|
+
export declare const ATTR_CLOUD_PLATFORM: "cloud.platform";
|
|
28
|
+
/**
|
|
29
|
+
* Name of the cloud provider.
|
|
30
|
+
*
|
|
31
|
+
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
|
|
32
|
+
*/
|
|
33
|
+
export declare const ATTR_CLOUD_PROVIDER: "cloud.provider";
|
|
34
|
+
/**
|
|
35
|
+
* The geographical region within a cloud provider. When associated with a resource, this attribute specifies the region where the resource operates. When calling services or APIs deployed on a cloud, this attribute identifies the region where the called destination is deployed.
|
|
36
|
+
*
|
|
37
|
+
* @example us-central1
|
|
38
|
+
* @example us-east-1
|
|
39
|
+
*
|
|
40
|
+
* @note Refer to your provider's docs to see the available regions, for example [Alibaba Cloud regions](https://www.alibabacloud.com/help/doc-detail/40654.htm), [AWS regions](https://aws.amazon.com/about-aws/global-infrastructure/regions_az/), [Azure regions](https://azure.microsoft.com/global-infrastructure/geographies/), [Google Cloud regions](https://cloud.google.com/about/locations), or [Tencent Cloud regions](https://www.tencentcloud.com/document/product/213/6091).
|
|
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_CLOUD_REGION: "cloud.region";
|
|
45
|
+
/**
|
|
46
|
+
* Unique host ID. For Cloud, this must be the instance_id assigned by the cloud provider. For non-containerized systems, this should be the `machine-id`. See the table below for the sources to use to determine the `machine-id` based on operating system.
|
|
47
|
+
*
|
|
48
|
+
* @example fdbf79e8af94cb7f9e8df36789187052
|
|
49
|
+
*
|
|
50
|
+
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
|
|
51
|
+
*/
|
|
52
|
+
export declare const ATTR_HOST_ID: "host.id";
|
|
53
|
+
/**
|
|
54
|
+
* Name of the host. On Unix systems, it may contain what the hostname command returns, or the fully qualified hostname, or another name specified by the user.
|
|
55
|
+
*
|
|
56
|
+
* @example opentelemetry-test
|
|
57
|
+
*
|
|
58
|
+
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
|
|
59
|
+
*/
|
|
60
|
+
export declare const ATTR_HOST_NAME: "host.name";
|
|
61
|
+
/**
|
|
62
|
+
* Type of host. For Cloud, this must be the machine type.
|
|
63
|
+
*
|
|
64
|
+
* @example n1-standard-1
|
|
65
|
+
*
|
|
66
|
+
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
|
|
67
|
+
*/
|
|
68
|
+
export declare const ATTR_HOST_TYPE: "host.type";
|
|
69
|
+
/**
|
|
70
|
+
* Enum value "alibaba_cloud_ecs" for attribute {@link ATTR_CLOUD_PLATFORM}.
|
|
71
|
+
*
|
|
72
|
+
* Alibaba Cloud Elastic Compute Service
|
|
73
|
+
*
|
|
74
|
+
* @experimental This enum value is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
|
|
75
|
+
*/
|
|
76
|
+
export declare const CLOUD_PLATFORM_VALUE_ALIBABA_CLOUD_ECS: "alibaba_cloud_ecs";
|
|
77
|
+
/**
|
|
78
|
+
* Enum value "alibaba_cloud" for attribute {@link ATTR_CLOUD_PROVIDER}.
|
|
79
|
+
*
|
|
80
|
+
* Alibaba Cloud
|
|
81
|
+
*
|
|
82
|
+
* @experimental This enum value is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
|
|
83
|
+
*/
|
|
84
|
+
export declare const CLOUD_PROVIDER_VALUE_ALIBABA_CLOUD: "alibaba_cloud";
|
|
85
|
+
//# sourceMappingURL=semconv.d.ts.map
|
|
@@ -0,0 +1,105 @@
|
|
|
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
|
+
/*
|
|
17
|
+
* This file contains a copy of unstable semantic convention definitions
|
|
18
|
+
* used by this package.
|
|
19
|
+
* @see https://github.com/open-telemetry/opentelemetry-js/tree/main/semantic-conventions#unstable-semconv
|
|
20
|
+
*/
|
|
21
|
+
/**
|
|
22
|
+
* The cloud account ID the resource is assigned to.
|
|
23
|
+
*
|
|
24
|
+
* @example 111111111111
|
|
25
|
+
* @example opentelemetry
|
|
26
|
+
*
|
|
27
|
+
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
|
|
28
|
+
*/
|
|
29
|
+
export const ATTR_CLOUD_ACCOUNT_ID = 'cloud.account.id';
|
|
30
|
+
/**
|
|
31
|
+
* Cloud regions often have multiple, isolated locations known as zones to increase availability. Availability zone represents the zone where the resource is running.
|
|
32
|
+
*
|
|
33
|
+
* @example us-east-1c
|
|
34
|
+
*
|
|
35
|
+
* @note Availability zones are called "zones" on Alibaba Cloud and Google Cloud.
|
|
36
|
+
*
|
|
37
|
+
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
|
|
38
|
+
*/
|
|
39
|
+
export const ATTR_CLOUD_AVAILABILITY_ZONE = 'cloud.availability_zone';
|
|
40
|
+
/**
|
|
41
|
+
* The cloud platform in use.
|
|
42
|
+
*
|
|
43
|
+
* @note The prefix of the service **SHOULD** match the one specified in `cloud.provider`.
|
|
44
|
+
*
|
|
45
|
+
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
|
|
46
|
+
*/
|
|
47
|
+
export const ATTR_CLOUD_PLATFORM = 'cloud.platform';
|
|
48
|
+
/**
|
|
49
|
+
* Name of the cloud provider.
|
|
50
|
+
*
|
|
51
|
+
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
|
|
52
|
+
*/
|
|
53
|
+
export const ATTR_CLOUD_PROVIDER = 'cloud.provider';
|
|
54
|
+
/**
|
|
55
|
+
* The geographical region within a cloud provider. When associated with a resource, this attribute specifies the region where the resource operates. When calling services or APIs deployed on a cloud, this attribute identifies the region where the called destination is deployed.
|
|
56
|
+
*
|
|
57
|
+
* @example us-central1
|
|
58
|
+
* @example us-east-1
|
|
59
|
+
*
|
|
60
|
+
* @note Refer to your provider's docs to see the available regions, for example [Alibaba Cloud regions](https://www.alibabacloud.com/help/doc-detail/40654.htm), [AWS regions](https://aws.amazon.com/about-aws/global-infrastructure/regions_az/), [Azure regions](https://azure.microsoft.com/global-infrastructure/geographies/), [Google Cloud regions](https://cloud.google.com/about/locations), or [Tencent Cloud regions](https://www.tencentcloud.com/document/product/213/6091).
|
|
61
|
+
*
|
|
62
|
+
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
|
|
63
|
+
*/
|
|
64
|
+
export const ATTR_CLOUD_REGION = 'cloud.region';
|
|
65
|
+
/**
|
|
66
|
+
* Unique host ID. For Cloud, this must be the instance_id assigned by the cloud provider. For non-containerized systems, this should be the `machine-id`. See the table below for the sources to use to determine the `machine-id` based on operating system.
|
|
67
|
+
*
|
|
68
|
+
* @example fdbf79e8af94cb7f9e8df36789187052
|
|
69
|
+
*
|
|
70
|
+
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
|
|
71
|
+
*/
|
|
72
|
+
export const ATTR_HOST_ID = 'host.id';
|
|
73
|
+
/**
|
|
74
|
+
* Name of the host. On Unix systems, it may contain what the hostname command returns, or the fully qualified hostname, or another name specified by the user.
|
|
75
|
+
*
|
|
76
|
+
* @example opentelemetry-test
|
|
77
|
+
*
|
|
78
|
+
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
|
|
79
|
+
*/
|
|
80
|
+
export const ATTR_HOST_NAME = 'host.name';
|
|
81
|
+
/**
|
|
82
|
+
* Type of host. For Cloud, this must be the machine type.
|
|
83
|
+
*
|
|
84
|
+
* @example n1-standard-1
|
|
85
|
+
*
|
|
86
|
+
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
|
|
87
|
+
*/
|
|
88
|
+
export const ATTR_HOST_TYPE = 'host.type';
|
|
89
|
+
/**
|
|
90
|
+
* Enum value "alibaba_cloud_ecs" for attribute {@link ATTR_CLOUD_PLATFORM}.
|
|
91
|
+
*
|
|
92
|
+
* Alibaba Cloud Elastic Compute Service
|
|
93
|
+
*
|
|
94
|
+
* @experimental This enum value is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
|
|
95
|
+
*/
|
|
96
|
+
export const CLOUD_PLATFORM_VALUE_ALIBABA_CLOUD_ECS = 'alibaba_cloud_ecs';
|
|
97
|
+
/**
|
|
98
|
+
* Enum value "alibaba_cloud" for attribute {@link ATTR_CLOUD_PROVIDER}.
|
|
99
|
+
*
|
|
100
|
+
* Alibaba Cloud
|
|
101
|
+
*
|
|
102
|
+
* @experimental This enum value is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
|
|
103
|
+
*/
|
|
104
|
+
export const CLOUD_PROVIDER_VALUE_ALIBABA_CLOUD = 'alibaba_cloud';
|
|
105
|
+
//# sourceMappingURL=semconv.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"semconv.js","sourceRoot":"","sources":["../../src/semconv.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH;;;;GAIG;AAEH;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,kBAA2B,CAAC;AAEjE;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,yBAAkC,CAAC;AAE/E;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,gBAAyB,CAAC;AAE7D;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,gBAAyB,CAAC;AAE7D;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,cAAuB,CAAC;AAEzD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,SAAkB,CAAC;AAE/C;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,WAAoB,CAAC;AAEnD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,WAAoB,CAAC;AAEnD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,sCAAsC,GACjD,mBAA4B,CAAC;AAE/B;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,kCAAkC,GAAG,eAAwB,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\n/*\n * This file contains a copy of unstable semantic convention definitions\n * used by this package.\n * @see https://github.com/open-telemetry/opentelemetry-js/tree/main/semantic-conventions#unstable-semconv\n */\n\n/**\n * The cloud account ID the resource is assigned to.\n *\n * @example 111111111111\n * @example opentelemetry\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_CLOUD_ACCOUNT_ID = 'cloud.account.id' as const;\n\n/**\n * Cloud regions often have multiple, isolated locations known as zones to increase availability. Availability zone represents the zone where the resource is running.\n *\n * @example us-east-1c\n *\n * @note Availability zones are called \"zones\" on Alibaba Cloud and Google Cloud.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_CLOUD_AVAILABILITY_ZONE = 'cloud.availability_zone' as const;\n\n/**\n * The cloud platform in use.\n *\n * @note The prefix of the service **SHOULD** match the one specified in `cloud.provider`.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_CLOUD_PLATFORM = 'cloud.platform' as const;\n\n/**\n * Name of the cloud provider.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_CLOUD_PROVIDER = 'cloud.provider' as const;\n\n/**\n * The geographical region within a cloud provider. When associated with a resource, this attribute specifies the region where the resource operates. When calling services or APIs deployed on a cloud, this attribute identifies the region where the called destination is deployed.\n *\n * @example us-central1\n * @example us-east-1\n *\n * @note Refer to your provider's docs to see the available regions, for example [Alibaba Cloud regions](https://www.alibabacloud.com/help/doc-detail/40654.htm), [AWS regions](https://aws.amazon.com/about-aws/global-infrastructure/regions_az/), [Azure regions](https://azure.microsoft.com/global-infrastructure/geographies/), [Google Cloud regions](https://cloud.google.com/about/locations), or [Tencent Cloud regions](https://www.tencentcloud.com/document/product/213/6091).\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_CLOUD_REGION = 'cloud.region' as const;\n\n/**\n * Unique host ID. For Cloud, this must be the instance_id assigned by the cloud provider. For non-containerized systems, this should be the `machine-id`. See the table below for the sources to use to determine the `machine-id` based on operating system.\n *\n * @example fdbf79e8af94cb7f9e8df36789187052\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_HOST_ID = 'host.id' as const;\n\n/**\n * Name of the host. On Unix systems, it may contain what the hostname command returns, or the fully qualified hostname, or another name specified by the user.\n *\n * @example opentelemetry-test\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_HOST_NAME = 'host.name' as const;\n\n/**\n * Type of host. For Cloud, this must be the machine type.\n *\n * @example n1-standard-1\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_HOST_TYPE = 'host.type' as const;\n\n/**\n * Enum value \"alibaba_cloud_ecs\" for attribute {@link ATTR_CLOUD_PLATFORM}.\n *\n * Alibaba Cloud Elastic Compute Service\n *\n * @experimental This enum value is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const CLOUD_PLATFORM_VALUE_ALIBABA_CLOUD_ECS =\n 'alibaba_cloud_ecs' as const;\n\n/**\n * Enum value \"alibaba_cloud\" for attribute {@link ATTR_CLOUD_PROVIDER}.\n *\n * Alibaba Cloud\n *\n * @experimental This enum value is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const CLOUD_PROVIDER_VALUE_ALIBABA_CLOUD = 'alibaba_cloud' as const;\n"]}
|
|
@@ -18,7 +18,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
18
18
|
exports.alibabaCloudEcsDetector = void 0;
|
|
19
19
|
const api_1 = require("@opentelemetry/api");
|
|
20
20
|
const core_1 = require("@opentelemetry/core");
|
|
21
|
-
const
|
|
21
|
+
const semconv_1 = require("../semconv");
|
|
22
22
|
const http = require("http");
|
|
23
23
|
/**
|
|
24
24
|
* The AlibabaCloudEcsDetector can be used to detect if a process is running in
|
|
@@ -44,14 +44,14 @@ class AlibabaCloudEcsDetector {
|
|
|
44
44
|
detect() {
|
|
45
45
|
const dataPromise = api_1.context.with((0, core_1.suppressTracing)(api_1.context.active()), () => this._gatherData());
|
|
46
46
|
const attrNames = [
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
47
|
+
semconv_1.ATTR_CLOUD_PROVIDER,
|
|
48
|
+
semconv_1.ATTR_CLOUD_PLATFORM,
|
|
49
|
+
semconv_1.ATTR_CLOUD_ACCOUNT_ID,
|
|
50
|
+
semconv_1.ATTR_CLOUD_REGION,
|
|
51
|
+
semconv_1.ATTR_CLOUD_AVAILABILITY_ZONE,
|
|
52
|
+
semconv_1.ATTR_HOST_ID,
|
|
53
|
+
semconv_1.ATTR_HOST_TYPE,
|
|
54
|
+
semconv_1.ATTR_HOST_NAME,
|
|
55
55
|
];
|
|
56
56
|
const attributes = {};
|
|
57
57
|
attrNames.forEach(name => {
|
|
@@ -66,14 +66,14 @@ class AlibabaCloudEcsDetector {
|
|
|
66
66
|
const { 'owner-account-id': accountId, 'instance-id': instanceId, 'instance-type': instanceType, 'region-id': region, 'zone-id': availabilityZone, } = await this._fetchIdentity();
|
|
67
67
|
const hostname = await this._fetchHost();
|
|
68
68
|
return {
|
|
69
|
-
[
|
|
70
|
-
[
|
|
71
|
-
[
|
|
72
|
-
[
|
|
73
|
-
[
|
|
74
|
-
[
|
|
75
|
-
[
|
|
76
|
-
[
|
|
69
|
+
[semconv_1.ATTR_CLOUD_PROVIDER]: semconv_1.CLOUD_PROVIDER_VALUE_ALIBABA_CLOUD,
|
|
70
|
+
[semconv_1.ATTR_CLOUD_PLATFORM]: semconv_1.CLOUD_PLATFORM_VALUE_ALIBABA_CLOUD_ECS,
|
|
71
|
+
[semconv_1.ATTR_CLOUD_ACCOUNT_ID]: accountId,
|
|
72
|
+
[semconv_1.ATTR_CLOUD_REGION]: region,
|
|
73
|
+
[semconv_1.ATTR_CLOUD_AVAILABILITY_ZONE]: availabilityZone,
|
|
74
|
+
[semconv_1.ATTR_HOST_ID]: instanceId,
|
|
75
|
+
[semconv_1.ATTR_HOST_TYPE]: instanceType,
|
|
76
|
+
[semconv_1.ATTR_HOST_NAME]: hostname,
|
|
77
77
|
};
|
|
78
78
|
}
|
|
79
79
|
catch (err) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AlibabaCloudEcsDetector.js","sourceRoot":"","sources":["../../../src/detectors/AlibabaCloudEcsDetector.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,4CAAmD;AACnD,8CAAsD;AAMtD,
|
|
1
|
+
{"version":3,"file":"AlibabaCloudEcsDetector.js","sourceRoot":"","sources":["../../../src/detectors/AlibabaCloudEcsDetector.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,4CAAmD;AACnD,8CAAsD;AAMtD,wCAWoB;AAEpB,6BAA6B;AAE7B;;;;GAIG;AACH,MAAM,uBAAuB;IAC3B;;;OAGG;IACM,2BAA2B,GAAG,iBAAiB,CAAC;IAChD,6CAA6C,GACpD,4CAA4C,CAAC;IACtC,yCAAyC,GAChD,4BAA4B,CAAC;IACtB,qBAAqB,GAAG,IAAI,CAAC;IAEtC;;;;;;OAMG;IACH,MAAM;QACJ,MAAM,WAAW,GAAG,aAAO,CAAC,IAAI,CAAC,IAAA,sBAAe,EAAC,aAAO,CAAC,MAAM,EAAE,CAAC,EAAE,GAAG,EAAE,CACvE,IAAI,CAAC,WAAW,EAAE,CACnB,CAAC;QAEF,MAAM,SAAS,GAAG;YAChB,6BAAmB;YACnB,6BAAmB;YACnB,+BAAqB;YACrB,2BAAiB;YACjB,sCAA4B;YAC5B,sBAAY;YACZ,wBAAc;YACd,wBAAc;SACf,CAAC;QAEF,MAAM,UAAU,GAAG,EAAgC,CAAC;QACpD,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;YACvB,yEAAyE;YACzE,UAAU,CAAC,IAAI,CAAC,GAAG,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAC1D,CAAC,CAAC,CAAC;QAEH,OAAO,EAAE,UAAU,EAAE,CAAC;IACxB,CAAC;IAED,qFAAqF;IACrF,KAAK,CAAC,WAAW;QACf,IAAI;YACF,MAAM,EACJ,kBAAkB,EAAE,SAAS,EAC7B,aAAa,EAAE,UAAU,EACzB,eAAe,EAAE,YAAY,EAC7B,WAAW,E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AAC,OAAO,EAAE,GAAG,CAAC,EAAE;gBACpB,YAAY,CAAC,SAAS,CAAC,CAAC;gBACxB,MAAM,CAAC,GAAG,CAAC,CAAC;YACd,CAAC,CAAC,CAAC;YACH,GAAG,CAAC,GAAG,EAAE,CAAC;QACZ,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAEY,QAAA,uBAAuB,GAAG,IAAI,uBAAuB,EAAE,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 { context, diag } from '@opentelemetry/api';\nimport { suppressTracing } from '@opentelemetry/core';\nimport {\n ResourceDetector,\n DetectedResource,\n DetectedResourceAttributes,\n} from '@opentelemetry/resources';\nimport {\n CLOUD_PLATFORM_VALUE_ALIBABA_CLOUD_ECS,\n CLOUD_PROVIDER_VALUE_ALIBABA_CLOUD,\n ATTR_CLOUD_ACCOUNT_ID,\n ATTR_CLOUD_AVAILABILITY_ZONE,\n ATTR_CLOUD_PLATFORM,\n ATTR_CLOUD_PROVIDER,\n ATTR_CLOUD_REGION,\n ATTR_HOST_ID,\n ATTR_HOST_NAME,\n ATTR_HOST_TYPE,\n} from '../semconv';\n\nimport * as http from 'http';\n\n/**\n * The AlibabaCloudEcsDetector can be used to detect if a process is running in\n * AlibabaCloud ECS and return a {@link Resource} populated with metadata about\n * the ECS instance. Returns an empty Resource if detection fails.\n */\nclass AlibabaCloudEcsDetector implements ResourceDetector {\n /**\n * See https://www.alibabacloud.com/help/doc-detail/67254.htm for\n * documentation about the AlibabaCloud instance identity document.\n */\n readonly ALIBABA_CLOUD_IDMS_ENDPOINT = '100.100.100.200';\n readonly ALIBABA_CLOUD_INSTANCE_IDENTITY_DOCUMENT_PATH =\n '/latest/dynamic/instance-identity/document';\n readonly ALIBABA_CLOUD_INSTANCE_HOST_DOCUMENT_PATH =\n '/latest/meta-data/hostname';\n readonly MILLISECONDS_TIME_OUT = 1000;\n\n /**\n * Attempts to connect and obtain an AlibabaCloud instance Identity document.\n * If the connection is successful it returns a promise containing a\n * {@link Resource} populated with instance metadata.\n *\n * @param config (unused) The resource detection config\n */\n detect(): DetectedResource {\n const dataPromise = context.with(suppressTracing(context.active()), () =>\n this._gatherData()\n );\n\n const attrNames = [\n ATTR_CLOUD_PROVIDER,\n ATTR_CLOUD_PLATFORM,\n ATTR_CLOUD_ACCOUNT_ID,\n ATTR_CLOUD_REGION,\n ATTR_CLOUD_AVAILABILITY_ZONE,\n ATTR_HOST_ID,\n ATTR_HOST_TYPE,\n ATTR_HOST_NAME,\n ];\n\n const attributes = {} as DetectedResourceAttributes;\n attrNames.forEach(name => {\n // Each resource attribute is determined asynchronously in _gatherData().\n attributes[name] = dataPromise.then(data => data[name]);\n });\n\n return { attributes };\n }\n\n /** Gets identity and host info and returns them as attribs. Empty object if fails */\n async _gatherData(): Promise<DetectedResourceAttributes> {\n try {\n const {\n 'owner-account-id': accountId,\n 'instance-id': instanceId,\n 'instance-type': instanceType,\n 'region-id': region,\n 'zone-id': availabilityZone,\n } = await this._fetchIdentity();\n const hostname = await this._fetchHost();\n\n return {\n [ATTR_CLOUD_PROVIDER]: CLOUD_PROVIDER_VALUE_ALIBABA_CLOUD,\n [ATTR_CLOUD_PLATFORM]: CLOUD_PLATFORM_VALUE_ALIBABA_CLOUD_ECS,\n [ATTR_CLOUD_ACCOUNT_ID]: accountId,\n [ATTR_CLOUD_REGION]: region,\n [ATTR_CLOUD_AVAILABILITY_ZONE]: availabilityZone,\n [ATTR_HOST_ID]: instanceId,\n [ATTR_HOST_TYPE]: instanceType,\n [ATTR_HOST_NAME]: hostname,\n };\n } catch (err: any) {\n diag.debug(\n `${this.constructor.name}: did not detect resource: ${err?.message}`\n );\n return {};\n }\n }\n\n /**\n * Fetch AlibabaCloud instance document url with http requests. If the\n * application is running on an ECS instance, we should be able to get back a\n * valid JSON document. Parses that document and stores the identity\n * properties in a local map.\n */\n private async _fetchIdentity(): Promise<any> {\n const options = {\n host: this.ALIBABA_CLOUD_IDMS_ENDPOINT,\n path: this.ALIBABA_CLOUD_INSTANCE_IDENTITY_DOCUMENT_PATH,\n method: 'GET',\n timeout: this.MILLISECONDS_TIME_OUT,\n };\n const identity = await this._fetchString(options);\n return JSON.parse(identity);\n }\n\n private async _fetchHost(): Promise<string> {\n const options = {\n host: this.ALIBABA_CLOUD_IDMS_ENDPOINT,\n path: this.ALIBABA_CLOUD_INSTANCE_HOST_DOCUMENT_PATH,\n method: 'GET',\n timeout: this.MILLISECONDS_TIME_OUT,\n };\n return await this._fetchString(options);\n }\n\n private async _fetchString(options: http.RequestOptions): Promise<string> {\n return new Promise((resolve, reject) => {\n const timeoutId = setTimeout(() => {\n req.destroy(new Error('ECS metadata api request timed out.'));\n }, this.MILLISECONDS_TIME_OUT);\n\n const req = http.request(options, res => {\n clearTimeout(timeoutId);\n const { statusCode } = res;\n if (\n typeof statusCode !== 'number' ||\n !(statusCode >= 200 && statusCode < 300)\n ) {\n res.destroy();\n return reject(\n new Error(`Failed to load page, status code: ${statusCode}`)\n );\n }\n\n res.setEncoding('utf8');\n let rawData = '';\n res.on('data', chunk => (rawData += chunk));\n res.on('error', err => {\n reject(err);\n });\n res.on('end', () => {\n resolve(rawData);\n });\n });\n req.on('error', err => {\n clearTimeout(timeoutId);\n reject(err);\n });\n req.end();\n });\n }\n}\n\nexport const alibabaCloudEcsDetector = new AlibabaCloudEcsDetector();\n"]}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The cloud account ID the resource is assigned to.
|
|
3
|
+
*
|
|
4
|
+
* @example 111111111111
|
|
5
|
+
* @example opentelemetry
|
|
6
|
+
*
|
|
7
|
+
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
|
|
8
|
+
*/
|
|
9
|
+
export declare const ATTR_CLOUD_ACCOUNT_ID: "cloud.account.id";
|
|
10
|
+
/**
|
|
11
|
+
* Cloud regions often have multiple, isolated locations known as zones to increase availability. Availability zone represents the zone where the resource is running.
|
|
12
|
+
*
|
|
13
|
+
* @example us-east-1c
|
|
14
|
+
*
|
|
15
|
+
* @note Availability zones are called "zones" on Alibaba Cloud and Google Cloud.
|
|
16
|
+
*
|
|
17
|
+
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
|
|
18
|
+
*/
|
|
19
|
+
export declare const ATTR_CLOUD_AVAILABILITY_ZONE: "cloud.availability_zone";
|
|
20
|
+
/**
|
|
21
|
+
* The cloud platform in use.
|
|
22
|
+
*
|
|
23
|
+
* @note The prefix of the service **SHOULD** match the one specified in `cloud.provider`.
|
|
24
|
+
*
|
|
25
|
+
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
|
|
26
|
+
*/
|
|
27
|
+
export declare const ATTR_CLOUD_PLATFORM: "cloud.platform";
|
|
28
|
+
/**
|
|
29
|
+
* Name of the cloud provider.
|
|
30
|
+
*
|
|
31
|
+
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
|
|
32
|
+
*/
|
|
33
|
+
export declare const ATTR_CLOUD_PROVIDER: "cloud.provider";
|
|
34
|
+
/**
|
|
35
|
+
* The geographical region within a cloud provider. When associated with a resource, this attribute specifies the region where the resource operates. When calling services or APIs deployed on a cloud, this attribute identifies the region where the called destination is deployed.
|
|
36
|
+
*
|
|
37
|
+
* @example us-central1
|
|
38
|
+
* @example us-east-1
|
|
39
|
+
*
|
|
40
|
+
* @note Refer to your provider's docs to see the available regions, for example [Alibaba Cloud regions](https://www.alibabacloud.com/help/doc-detail/40654.htm), [AWS regions](https://aws.amazon.com/about-aws/global-infrastructure/regions_az/), [Azure regions](https://azure.microsoft.com/global-infrastructure/geographies/), [Google Cloud regions](https://cloud.google.com/about/locations), or [Tencent Cloud regions](https://www.tencentcloud.com/document/product/213/6091).
|
|
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_CLOUD_REGION: "cloud.region";
|
|
45
|
+
/**
|
|
46
|
+
* Unique host ID. For Cloud, this must be the instance_id assigned by the cloud provider. For non-containerized systems, this should be the `machine-id`. See the table below for the sources to use to determine the `machine-id` based on operating system.
|
|
47
|
+
*
|
|
48
|
+
* @example fdbf79e8af94cb7f9e8df36789187052
|
|
49
|
+
*
|
|
50
|
+
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
|
|
51
|
+
*/
|
|
52
|
+
export declare const ATTR_HOST_ID: "host.id";
|
|
53
|
+
/**
|
|
54
|
+
* Name of the host. On Unix systems, it may contain what the hostname command returns, or the fully qualified hostname, or another name specified by the user.
|
|
55
|
+
*
|
|
56
|
+
* @example opentelemetry-test
|
|
57
|
+
*
|
|
58
|
+
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
|
|
59
|
+
*/
|
|
60
|
+
export declare const ATTR_HOST_NAME: "host.name";
|
|
61
|
+
/**
|
|
62
|
+
* Type of host. For Cloud, this must be the machine type.
|
|
63
|
+
*
|
|
64
|
+
* @example n1-standard-1
|
|
65
|
+
*
|
|
66
|
+
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
|
|
67
|
+
*/
|
|
68
|
+
export declare const ATTR_HOST_TYPE: "host.type";
|
|
69
|
+
/**
|
|
70
|
+
* Enum value "alibaba_cloud_ecs" for attribute {@link ATTR_CLOUD_PLATFORM}.
|
|
71
|
+
*
|
|
72
|
+
* Alibaba Cloud Elastic Compute Service
|
|
73
|
+
*
|
|
74
|
+
* @experimental This enum value is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
|
|
75
|
+
*/
|
|
76
|
+
export declare const CLOUD_PLATFORM_VALUE_ALIBABA_CLOUD_ECS: "alibaba_cloud_ecs";
|
|
77
|
+
/**
|
|
78
|
+
* Enum value "alibaba_cloud" for attribute {@link ATTR_CLOUD_PROVIDER}.
|
|
79
|
+
*
|
|
80
|
+
* Alibaba Cloud
|
|
81
|
+
*
|
|
82
|
+
* @experimental This enum value is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
|
|
83
|
+
*/
|
|
84
|
+
export declare const CLOUD_PROVIDER_VALUE_ALIBABA_CLOUD: "alibaba_cloud";
|
|
85
|
+
//# sourceMappingURL=semconv.d.ts.map
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright The OpenTelemetry Authors
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.CLOUD_PROVIDER_VALUE_ALIBABA_CLOUD = exports.CLOUD_PLATFORM_VALUE_ALIBABA_CLOUD_ECS = exports.ATTR_HOST_TYPE = exports.ATTR_HOST_NAME = exports.ATTR_HOST_ID = exports.ATTR_CLOUD_REGION = exports.ATTR_CLOUD_PROVIDER = exports.ATTR_CLOUD_PLATFORM = exports.ATTR_CLOUD_AVAILABILITY_ZONE = exports.ATTR_CLOUD_ACCOUNT_ID = void 0;
|
|
19
|
+
/*
|
|
20
|
+
* This file contains a copy of unstable semantic convention definitions
|
|
21
|
+
* used by this package.
|
|
22
|
+
* @see https://github.com/open-telemetry/opentelemetry-js/tree/main/semantic-conventions#unstable-semconv
|
|
23
|
+
*/
|
|
24
|
+
/**
|
|
25
|
+
* The cloud account ID the resource is assigned to.
|
|
26
|
+
*
|
|
27
|
+
* @example 111111111111
|
|
28
|
+
* @example opentelemetry
|
|
29
|
+
*
|
|
30
|
+
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
|
|
31
|
+
*/
|
|
32
|
+
exports.ATTR_CLOUD_ACCOUNT_ID = 'cloud.account.id';
|
|
33
|
+
/**
|
|
34
|
+
* Cloud regions often have multiple, isolated locations known as zones to increase availability. Availability zone represents the zone where the resource is running.
|
|
35
|
+
*
|
|
36
|
+
* @example us-east-1c
|
|
37
|
+
*
|
|
38
|
+
* @note Availability zones are called "zones" on Alibaba Cloud and Google Cloud.
|
|
39
|
+
*
|
|
40
|
+
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
|
|
41
|
+
*/
|
|
42
|
+
exports.ATTR_CLOUD_AVAILABILITY_ZONE = 'cloud.availability_zone';
|
|
43
|
+
/**
|
|
44
|
+
* The cloud platform in use.
|
|
45
|
+
*
|
|
46
|
+
* @note The prefix of the service **SHOULD** match the one specified in `cloud.provider`.
|
|
47
|
+
*
|
|
48
|
+
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
|
|
49
|
+
*/
|
|
50
|
+
exports.ATTR_CLOUD_PLATFORM = 'cloud.platform';
|
|
51
|
+
/**
|
|
52
|
+
* Name of the cloud provider.
|
|
53
|
+
*
|
|
54
|
+
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
|
|
55
|
+
*/
|
|
56
|
+
exports.ATTR_CLOUD_PROVIDER = 'cloud.provider';
|
|
57
|
+
/**
|
|
58
|
+
* The geographical region within a cloud provider. When associated with a resource, this attribute specifies the region where the resource operates. When calling services or APIs deployed on a cloud, this attribute identifies the region where the called destination is deployed.
|
|
59
|
+
*
|
|
60
|
+
* @example us-central1
|
|
61
|
+
* @example us-east-1
|
|
62
|
+
*
|
|
63
|
+
* @note Refer to your provider's docs to see the available regions, for example [Alibaba Cloud regions](https://www.alibabacloud.com/help/doc-detail/40654.htm), [AWS regions](https://aws.amazon.com/about-aws/global-infrastructure/regions_az/), [Azure regions](https://azure.microsoft.com/global-infrastructure/geographies/), [Google Cloud regions](https://cloud.google.com/about/locations), or [Tencent Cloud regions](https://www.tencentcloud.com/document/product/213/6091).
|
|
64
|
+
*
|
|
65
|
+
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
|
|
66
|
+
*/
|
|
67
|
+
exports.ATTR_CLOUD_REGION = 'cloud.region';
|
|
68
|
+
/**
|
|
69
|
+
* Unique host ID. For Cloud, this must be the instance_id assigned by the cloud provider. For non-containerized systems, this should be the `machine-id`. See the table below for the sources to use to determine the `machine-id` based on operating system.
|
|
70
|
+
*
|
|
71
|
+
* @example fdbf79e8af94cb7f9e8df36789187052
|
|
72
|
+
*
|
|
73
|
+
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
|
|
74
|
+
*/
|
|
75
|
+
exports.ATTR_HOST_ID = 'host.id';
|
|
76
|
+
/**
|
|
77
|
+
* Name of the host. On Unix systems, it may contain what the hostname command returns, or the fully qualified hostname, or another name specified by the user.
|
|
78
|
+
*
|
|
79
|
+
* @example opentelemetry-test
|
|
80
|
+
*
|
|
81
|
+
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
|
|
82
|
+
*/
|
|
83
|
+
exports.ATTR_HOST_NAME = 'host.name';
|
|
84
|
+
/**
|
|
85
|
+
* Type of host. For Cloud, this must be the machine type.
|
|
86
|
+
*
|
|
87
|
+
* @example n1-standard-1
|
|
88
|
+
*
|
|
89
|
+
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
|
|
90
|
+
*/
|
|
91
|
+
exports.ATTR_HOST_TYPE = 'host.type';
|
|
92
|
+
/**
|
|
93
|
+
* Enum value "alibaba_cloud_ecs" for attribute {@link ATTR_CLOUD_PLATFORM}.
|
|
94
|
+
*
|
|
95
|
+
* Alibaba Cloud Elastic Compute Service
|
|
96
|
+
*
|
|
97
|
+
* @experimental This enum value is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
|
|
98
|
+
*/
|
|
99
|
+
exports.CLOUD_PLATFORM_VALUE_ALIBABA_CLOUD_ECS = 'alibaba_cloud_ecs';
|
|
100
|
+
/**
|
|
101
|
+
* Enum value "alibaba_cloud" for attribute {@link ATTR_CLOUD_PROVIDER}.
|
|
102
|
+
*
|
|
103
|
+
* Alibaba Cloud
|
|
104
|
+
*
|
|
105
|
+
* @experimental This enum value is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
|
|
106
|
+
*/
|
|
107
|
+
exports.CLOUD_PROVIDER_VALUE_ALIBABA_CLOUD = 'alibaba_cloud';
|
|
108
|
+
//# sourceMappingURL=semconv.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"semconv.js","sourceRoot":"","sources":["../../src/semconv.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH;;;;GAIG;AAEH;;;;;;;GAOG;AACU,QAAA,qBAAqB,GAAG,kBAA2B,CAAC;AAEjE;;;;;;;;GAQG;AACU,QAAA,4BAA4B,GAAG,yBAAkC,CAAC;AAE/E;;;;;;GAMG;AACU,QAAA,mBAAmB,GAAG,gBAAyB,CAAC;AAE7D;;;;GAIG;AACU,QAAA,mBAAmB,GAAG,gBAAyB,CAAC;AAE7D;;;;;;;;;GASG;AACU,QAAA,iBAAiB,GAAG,cAAuB,CAAC;AAEzD;;;;;;GAMG;AACU,QAAA,YAAY,GAAG,SAAkB,CAAC;AAE/C;;;;;;GAMG;AACU,QAAA,cAAc,GAAG,WAAoB,CAAC;AAEnD;;;;;;GAMG;AACU,QAAA,cAAc,GAAG,WAAoB,CAAC;AAEnD;;;;;;GAMG;AACU,QAAA,sCAAsC,GACjD,mBAA4B,CAAC;AAE/B;;;;;;GAMG;AACU,QAAA,kCAAkC,GAAG,eAAwB,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\n/*\n * This file contains a copy of unstable semantic convention definitions\n * used by this package.\n * @see https://github.com/open-telemetry/opentelemetry-js/tree/main/semantic-conventions#unstable-semconv\n */\n\n/**\n * The cloud account ID the resource is assigned to.\n *\n * @example 111111111111\n * @example opentelemetry\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_CLOUD_ACCOUNT_ID = 'cloud.account.id' as const;\n\n/**\n * Cloud regions often have multiple, isolated locations known as zones to increase availability. Availability zone represents the zone where the resource is running.\n *\n * @example us-east-1c\n *\n * @note Availability zones are called \"zones\" on Alibaba Cloud and Google Cloud.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_CLOUD_AVAILABILITY_ZONE = 'cloud.availability_zone' as const;\n\n/**\n * The cloud platform in use.\n *\n * @note The prefix of the service **SHOULD** match the one specified in `cloud.provider`.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_CLOUD_PLATFORM = 'cloud.platform' as const;\n\n/**\n * Name of the cloud provider.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_CLOUD_PROVIDER = 'cloud.provider' as const;\n\n/**\n * The geographical region within a cloud provider. When associated with a resource, this attribute specifies the region where the resource operates. When calling services or APIs deployed on a cloud, this attribute identifies the region where the called destination is deployed.\n *\n * @example us-central1\n * @example us-east-1\n *\n * @note Refer to your provider's docs to see the available regions, for example [Alibaba Cloud regions](https://www.alibabacloud.com/help/doc-detail/40654.htm), [AWS regions](https://aws.amazon.com/about-aws/global-infrastructure/regions_az/), [Azure regions](https://azure.microsoft.com/global-infrastructure/geographies/), [Google Cloud regions](https://cloud.google.com/about/locations), or [Tencent Cloud regions](https://www.tencentcloud.com/document/product/213/6091).\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_CLOUD_REGION = 'cloud.region' as const;\n\n/**\n * Unique host ID. For Cloud, this must be the instance_id assigned by the cloud provider. For non-containerized systems, this should be the `machine-id`. See the table below for the sources to use to determine the `machine-id` based on operating system.\n *\n * @example fdbf79e8af94cb7f9e8df36789187052\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_HOST_ID = 'host.id' as const;\n\n/**\n * Name of the host. On Unix systems, it may contain what the hostname command returns, or the fully qualified hostname, or another name specified by the user.\n *\n * @example opentelemetry-test\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_HOST_NAME = 'host.name' as const;\n\n/**\n * Type of host. For Cloud, this must be the machine type.\n *\n * @example n1-standard-1\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_HOST_TYPE = 'host.type' as const;\n\n/**\n * Enum value \"alibaba_cloud_ecs\" for attribute {@link ATTR_CLOUD_PLATFORM}.\n *\n * Alibaba Cloud Elastic Compute Service\n *\n * @experimental This enum value is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const CLOUD_PLATFORM_VALUE_ALIBABA_CLOUD_ECS =\n 'alibaba_cloud_ecs' as const;\n\n/**\n * Enum value \"alibaba_cloud\" for attribute {@link ATTR_CLOUD_PROVIDER}.\n *\n * Alibaba Cloud\n *\n * @experimental This enum value is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const CLOUD_PROVIDER_VALUE_ALIBABA_CLOUD = 'alibaba_cloud' as const;\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opentelemetry/resource-detector-alibaba-cloud",
|
|
3
|
-
"version": "0.31.
|
|
3
|
+
"version": "0.31.8",
|
|
4
4
|
"description": "OpenTelemetry resource detector for Alibaba Cloud",
|
|
5
5
|
"main": "build/src/index.js",
|
|
6
6
|
"module": "build/esm/index.js",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@opentelemetry/api": "^1.0.0",
|
|
50
|
-
"@opentelemetry/contrib-test-utils": "^0.
|
|
50
|
+
"@opentelemetry/contrib-test-utils": "^0.52.2",
|
|
51
51
|
"@opentelemetry/sdk-trace-base": "^2.0.0",
|
|
52
52
|
"@types/mocha": "10.0.10",
|
|
53
53
|
"@types/node": "18.18.14",
|
|
@@ -63,10 +63,9 @@
|
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
65
|
"@opentelemetry/core": "^2.0.0",
|
|
66
|
-
"@opentelemetry/resources": "^2.0.0"
|
|
67
|
-
"@opentelemetry/semantic-conventions": "^1.27.0"
|
|
66
|
+
"@opentelemetry/resources": "^2.0.0"
|
|
68
67
|
},
|
|
69
68
|
"homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/packages/resource-detector-alibaba-cloud#readme",
|
|
70
69
|
"sideEffects": false,
|
|
71
|
-
"gitHead": "
|
|
70
|
+
"gitHead": "5a5918fd4f9f16b14c9ef4d3de08ab98c20e5b46"
|
|
72
71
|
}
|