@opentelemetry/resource-detector-gcp 0.39.0 → 0.40.2

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.
Files changed (38) hide show
  1. package/README.md +1 -1
  2. package/build/esm/detectors/GcpDetector.d.ts +6 -21
  3. package/build/esm/detectors/GcpDetector.js +150 -99
  4. package/build/esm/detectors/GcpDetector.js.map +1 -1
  5. package/build/esm/detectors/faas.d.ts +25 -0
  6. package/build/esm/detectors/faas.js +75 -0
  7. package/build/esm/detectors/faas.js.map +1 -0
  8. package/build/esm/detectors/gae.d.ts +36 -0
  9. package/build/esm/detectors/gae.js +87 -0
  10. package/build/esm/detectors/gae.js.map +1 -0
  11. package/build/esm/detectors/gce.d.ts +25 -0
  12. package/build/esm/detectors/gce.js +76 -0
  13. package/build/esm/detectors/gce.js.map +1 -0
  14. package/build/esm/detectors/gke.d.ts +20 -0
  15. package/build/esm/detectors/gke.js +67 -0
  16. package/build/esm/detectors/gke.js.map +1 -0
  17. package/build/esm/semconv.d.ts +180 -0
  18. package/build/esm/semconv.js +200 -0
  19. package/build/esm/semconv.js.map +1 -0
  20. package/build/src/detectors/GcpDetector.d.ts +6 -21
  21. package/build/src/detectors/GcpDetector.js +152 -100
  22. package/build/src/detectors/GcpDetector.js.map +1 -1
  23. package/build/src/detectors/faas.d.ts +25 -0
  24. package/build/src/detectors/faas.js +84 -0
  25. package/build/src/detectors/faas.js.map +1 -0
  26. package/build/src/detectors/gae.d.ts +36 -0
  27. package/build/src/detectors/gae.js +98 -0
  28. package/build/src/detectors/gae.js.map +1 -0
  29. package/build/src/detectors/gce.d.ts +25 -0
  30. package/build/src/detectors/gce.js +84 -0
  31. package/build/src/detectors/gce.js.map +1 -0
  32. package/build/src/detectors/gke.d.ts +20 -0
  33. package/build/src/detectors/gke.js +74 -0
  34. package/build/src/detectors/gke.js.map +1 -0
  35. package/build/src/semconv.d.ts +180 -0
  36. package/build/src/semconv.js +203 -0
  37. package/build/src/semconv.js.map +1 -0
  38. package/package.json +6 -6
@@ -0,0 +1,84 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright 2022 Google LLC
4
+ * Copyright The OpenTelemetry Authors
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this file except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * https://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ */
18
+ Object.defineProperty(exports, "__esModule", { value: true });
19
+ exports.availabilityZoneAndRegion = exports.hostName = exports.hostId = exports.hostType = exports.onGce = void 0;
20
+ /**
21
+ * Implementation in this file copied from
22
+ * https://github.com/GoogleCloudPlatform/opentelemetry-operations-go/blob/v1.8.0/detectors/gcp/gce.go
23
+ */
24
+ const api_1 = require("@opentelemetry/api");
25
+ const metadata = require("gcp-metadata");
26
+ const MACHINE_TYPE_METADATA_ATTR = 'machine-type';
27
+ const ID_METADATA_ATTR = 'id';
28
+ const HOST_NAME_METADATA_ATTR = 'name';
29
+ const ZONE_METADATA_ATTR = 'zone';
30
+ async function onGce() {
31
+ try {
32
+ await metadata.instance(MACHINE_TYPE_METADATA_ATTR);
33
+ return true;
34
+ }
35
+ catch (err) {
36
+ api_1.diag.debug('Could not fetch metadata attribute %s, assuming not on GCE. Error was %s', MACHINE_TYPE_METADATA_ATTR, err);
37
+ return false;
38
+ }
39
+ }
40
+ exports.onGce = onGce;
41
+ /**
42
+ * The machine type of the instance on which this program is running. Check that {@link
43
+ * onGce()} is true before calling this, or it may throw exceptions.
44
+ */
45
+ async function hostType() {
46
+ return metadata.instance(MACHINE_TYPE_METADATA_ATTR);
47
+ }
48
+ exports.hostType = hostType;
49
+ /**
50
+ * The instance ID of the instance on which this program is running. Check that {@link onGce()}
51
+ * is true before calling this, or it may throw exceptions.
52
+ */
53
+ async function hostId() {
54
+ // May be a bignumber.js BigNumber which can just be converted with toString(). See
55
+ // https://github.com/googleapis/gcp-metadata#take-care-with-large-number-valued-properties
56
+ const id = await metadata.instance(ID_METADATA_ATTR);
57
+ return id.toString();
58
+ }
59
+ exports.hostId = hostId;
60
+ /**
61
+ * The instance ID of the instance on which this program is running. Check that {@link onGce()}
62
+ * is true before calling this, or it may throw exceptions.
63
+ */
64
+ async function hostName() {
65
+ return metadata.instance(HOST_NAME_METADATA_ATTR);
66
+ }
67
+ exports.hostName = hostName;
68
+ /**
69
+ * The zone and region in which this program is running. Check that {@link onGce()} is true
70
+ * before calling this, or it may throw exceptions.
71
+ */
72
+ async function availabilityZoneAndRegion() {
73
+ const fullZone = await metadata.instance(ZONE_METADATA_ATTR);
74
+ // Format described in
75
+ // https://cloud.google.com/compute/docs/metadata/default-metadata-values#vm_instance_metadata
76
+ const re = /projects\/\d+\/zones\/(?<zone>(?<region>\w+-\w+)-\w+)/;
77
+ const { zone, region } = fullZone.match(re)?.groups ?? {};
78
+ if (!zone || !region) {
79
+ throw new Error(`zone was not in the expected format: projects/PROJECT_NUM/zones/COUNTRY-REGION-ZONE. Got ${fullZone}`);
80
+ }
81
+ return { zone, region };
82
+ }
83
+ exports.availabilityZoneAndRegion = availabilityZoneAndRegion;
84
+ //# sourceMappingURL=gce.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gce.js","sourceRoot":"","sources":["../../../src/detectors/gce.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;AAEH;;;GAGG;AAEH,4CAA0C;AAC1C,yCAAyC;AAEzC,MAAM,0BAA0B,GAAG,cAAc,CAAC;AAClD,MAAM,gBAAgB,GAAG,IAAI,CAAC;AAC9B,MAAM,uBAAuB,GAAG,MAAM,CAAC;AACvC,MAAM,kBAAkB,GAAG,MAAM,CAAC;AAE3B,KAAK,UAAU,KAAK;IACzB,IAAI;QACF,MAAM,QAAQ,CAAC,QAAQ,CAAS,0BAA0B,CAAC,CAAC;QAC5D,OAAO,IAAI,CAAC;KACb;IAAC,OAAO,GAAG,EAAE;QACZ,UAAI,CAAC,KAAK,CACR,0EAA0E,EAC1E,0BAA0B,EAC1B,GAAG,CACJ,CAAC;QACF,OAAO,KAAK,CAAC;KACd;AACH,CAAC;AAZD,sBAYC;AAED;;;GAGG;AACI,KAAK,UAAU,QAAQ;IAC5B,OAAO,QAAQ,CAAC,QAAQ,CAAS,0BAA0B,CAAC,CAAC;AAC/D,CAAC;AAFD,4BAEC;AAED;;;GAGG;AACI,KAAK,UAAU,MAAM;IAC1B,mFAAmF;IACnF,2FAA2F;IAC3F,MAAM,EAAE,GAAG,MAAM,QAAQ,CAAC,QAAQ,CAAkB,gBAAgB,CAAC,CAAC;IACtE,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC;AACvB,CAAC;AALD,wBAKC;AAED;;;GAGG;AACI,KAAK,UAAU,QAAQ;IAC5B,OAAO,QAAQ,CAAC,QAAQ,CAAS,uBAAuB,CAAC,CAAC;AAC5D,CAAC;AAFD,4BAEC;AAED;;;GAGG;AACI,KAAK,UAAU,yBAAyB;IAI7C,MAAM,QAAQ,GAAG,MAAM,QAAQ,CAAC,QAAQ,CAAS,kBAAkB,CAAC,CAAC;IAErE,sBAAsB;IACtB,8FAA8F;IAC9F,MAAM,EAAE,GAAG,uDAAuD,CAAC;IACnE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE,MAAM,IAAI,EAAE,CAAC;IAC1D,IAAI,CAAC,IAAI,IAAI,CAAC,MAAM,EAAE;QACpB,MAAM,IAAI,KAAK,CACb,4FAA4F,QAAQ,EAAE,CACvG,CAAC;KACH;IAED,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AAC1B,CAAC;AAjBD,8DAiBC","sourcesContent":["/*\n * Copyright 2022 Google LLC\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 * Implementation in this file copied from\n * https://github.com/GoogleCloudPlatform/opentelemetry-operations-go/blob/v1.8.0/detectors/gcp/gce.go\n */\n\nimport { diag } from '@opentelemetry/api';\nimport * as metadata from 'gcp-metadata';\n\nconst MACHINE_TYPE_METADATA_ATTR = 'machine-type';\nconst ID_METADATA_ATTR = 'id';\nconst HOST_NAME_METADATA_ATTR = 'name';\nconst ZONE_METADATA_ATTR = 'zone';\n\nexport async function onGce(): Promise<boolean> {\n try {\n await metadata.instance<string>(MACHINE_TYPE_METADATA_ATTR);\n return true;\n } catch (err) {\n diag.debug(\n 'Could not fetch metadata attribute %s, assuming not on GCE. Error was %s',\n MACHINE_TYPE_METADATA_ATTR,\n err\n );\n return false;\n }\n}\n\n/**\n * The machine type of the instance on which this program is running. Check that {@link\n * onGce()} is true before calling this, or it may throw exceptions.\n */\nexport async function hostType(): Promise<string> {\n return metadata.instance<string>(MACHINE_TYPE_METADATA_ATTR);\n}\n\n/**\n * The instance ID of the instance on which this program is running. Check that {@link onGce()}\n * is true before calling this, or it may throw exceptions.\n */\nexport async function hostId(): Promise<string> {\n // May be a bignumber.js BigNumber which can just be converted with toString(). See\n // https://github.com/googleapis/gcp-metadata#take-care-with-large-number-valued-properties\n const id = await metadata.instance<number | object>(ID_METADATA_ATTR);\n return id.toString();\n}\n\n/**\n * The instance ID of the instance on which this program is running. Check that {@link onGce()}\n * is true before calling this, or it may throw exceptions.\n */\nexport async function hostName(): Promise<string> {\n return metadata.instance<string>(HOST_NAME_METADATA_ATTR);\n}\n\n/**\n * The zone and region in which this program is running. Check that {@link onGce()} is true\n * before calling this, or it may throw exceptions.\n */\nexport async function availabilityZoneAndRegion(): Promise<{\n zone: string;\n region: string;\n}> {\n const fullZone = await metadata.instance<string>(ZONE_METADATA_ATTR);\n\n // Format described in\n // https://cloud.google.com/compute/docs/metadata/default-metadata-values#vm_instance_metadata\n const re = /projects\\/\\d+\\/zones\\/(?<zone>(?<region>\\w+-\\w+)-\\w+)/;\n const { zone, region } = fullZone.match(re)?.groups ?? {};\n if (!zone || !region) {\n throw new Error(\n `zone was not in the expected format: projects/PROJECT_NUM/zones/COUNTRY-REGION-ZONE. Got ${fullZone}`\n );\n }\n\n return { zone, region };\n}\n"]}
@@ -0,0 +1,20 @@
1
+ export declare function onGke(): Promise<boolean>;
2
+ /**
3
+ * The instance ID of the instance on which this program is running. Check that {@link onGke()}
4
+ * is true before calling this, or it may throw exceptions.
5
+ */
6
+ export declare function hostId(): Promise<string>;
7
+ /**
8
+ * The name of the GKE cluster in which this program is running. Check that {@link onGke()} is
9
+ * true before calling this, or it may throw exceptions.
10
+ */
11
+ export declare function clusterName(): Promise<string>;
12
+ /**
13
+ * The location of the cluster and whether the cluster is zonal or regional. Check that {@link
14
+ * onGke()} is true before calling this, or it may throw exceptions.
15
+ */
16
+ export declare function availabilityZoneOrRegion(): Promise<{
17
+ type: 'zone' | 'region';
18
+ value: string;
19
+ }>;
20
+ //# sourceMappingURL=gke.d.ts.map
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright 2022 Google LLC
4
+ * Copyright The OpenTelemetry Authors
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this file except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * https://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ */
18
+ Object.defineProperty(exports, "__esModule", { value: true });
19
+ exports.availabilityZoneOrRegion = exports.clusterName = exports.hostId = exports.onGke = void 0;
20
+ /**
21
+ * Implementation in this file copied from
22
+ * https://github.com/GoogleCloudPlatform/opentelemetry-operations-go/blob/v1.8.0/detectors/gcp/gke.go
23
+ */
24
+ const metadata = require("gcp-metadata");
25
+ const gce = require("./gce");
26
+ const KUBERNETES_SERVICE_HOST_ENV = 'KUBERNETES_SERVICE_HOST';
27
+ const CLUSTER_NAME_METADATA_ATTR = 'attributes/cluster-name';
28
+ const CLUSTER_LOCATION_METADATA_ATTR = 'attributes/cluster-location';
29
+ async function onGke() {
30
+ return process.env[KUBERNETES_SERVICE_HOST_ENV] !== undefined;
31
+ }
32
+ exports.onGke = onGke;
33
+ /**
34
+ * The instance ID of the instance on which this program is running. Check that {@link onGke()}
35
+ * is true before calling this, or it may throw exceptions.
36
+ */
37
+ async function hostId() {
38
+ return await gce.hostId();
39
+ }
40
+ exports.hostId = hostId;
41
+ /**
42
+ * The name of the GKE cluster in which this program is running. Check that {@link onGke()} is
43
+ * true before calling this, or it may throw exceptions.
44
+ */
45
+ async function clusterName() {
46
+ return metadata.instance(CLUSTER_NAME_METADATA_ATTR);
47
+ }
48
+ exports.clusterName = clusterName;
49
+ /**
50
+ * The location of the cluster and whether the cluster is zonal or regional. Check that {@link
51
+ * onGke()} is true before calling this, or it may throw exceptions.
52
+ */
53
+ async function availabilityZoneOrRegion() {
54
+ const clusterLocation = await metadata.instance(CLUSTER_LOCATION_METADATA_ATTR);
55
+ switch (countChar(clusterLocation, '-')) {
56
+ case 1:
57
+ return { type: 'region', value: clusterLocation };
58
+ case 2:
59
+ return { type: 'zone', value: clusterLocation };
60
+ default:
61
+ throw new Error(`unrecognized format for cluster location: ${clusterLocation}`);
62
+ }
63
+ }
64
+ exports.availabilityZoneOrRegion = availabilityZoneOrRegion;
65
+ function countChar(s, char) {
66
+ let count = 0;
67
+ for (let i = 0; i < s.length; i++) {
68
+ if (s[i] === char) {
69
+ count += 1;
70
+ }
71
+ }
72
+ return count;
73
+ }
74
+ //# sourceMappingURL=gke.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gke.js","sourceRoot":"","sources":["../../../src/detectors/gke.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;AAEH;;;GAGG;AAEH,yCAAyC;AACzC,6BAA6B;AAE7B,MAAM,2BAA2B,GAAG,yBAAyB,CAAC;AAC9D,MAAM,0BAA0B,GAAG,yBAAyB,CAAC;AAC7D,MAAM,8BAA8B,GAAG,6BAA6B,CAAC;AAE9D,KAAK,UAAU,KAAK;IACzB,OAAO,OAAO,CAAC,GAAG,CAAC,2BAA2B,CAAC,KAAK,SAAS,CAAC;AAChE,CAAC;AAFD,sBAEC;AAED;;;GAGG;AACI,KAAK,UAAU,MAAM;IAC1B,OAAO,MAAM,GAAG,CAAC,MAAM,EAAE,CAAC;AAC5B,CAAC;AAFD,wBAEC;AAED;;;GAGG;AACI,KAAK,UAAU,WAAW;IAC/B,OAAO,QAAQ,CAAC,QAAQ,CAAS,0BAA0B,CAAC,CAAC;AAC/D,CAAC;AAFD,kCAEC;AAED;;;GAGG;AACI,KAAK,UAAU,wBAAwB;IAI5C,MAAM,eAAe,GAAG,MAAM,QAAQ,CAAC,QAAQ,CAC7C,8BAA8B,CAC/B,CAAC;IACF,QAAQ,SAAS,CAAC,eAAe,EAAE,GAAG,CAAC,EAAE;QACvC,KAAK,CAAC;YACJ,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,eAAe,EAAE,CAAC;QACpD,KAAK,CAAC;YACJ,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,eAAe,EAAE,CAAC;QAClD;YACE,MAAM,IAAI,KAAK,CACb,6CAA6C,eAAe,EAAE,CAC/D,CAAC;KACL;AACH,CAAC;AAjBD,4DAiBC;AAED,SAAS,SAAS,CAAC,CAAS,EAAE,IAAY;IACxC,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACjC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE;YACjB,KAAK,IAAI,CAAC,CAAC;SACZ;KACF;IACD,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["/*\n * Copyright 2022 Google LLC\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 * Implementation in this file copied from\n * https://github.com/GoogleCloudPlatform/opentelemetry-operations-go/blob/v1.8.0/detectors/gcp/gke.go\n */\n\nimport * as metadata from 'gcp-metadata';\nimport * as gce from './gce';\n\nconst KUBERNETES_SERVICE_HOST_ENV = 'KUBERNETES_SERVICE_HOST';\nconst CLUSTER_NAME_METADATA_ATTR = 'attributes/cluster-name';\nconst CLUSTER_LOCATION_METADATA_ATTR = 'attributes/cluster-location';\n\nexport async function onGke(): Promise<boolean> {\n return process.env[KUBERNETES_SERVICE_HOST_ENV] !== undefined;\n}\n\n/**\n * The instance ID of the instance on which this program is running. Check that {@link onGke()}\n * is true before calling this, or it may throw exceptions.\n */\nexport async function hostId(): Promise<string> {\n return await gce.hostId();\n}\n\n/**\n * The name of the GKE cluster in which this program is running. Check that {@link onGke()} is\n * true before calling this, or it may throw exceptions.\n */\nexport async function clusterName(): Promise<string> {\n return metadata.instance<string>(CLUSTER_NAME_METADATA_ATTR);\n}\n\n/**\n * The location of the cluster and whether the cluster is zonal or regional. Check that {@link\n * onGke()} is true before calling this, or it may throw exceptions.\n */\nexport async function availabilityZoneOrRegion(): Promise<{\n type: 'zone' | 'region';\n value: string;\n}> {\n const clusterLocation = await metadata.instance<string>(\n CLUSTER_LOCATION_METADATA_ATTR\n );\n switch (countChar(clusterLocation, '-')) {\n case 1:\n return { type: 'region', value: clusterLocation };\n case 2:\n return { type: 'zone', value: clusterLocation };\n default:\n throw new Error(\n `unrecognized format for cluster location: ${clusterLocation}`\n );\n }\n}\n\nfunction countChar(s: string, char: string): number {\n let count = 0;\n for (let i = 0; i < s.length; i++) {\n if (s[i] === char) {\n count += 1;\n }\n }\n return count;\n}\n"]}
@@ -0,0 +1,180 @@
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
+ * The execution environment ID as a string, that will be potentially reused for other invocations to the same function/function version.
47
+ *
48
+ * @example 2021/06/28/[$LATEST]2f399eb14537447da05ab2a2e39309de
49
+ *
50
+ * @note - **AWS Lambda:** Use the (full) log stream name.
51
+ *
52
+ * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
53
+ */
54
+ export declare const ATTR_FAAS_INSTANCE: "faas.instance";
55
+ /**
56
+ * The name of the single function that this runtime instance executes.
57
+ *
58
+ * @example my-function
59
+ * @example myazurefunctionapp/some-function-name
60
+ *
61
+ * @note This is the name of the function as configured/deployed on the FaaS
62
+ * platform and is usually different from the name of the callback
63
+ * function (which may be stored in the
64
+ * [`code.namespace`/`code.function.name`](/docs/general/attributes.md#source-code-attributes)
65
+ * span attributes).
66
+ *
67
+ * For some cloud providers, the above definition is ambiguous. The following
68
+ * definition of function name **MUST** be used for this attribute
69
+ * (and consequently the span name) for the listed cloud providers/products:
70
+ *
71
+ * - **Azure:** The full name `<FUNCAPP>/<FUNC>`, i.e., function app name
72
+ * followed by a forward slash followed by the function name (this form
73
+ * can also be seen in the resource JSON for the function).
74
+ * This means that a span attribute **MUST** be used, as an Azure function
75
+ * app can host multiple functions that would usually share
76
+ * a TracerProvider (see also the `cloud.resource_id` attribute).
77
+ *
78
+ * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
79
+ */
80
+ export declare const ATTR_FAAS_NAME: "faas.name";
81
+ /**
82
+ * The immutable version of the function being executed.
83
+ *
84
+ * @example 26
85
+ * @example pinkfroid-00002
86
+ *
87
+ * @note Depending on the cloud provider and platform, use:
88
+ *
89
+ * - **AWS Lambda:** The [function version](https://docs.aws.amazon.com/lambda/latest/dg/configuration-versions.html)
90
+ * (an integer represented as a decimal string).
91
+ * - **Google Cloud Run (Services):** The [revision](https://cloud.google.com/run/docs/managing/revisions)
92
+ * (i.e., the function name plus the revision suffix).
93
+ * - **Google Cloud Functions:** The value of the
94
+ * [`K_REVISION` environment variable](https://cloud.google.com/functions/docs/env-var#runtime_environment_variables_set_automatically).
95
+ * - **Azure Functions:** Not applicable. Do not set this attribute.
96
+ *
97
+ * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
98
+ */
99
+ export declare const ATTR_FAAS_VERSION: "faas.version";
100
+ /**
101
+ * 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.
102
+ *
103
+ * @example fdbf79e8af94cb7f9e8df36789187052
104
+ *
105
+ * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
106
+ */
107
+ export declare const ATTR_HOST_ID: "host.id";
108
+ /**
109
+ * 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.
110
+ *
111
+ * @example opentelemetry-test
112
+ *
113
+ * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
114
+ */
115
+ export declare const ATTR_HOST_NAME: "host.name";
116
+ /**
117
+ * Type of host. For Cloud, this must be the machine type.
118
+ *
119
+ * @example n1-standard-1
120
+ *
121
+ * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
122
+ */
123
+ export declare const ATTR_HOST_TYPE: "host.type";
124
+ /**
125
+ * The name of the cluster.
126
+ *
127
+ * @example opentelemetry-cluster
128
+ *
129
+ * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
130
+ */
131
+ export declare const ATTR_K8S_CLUSTER_NAME: "k8s.cluster.name";
132
+ /**
133
+ * Enum value "gcp_app_engine" for attribute {@link ATTR_CLOUD_PLATFORM}.
134
+ *
135
+ * Google Cloud App Engine (GAE)
136
+ *
137
+ * @experimental This enum value is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
138
+ */
139
+ export declare const CLOUD_PLATFORM_VALUE_GCP_APP_ENGINE: "gcp_app_engine";
140
+ /**
141
+ * Enum value "gcp_cloud_functions" for attribute {@link ATTR_CLOUD_PLATFORM}.
142
+ *
143
+ * Google Cloud Functions (GCF)
144
+ *
145
+ * @experimental This enum value is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
146
+ */
147
+ export declare const CLOUD_PLATFORM_VALUE_GCP_CLOUD_FUNCTIONS: "gcp_cloud_functions";
148
+ /**
149
+ * Enum value "gcp_cloud_run" for attribute {@link ATTR_CLOUD_PLATFORM}.
150
+ *
151
+ * Google Cloud Run
152
+ *
153
+ * @experimental This enum value is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
154
+ */
155
+ export declare const CLOUD_PLATFORM_VALUE_GCP_CLOUD_RUN: "gcp_cloud_run";
156
+ /**
157
+ * Enum value "gcp_compute_engine" for attribute {@link ATTR_CLOUD_PLATFORM}.
158
+ *
159
+ * Google Cloud Compute Engine (GCE)
160
+ *
161
+ * @experimental This enum value is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
162
+ */
163
+ export declare const CLOUD_PLATFORM_VALUE_GCP_COMPUTE_ENGINE: "gcp_compute_engine";
164
+ /**
165
+ * Enum value "gcp_kubernetes_engine" for attribute {@link ATTR_CLOUD_PLATFORM}.
166
+ *
167
+ * Google Cloud Kubernetes Engine (GKE)
168
+ *
169
+ * @experimental This enum value is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
170
+ */
171
+ export declare const CLOUD_PLATFORM_VALUE_GCP_KUBERNETES_ENGINE: "gcp_kubernetes_engine";
172
+ /**
173
+ * Enum value "gcp" for attribute {@link ATTR_CLOUD_PROVIDER}.
174
+ *
175
+ * Google Cloud Platform
176
+ *
177
+ * @experimental This enum value is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
178
+ */
179
+ export declare const CLOUD_PROVIDER_VALUE_GCP: "gcp";
180
+ //# sourceMappingURL=semconv.d.ts.map
@@ -0,0 +1,203 @@
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_GCP = exports.CLOUD_PLATFORM_VALUE_GCP_KUBERNETES_ENGINE = exports.CLOUD_PLATFORM_VALUE_GCP_COMPUTE_ENGINE = exports.CLOUD_PLATFORM_VALUE_GCP_CLOUD_RUN = exports.CLOUD_PLATFORM_VALUE_GCP_CLOUD_FUNCTIONS = exports.CLOUD_PLATFORM_VALUE_GCP_APP_ENGINE = exports.ATTR_K8S_CLUSTER_NAME = exports.ATTR_HOST_TYPE = exports.ATTR_HOST_NAME = exports.ATTR_HOST_ID = exports.ATTR_FAAS_VERSION = exports.ATTR_FAAS_NAME = exports.ATTR_FAAS_INSTANCE = 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
+ * The execution environment ID as a string, that will be potentially reused for other invocations to the same function/function version.
70
+ *
71
+ * @example 2021/06/28/[$LATEST]2f399eb14537447da05ab2a2e39309de
72
+ *
73
+ * @note - **AWS Lambda:** Use the (full) log stream name.
74
+ *
75
+ * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
76
+ */
77
+ exports.ATTR_FAAS_INSTANCE = 'faas.instance';
78
+ /**
79
+ * The name of the single function that this runtime instance executes.
80
+ *
81
+ * @example my-function
82
+ * @example myazurefunctionapp/some-function-name
83
+ *
84
+ * @note This is the name of the function as configured/deployed on the FaaS
85
+ * platform and is usually different from the name of the callback
86
+ * function (which may be stored in the
87
+ * [`code.namespace`/`code.function.name`](/docs/general/attributes.md#source-code-attributes)
88
+ * span attributes).
89
+ *
90
+ * For some cloud providers, the above definition is ambiguous. The following
91
+ * definition of function name **MUST** be used for this attribute
92
+ * (and consequently the span name) for the listed cloud providers/products:
93
+ *
94
+ * - **Azure:** The full name `<FUNCAPP>/<FUNC>`, i.e., function app name
95
+ * followed by a forward slash followed by the function name (this form
96
+ * can also be seen in the resource JSON for the function).
97
+ * This means that a span attribute **MUST** be used, as an Azure function
98
+ * app can host multiple functions that would usually share
99
+ * a TracerProvider (see also the `cloud.resource_id` attribute).
100
+ *
101
+ * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
102
+ */
103
+ exports.ATTR_FAAS_NAME = 'faas.name';
104
+ /**
105
+ * The immutable version of the function being executed.
106
+ *
107
+ * @example 26
108
+ * @example pinkfroid-00002
109
+ *
110
+ * @note Depending on the cloud provider and platform, use:
111
+ *
112
+ * - **AWS Lambda:** The [function version](https://docs.aws.amazon.com/lambda/latest/dg/configuration-versions.html)
113
+ * (an integer represented as a decimal string).
114
+ * - **Google Cloud Run (Services):** The [revision](https://cloud.google.com/run/docs/managing/revisions)
115
+ * (i.e., the function name plus the revision suffix).
116
+ * - **Google Cloud Functions:** The value of the
117
+ * [`K_REVISION` environment variable](https://cloud.google.com/functions/docs/env-var#runtime_environment_variables_set_automatically).
118
+ * - **Azure Functions:** Not applicable. Do not set this attribute.
119
+ *
120
+ * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
121
+ */
122
+ exports.ATTR_FAAS_VERSION = 'faas.version';
123
+ /**
124
+ * 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.
125
+ *
126
+ * @example fdbf79e8af94cb7f9e8df36789187052
127
+ *
128
+ * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
129
+ */
130
+ exports.ATTR_HOST_ID = 'host.id';
131
+ /**
132
+ * 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.
133
+ *
134
+ * @example opentelemetry-test
135
+ *
136
+ * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
137
+ */
138
+ exports.ATTR_HOST_NAME = 'host.name';
139
+ /**
140
+ * Type of host. For Cloud, this must be the machine type.
141
+ *
142
+ * @example n1-standard-1
143
+ *
144
+ * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
145
+ */
146
+ exports.ATTR_HOST_TYPE = 'host.type';
147
+ /**
148
+ * The name of the cluster.
149
+ *
150
+ * @example opentelemetry-cluster
151
+ *
152
+ * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
153
+ */
154
+ exports.ATTR_K8S_CLUSTER_NAME = 'k8s.cluster.name';
155
+ /**
156
+ * Enum value "gcp_app_engine" for attribute {@link ATTR_CLOUD_PLATFORM}.
157
+ *
158
+ * Google Cloud App Engine (GAE)
159
+ *
160
+ * @experimental This enum value is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
161
+ */
162
+ exports.CLOUD_PLATFORM_VALUE_GCP_APP_ENGINE = 'gcp_app_engine';
163
+ /**
164
+ * Enum value "gcp_cloud_functions" for attribute {@link ATTR_CLOUD_PLATFORM}.
165
+ *
166
+ * Google Cloud Functions (GCF)
167
+ *
168
+ * @experimental This enum value is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
169
+ */
170
+ exports.CLOUD_PLATFORM_VALUE_GCP_CLOUD_FUNCTIONS = 'gcp_cloud_functions';
171
+ /**
172
+ * Enum value "gcp_cloud_run" for attribute {@link ATTR_CLOUD_PLATFORM}.
173
+ *
174
+ * Google Cloud Run
175
+ *
176
+ * @experimental This enum value is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
177
+ */
178
+ exports.CLOUD_PLATFORM_VALUE_GCP_CLOUD_RUN = 'gcp_cloud_run';
179
+ /**
180
+ * Enum value "gcp_compute_engine" for attribute {@link ATTR_CLOUD_PLATFORM}.
181
+ *
182
+ * Google Cloud Compute Engine (GCE)
183
+ *
184
+ * @experimental This enum value is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
185
+ */
186
+ exports.CLOUD_PLATFORM_VALUE_GCP_COMPUTE_ENGINE = 'gcp_compute_engine';
187
+ /**
188
+ * Enum value "gcp_kubernetes_engine" for attribute {@link ATTR_CLOUD_PLATFORM}.
189
+ *
190
+ * Google Cloud Kubernetes Engine (GKE)
191
+ *
192
+ * @experimental This enum value is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
193
+ */
194
+ exports.CLOUD_PLATFORM_VALUE_GCP_KUBERNETES_ENGINE = 'gcp_kubernetes_engine';
195
+ /**
196
+ * Enum value "gcp" for attribute {@link ATTR_CLOUD_PROVIDER}.
197
+ *
198
+ * Google Cloud Platform
199
+ *
200
+ * @experimental This enum value is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
201
+ */
202
+ exports.CLOUD_PROVIDER_VALUE_GCP = 'gcp';
203
+ //# 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;;;;;;;;GAQG;AACU,QAAA,kBAAkB,GAAG,eAAwB,CAAC;AAE3D;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACU,QAAA,cAAc,GAAG,WAAoB,CAAC;AAEnD;;;;;;;;;;;;;;;;;GAiBG;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,qBAAqB,GAAG,kBAA2B,CAAC;AAEjE;;;;;;GAMG;AACU,QAAA,mCAAmC,GAAG,gBAAyB,CAAC;AAE7E;;;;;;GAMG;AACU,QAAA,wCAAwC,GACnD,qBAA8B,CAAC;AAEjC;;;;;;GAMG;AACU,QAAA,kCAAkC,GAAG,eAAwB,CAAC;AAE3E;;;;;;GAMG;AACU,QAAA,uCAAuC,GAClD,oBAA6B,CAAC;AAEhC;;;;;;GAMG;AACU,QAAA,0CAA0C,GACrD,uBAAgC,CAAC;AAEnC;;;;;;GAMG;AACU,QAAA,wBAAwB,GAAG,KAAc,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 * The execution environment ID as a string, that will be potentially reused for other invocations to the same function/function version.\n *\n * @example 2021/06/28/[$LATEST]2f399eb14537447da05ab2a2e39309de\n *\n * @note - **AWS Lambda:** Use the (full) log stream name.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_FAAS_INSTANCE = 'faas.instance' as const;\n\n/**\n * The name of the single function that this runtime instance executes.\n *\n * @example my-function\n * @example myazurefunctionapp/some-function-name\n *\n * @note This is the name of the function as configured/deployed on the FaaS\n * platform and is usually different from the name of the callback\n * function (which may be stored in the\n * [`code.namespace`/`code.function.name`](/docs/general/attributes.md#source-code-attributes)\n * span attributes).\n *\n * For some cloud providers, the above definition is ambiguous. The following\n * definition of function name **MUST** be used for this attribute\n * (and consequently the span name) for the listed cloud providers/products:\n *\n * - **Azure:** The full name `<FUNCAPP>/<FUNC>`, i.e., function app name\n * followed by a forward slash followed by the function name (this form\n * can also be seen in the resource JSON for the function).\n * This means that a span attribute **MUST** be used, as an Azure function\n * app can host multiple functions that would usually share\n * a TracerProvider (see also the `cloud.resource_id` attribute).\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_FAAS_NAME = 'faas.name' as const;\n\n/**\n * The immutable version of the function being executed.\n *\n * @example 26\n * @example pinkfroid-00002\n *\n * @note Depending on the cloud provider and platform, use:\n *\n * - **AWS Lambda:** The [function version](https://docs.aws.amazon.com/lambda/latest/dg/configuration-versions.html)\n * (an integer represented as a decimal string).\n * - **Google Cloud Run (Services):** The [revision](https://cloud.google.com/run/docs/managing/revisions)\n * (i.e., the function name plus the revision suffix).\n * - **Google Cloud Functions:** The value of the\n * [`K_REVISION` environment variable](https://cloud.google.com/functions/docs/env-var#runtime_environment_variables_set_automatically).\n * - **Azure Functions:** Not applicable. Do not set this attribute.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_FAAS_VERSION = 'faas.version' 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 * The name of the cluster.\n *\n * @example opentelemetry-cluster\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_K8S_CLUSTER_NAME = 'k8s.cluster.name' as const;\n\n/**\n * Enum value \"gcp_app_engine\" for attribute {@link ATTR_CLOUD_PLATFORM}.\n *\n * Google Cloud App Engine (GAE)\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_GCP_APP_ENGINE = 'gcp_app_engine' as const;\n\n/**\n * Enum value \"gcp_cloud_functions\" for attribute {@link ATTR_CLOUD_PLATFORM}.\n *\n * Google Cloud Functions (GCF)\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_GCP_CLOUD_FUNCTIONS =\n 'gcp_cloud_functions' as const;\n\n/**\n * Enum value \"gcp_cloud_run\" for attribute {@link ATTR_CLOUD_PLATFORM}.\n *\n * Google Cloud Run\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_GCP_CLOUD_RUN = 'gcp_cloud_run' as const;\n\n/**\n * Enum value \"gcp_compute_engine\" for attribute {@link ATTR_CLOUD_PLATFORM}.\n *\n * Google Cloud Compute Engine (GCE)\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_GCP_COMPUTE_ENGINE =\n 'gcp_compute_engine' as const;\n\n/**\n * Enum value \"gcp_kubernetes_engine\" for attribute {@link ATTR_CLOUD_PLATFORM}.\n *\n * Google Cloud Kubernetes Engine (GKE)\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_GCP_KUBERNETES_ENGINE =\n 'gcp_kubernetes_engine' as const;\n\n/**\n * Enum value \"gcp\" for attribute {@link ATTR_CLOUD_PROVIDER}.\n *\n * Google Cloud Platform\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_GCP = 'gcp' as const;\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opentelemetry/resource-detector-gcp",
3
- "version": "0.39.0",
3
+ "version": "0.40.2",
4
4
  "description": "OpenTelemetry SDK resource detector for GCP",
5
5
  "main": "build/src/index.js",
6
6
  "module": "build/esm/index.js",
@@ -46,15 +46,16 @@
46
46
  },
47
47
  "devDependencies": {
48
48
  "@opentelemetry/api": "^1.0.0",
49
- "@opentelemetry/contrib-test-utils": "^0.51.0",
49
+ "@opentelemetry/contrib-test-utils": "^0.52.1",
50
50
  "@opentelemetry/instrumentation-http": "^0.205.0",
51
51
  "@opentelemetry/sdk-trace-base": "^2.0.0",
52
52
  "@types/mocha": "10.0.10",
53
53
  "@types/node": "18.18.14",
54
54
  "@types/semver": "7.5.8",
55
- "nock": "13.3.3",
55
+ "@types/sinon": "17.0.4",
56
+ "bignumber.js": "9.3.1",
56
57
  "nyc": "17.1.0",
57
- "rimraf": "5.0.10",
58
+ "sinon": "15.2.0",
58
59
  "typescript": "5.0.4"
59
60
  },
60
61
  "peerDependencies": {
@@ -63,10 +64,9 @@
63
64
  "dependencies": {
64
65
  "@opentelemetry/core": "^2.0.0",
65
66
  "@opentelemetry/resources": "^2.0.0",
66
- "@opentelemetry/semantic-conventions": "^1.27.0",
67
67
  "gcp-metadata": "^6.0.0"
68
68
  },
69
69
  "homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/packages/resource-detector-gcp#readme",
70
70
  "sideEffects": false,
71
- "gitHead": "f54a1ba1adf19fd2cbf9ddbdb32a3baca2ed328e"
71
+ "gitHead": "931c7b34f53ea625da900726b1f57c5c934b5b28"
72
72
  }