@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.
- package/README.md +1 -1
- package/build/esm/detectors/GcpDetector.d.ts +6 -21
- package/build/esm/detectors/GcpDetector.js +150 -99
- package/build/esm/detectors/GcpDetector.js.map +1 -1
- package/build/esm/detectors/faas.d.ts +25 -0
- package/build/esm/detectors/faas.js +75 -0
- package/build/esm/detectors/faas.js.map +1 -0
- package/build/esm/detectors/gae.d.ts +36 -0
- package/build/esm/detectors/gae.js +87 -0
- package/build/esm/detectors/gae.js.map +1 -0
- package/build/esm/detectors/gce.d.ts +25 -0
- package/build/esm/detectors/gce.js +76 -0
- package/build/esm/detectors/gce.js.map +1 -0
- package/build/esm/detectors/gke.d.ts +20 -0
- package/build/esm/detectors/gke.js +67 -0
- package/build/esm/detectors/gke.js.map +1 -0
- package/build/esm/semconv.d.ts +180 -0
- package/build/esm/semconv.js +200 -0
- package/build/esm/semconv.js.map +1 -0
- package/build/src/detectors/GcpDetector.d.ts +6 -21
- package/build/src/detectors/GcpDetector.js +152 -100
- package/build/src/detectors/GcpDetector.js.map +1 -1
- package/build/src/detectors/faas.d.ts +25 -0
- package/build/src/detectors/faas.js +84 -0
- package/build/src/detectors/faas.js.map +1 -0
- package/build/src/detectors/gae.d.ts +36 -0
- package/build/src/detectors/gae.js +98 -0
- package/build/src/detectors/gae.js.map +1 -0
- package/build/src/detectors/gce.d.ts +25 -0
- package/build/src/detectors/gce.js +84 -0
- package/build/src/detectors/gce.js.map +1 -0
- package/build/src/detectors/gke.d.ts +20 -0
- package/build/src/detectors/gke.js +74 -0
- package/build/src/detectors/gke.js.map +1 -0
- package/build/src/semconv.d.ts +180 -0
- package/build/src/semconv.js +203 -0
- package/build/src/semconv.js.map +1 -0
- package/package.json +6 -6
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2022 Google LLC
|
|
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
|
+
/**
|
|
18
|
+
* Implementation in this file copied from
|
|
19
|
+
* https://github.com/GoogleCloudPlatform/opentelemetry-operations-go/blob/v1.8.0/detectors/gcp/gce.go
|
|
20
|
+
*/
|
|
21
|
+
import { diag } from '@opentelemetry/api';
|
|
22
|
+
import * as metadata from 'gcp-metadata';
|
|
23
|
+
const MACHINE_TYPE_METADATA_ATTR = 'machine-type';
|
|
24
|
+
const ID_METADATA_ATTR = 'id';
|
|
25
|
+
const HOST_NAME_METADATA_ATTR = 'name';
|
|
26
|
+
const ZONE_METADATA_ATTR = 'zone';
|
|
27
|
+
export async function onGce() {
|
|
28
|
+
try {
|
|
29
|
+
await metadata.instance(MACHINE_TYPE_METADATA_ATTR);
|
|
30
|
+
return true;
|
|
31
|
+
}
|
|
32
|
+
catch (err) {
|
|
33
|
+
diag.debug('Could not fetch metadata attribute %s, assuming not on GCE. Error was %s', MACHINE_TYPE_METADATA_ATTR, err);
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* The machine type of the instance on which this program is running. Check that {@link
|
|
39
|
+
* onGce()} is true before calling this, or it may throw exceptions.
|
|
40
|
+
*/
|
|
41
|
+
export async function hostType() {
|
|
42
|
+
return metadata.instance(MACHINE_TYPE_METADATA_ATTR);
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* The instance ID of the instance on which this program is running. Check that {@link onGce()}
|
|
46
|
+
* is true before calling this, or it may throw exceptions.
|
|
47
|
+
*/
|
|
48
|
+
export async function hostId() {
|
|
49
|
+
// May be a bignumber.js BigNumber which can just be converted with toString(). See
|
|
50
|
+
// https://github.com/googleapis/gcp-metadata#take-care-with-large-number-valued-properties
|
|
51
|
+
const id = await metadata.instance(ID_METADATA_ATTR);
|
|
52
|
+
return id.toString();
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* The instance ID of the instance on which this program is running. Check that {@link onGce()}
|
|
56
|
+
* is true before calling this, or it may throw exceptions.
|
|
57
|
+
*/
|
|
58
|
+
export async function hostName() {
|
|
59
|
+
return metadata.instance(HOST_NAME_METADATA_ATTR);
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* The zone and region in which this program is running. Check that {@link onGce()} is true
|
|
63
|
+
* before calling this, or it may throw exceptions.
|
|
64
|
+
*/
|
|
65
|
+
export async function availabilityZoneAndRegion() {
|
|
66
|
+
const fullZone = await metadata.instance(ZONE_METADATA_ATTR);
|
|
67
|
+
// Format described in
|
|
68
|
+
// https://cloud.google.com/compute/docs/metadata/default-metadata-values#vm_instance_metadata
|
|
69
|
+
const re = /projects\/\d+\/zones\/(?<zone>(?<region>\w+-\w+)-\w+)/;
|
|
70
|
+
const { zone, region } = fullZone.match(re)?.groups ?? {};
|
|
71
|
+
if (!zone || !region) {
|
|
72
|
+
throw new Error(`zone was not in the expected format: projects/PROJECT_NUM/zones/COUNTRY-REGION-ZONE. Got ${fullZone}`);
|
|
73
|
+
}
|
|
74
|
+
return { zone, region };
|
|
75
|
+
}
|
|
76
|
+
//# 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,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,KAAK,QAAQ,MAAM,cAAc,CAAC;AAEzC,MAAM,0BAA0B,GAAG,cAAc,CAAC;AAClD,MAAM,gBAAgB,GAAG,IAAI,CAAC;AAC9B,MAAM,uBAAuB,GAAG,MAAM,CAAC;AACvC,MAAM,kBAAkB,GAAG,MAAM,CAAC;AAElC,MAAM,CAAC,KAAK,UAAU,KAAK;IACzB,IAAI;QACF,MAAM,QAAQ,CAAC,QAAQ,CAAS,0BAA0B,CAAC,CAAC;QAC5D,OAAO,IAAI,CAAC;KACb;IAAC,OAAO,GAAG,EAAE;QACZ,IAAI,CAAC,KAAK,CACR,0EAA0E,EAC1E,0BAA0B,EAC1B,GAAG,CACJ,CAAC;QACF,OAAO,KAAK,CAAC;KACd;AACH,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,QAAQ;IAC5B,OAAO,QAAQ,CAAC,QAAQ,CAAS,0BAA0B,CAAC,CAAC;AAC/D,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,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;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,QAAQ;IAC5B,OAAO,QAAQ,CAAC,QAAQ,CAAS,uBAAuB,CAAC,CAAC;AAC5D,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,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","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,67 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2022 Google LLC
|
|
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
|
+
/**
|
|
18
|
+
* Implementation in this file copied from
|
|
19
|
+
* https://github.com/GoogleCloudPlatform/opentelemetry-operations-go/blob/v1.8.0/detectors/gcp/gke.go
|
|
20
|
+
*/
|
|
21
|
+
import * as metadata from 'gcp-metadata';
|
|
22
|
+
import * as gce from './gce';
|
|
23
|
+
const KUBERNETES_SERVICE_HOST_ENV = 'KUBERNETES_SERVICE_HOST';
|
|
24
|
+
const CLUSTER_NAME_METADATA_ATTR = 'attributes/cluster-name';
|
|
25
|
+
const CLUSTER_LOCATION_METADATA_ATTR = 'attributes/cluster-location';
|
|
26
|
+
export async function onGke() {
|
|
27
|
+
return process.env[KUBERNETES_SERVICE_HOST_ENV] !== undefined;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* The instance ID of the instance on which this program is running. Check that {@link onGke()}
|
|
31
|
+
* is true before calling this, or it may throw exceptions.
|
|
32
|
+
*/
|
|
33
|
+
export async function hostId() {
|
|
34
|
+
return await gce.hostId();
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* The name of the GKE cluster in which this program is running. Check that {@link onGke()} is
|
|
38
|
+
* true before calling this, or it may throw exceptions.
|
|
39
|
+
*/
|
|
40
|
+
export async function clusterName() {
|
|
41
|
+
return metadata.instance(CLUSTER_NAME_METADATA_ATTR);
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* The location of the cluster and whether the cluster is zonal or regional. Check that {@link
|
|
45
|
+
* onGke()} is true before calling this, or it may throw exceptions.
|
|
46
|
+
*/
|
|
47
|
+
export async function availabilityZoneOrRegion() {
|
|
48
|
+
const clusterLocation = await metadata.instance(CLUSTER_LOCATION_METADATA_ATTR);
|
|
49
|
+
switch (countChar(clusterLocation, '-')) {
|
|
50
|
+
case 1:
|
|
51
|
+
return { type: 'region', value: clusterLocation };
|
|
52
|
+
case 2:
|
|
53
|
+
return { type: 'zone', value: clusterLocation };
|
|
54
|
+
default:
|
|
55
|
+
throw new Error(`unrecognized format for cluster location: ${clusterLocation}`);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
function countChar(s, char) {
|
|
59
|
+
let count = 0;
|
|
60
|
+
for (let i = 0; i < s.length; i++) {
|
|
61
|
+
if (s[i] === char) {
|
|
62
|
+
count += 1;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return count;
|
|
66
|
+
}
|
|
67
|
+
//# 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,OAAO,KAAK,QAAQ,MAAM,cAAc,CAAC;AACzC,OAAO,KAAK,GAAG,MAAM,OAAO,CAAC;AAE7B,MAAM,2BAA2B,GAAG,yBAAyB,CAAC;AAC9D,MAAM,0BAA0B,GAAG,yBAAyB,CAAC;AAC7D,MAAM,8BAA8B,GAAG,6BAA6B,CAAC;AAErE,MAAM,CAAC,KAAK,UAAU,KAAK;IACzB,OAAO,OAAO,CAAC,GAAG,CAAC,2BAA2B,CAAC,KAAK,SAAS,CAAC;AAChE,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,MAAM;IAC1B,OAAO,MAAM,GAAG,CAAC,MAAM,EAAE,CAAC;AAC5B,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW;IAC/B,OAAO,QAAQ,CAAC,QAAQ,CAAS,0BAA0B,CAAC,CAAC;AAC/D,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,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;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,200 @@
|
|
|
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
|
+
* The execution environment ID as a string, that will be potentially reused for other invocations to the same function/function version.
|
|
67
|
+
*
|
|
68
|
+
* @example 2021/06/28/[$LATEST]2f399eb14537447da05ab2a2e39309de
|
|
69
|
+
*
|
|
70
|
+
* @note - **AWS Lambda:** Use the (full) log stream name.
|
|
71
|
+
*
|
|
72
|
+
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
|
|
73
|
+
*/
|
|
74
|
+
export const ATTR_FAAS_INSTANCE = 'faas.instance';
|
|
75
|
+
/**
|
|
76
|
+
* The name of the single function that this runtime instance executes.
|
|
77
|
+
*
|
|
78
|
+
* @example my-function
|
|
79
|
+
* @example myazurefunctionapp/some-function-name
|
|
80
|
+
*
|
|
81
|
+
* @note This is the name of the function as configured/deployed on the FaaS
|
|
82
|
+
* platform and is usually different from the name of the callback
|
|
83
|
+
* function (which may be stored in the
|
|
84
|
+
* [`code.namespace`/`code.function.name`](/docs/general/attributes.md#source-code-attributes)
|
|
85
|
+
* span attributes).
|
|
86
|
+
*
|
|
87
|
+
* For some cloud providers, the above definition is ambiguous. The following
|
|
88
|
+
* definition of function name **MUST** be used for this attribute
|
|
89
|
+
* (and consequently the span name) for the listed cloud providers/products:
|
|
90
|
+
*
|
|
91
|
+
* - **Azure:** The full name `<FUNCAPP>/<FUNC>`, i.e., function app name
|
|
92
|
+
* followed by a forward slash followed by the function name (this form
|
|
93
|
+
* can also be seen in the resource JSON for the function).
|
|
94
|
+
* This means that a span attribute **MUST** be used, as an Azure function
|
|
95
|
+
* app can host multiple functions that would usually share
|
|
96
|
+
* a TracerProvider (see also the `cloud.resource_id` attribute).
|
|
97
|
+
*
|
|
98
|
+
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
|
|
99
|
+
*/
|
|
100
|
+
export const ATTR_FAAS_NAME = 'faas.name';
|
|
101
|
+
/**
|
|
102
|
+
* The immutable version of the function being executed.
|
|
103
|
+
*
|
|
104
|
+
* @example 26
|
|
105
|
+
* @example pinkfroid-00002
|
|
106
|
+
*
|
|
107
|
+
* @note Depending on the cloud provider and platform, use:
|
|
108
|
+
*
|
|
109
|
+
* - **AWS Lambda:** The [function version](https://docs.aws.amazon.com/lambda/latest/dg/configuration-versions.html)
|
|
110
|
+
* (an integer represented as a decimal string).
|
|
111
|
+
* - **Google Cloud Run (Services):** The [revision](https://cloud.google.com/run/docs/managing/revisions)
|
|
112
|
+
* (i.e., the function name plus the revision suffix).
|
|
113
|
+
* - **Google Cloud Functions:** The value of the
|
|
114
|
+
* [`K_REVISION` environment variable](https://cloud.google.com/functions/docs/env-var#runtime_environment_variables_set_automatically).
|
|
115
|
+
* - **Azure Functions:** Not applicable. Do not set this attribute.
|
|
116
|
+
*
|
|
117
|
+
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
|
|
118
|
+
*/
|
|
119
|
+
export const ATTR_FAAS_VERSION = 'faas.version';
|
|
120
|
+
/**
|
|
121
|
+
* 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.
|
|
122
|
+
*
|
|
123
|
+
* @example fdbf79e8af94cb7f9e8df36789187052
|
|
124
|
+
*
|
|
125
|
+
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
|
|
126
|
+
*/
|
|
127
|
+
export const ATTR_HOST_ID = 'host.id';
|
|
128
|
+
/**
|
|
129
|
+
* 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.
|
|
130
|
+
*
|
|
131
|
+
* @example opentelemetry-test
|
|
132
|
+
*
|
|
133
|
+
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
|
|
134
|
+
*/
|
|
135
|
+
export const ATTR_HOST_NAME = 'host.name';
|
|
136
|
+
/**
|
|
137
|
+
* Type of host. For Cloud, this must be the machine type.
|
|
138
|
+
*
|
|
139
|
+
* @example n1-standard-1
|
|
140
|
+
*
|
|
141
|
+
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
|
|
142
|
+
*/
|
|
143
|
+
export const ATTR_HOST_TYPE = 'host.type';
|
|
144
|
+
/**
|
|
145
|
+
* The name of the cluster.
|
|
146
|
+
*
|
|
147
|
+
* @example opentelemetry-cluster
|
|
148
|
+
*
|
|
149
|
+
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
|
|
150
|
+
*/
|
|
151
|
+
export const ATTR_K8S_CLUSTER_NAME = 'k8s.cluster.name';
|
|
152
|
+
/**
|
|
153
|
+
* Enum value "gcp_app_engine" for attribute {@link ATTR_CLOUD_PLATFORM}.
|
|
154
|
+
*
|
|
155
|
+
* Google Cloud App Engine (GAE)
|
|
156
|
+
*
|
|
157
|
+
* @experimental This enum value is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
|
|
158
|
+
*/
|
|
159
|
+
export const CLOUD_PLATFORM_VALUE_GCP_APP_ENGINE = 'gcp_app_engine';
|
|
160
|
+
/**
|
|
161
|
+
* Enum value "gcp_cloud_functions" for attribute {@link ATTR_CLOUD_PLATFORM}.
|
|
162
|
+
*
|
|
163
|
+
* Google Cloud Functions (GCF)
|
|
164
|
+
*
|
|
165
|
+
* @experimental This enum value is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
|
|
166
|
+
*/
|
|
167
|
+
export const CLOUD_PLATFORM_VALUE_GCP_CLOUD_FUNCTIONS = 'gcp_cloud_functions';
|
|
168
|
+
/**
|
|
169
|
+
* Enum value "gcp_cloud_run" for attribute {@link ATTR_CLOUD_PLATFORM}.
|
|
170
|
+
*
|
|
171
|
+
* Google Cloud Run
|
|
172
|
+
*
|
|
173
|
+
* @experimental This enum value is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
|
|
174
|
+
*/
|
|
175
|
+
export const CLOUD_PLATFORM_VALUE_GCP_CLOUD_RUN = 'gcp_cloud_run';
|
|
176
|
+
/**
|
|
177
|
+
* Enum value "gcp_compute_engine" for attribute {@link ATTR_CLOUD_PLATFORM}.
|
|
178
|
+
*
|
|
179
|
+
* Google Cloud Compute Engine (GCE)
|
|
180
|
+
*
|
|
181
|
+
* @experimental This enum value is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
|
|
182
|
+
*/
|
|
183
|
+
export const CLOUD_PLATFORM_VALUE_GCP_COMPUTE_ENGINE = 'gcp_compute_engine';
|
|
184
|
+
/**
|
|
185
|
+
* Enum value "gcp_kubernetes_engine" for attribute {@link ATTR_CLOUD_PLATFORM}.
|
|
186
|
+
*
|
|
187
|
+
* Google Cloud Kubernetes Engine (GKE)
|
|
188
|
+
*
|
|
189
|
+
* @experimental This enum value is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
|
|
190
|
+
*/
|
|
191
|
+
export const CLOUD_PLATFORM_VALUE_GCP_KUBERNETES_ENGINE = 'gcp_kubernetes_engine';
|
|
192
|
+
/**
|
|
193
|
+
* Enum value "gcp" for attribute {@link ATTR_CLOUD_PROVIDER}.
|
|
194
|
+
*
|
|
195
|
+
* Google Cloud Platform
|
|
196
|
+
*
|
|
197
|
+
* @experimental This enum value is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
|
|
198
|
+
*/
|
|
199
|
+
export const CLOUD_PROVIDER_VALUE_GCP = 'gcp';
|
|
200
|
+
//# 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;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,eAAwB,CAAC;AAE3D;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,WAAoB,CAAC;AAEnD;;;;;;;;;;;;;;;;;GAiBG;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,qBAAqB,GAAG,kBAA2B,CAAC;AAEjE;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,mCAAmC,GAAG,gBAAyB,CAAC;AAE7E;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,wCAAwC,GACnD,qBAA8B,CAAC;AAEjC;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,kCAAkC,GAAG,eAAwB,CAAC;AAE3E;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,uCAAuC,GAClD,oBAA6B,CAAC;AAEhC;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,0CAA0C,GACrD,uBAAgC,CAAC;AAEnC;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,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"]}
|
|
@@ -1,26 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DetectedResource, ResourceDetector } from '@opentelemetry/resources';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* the instance. Returns an empty Resource if detection fails.
|
|
3
|
+
* Google Cloud resource detector which populates attributes based on the environment this
|
|
4
|
+
* process is running in. If not on GCP, returns an empty resource.
|
|
6
5
|
*/
|
|
7
|
-
declare class GcpDetector implements ResourceDetector {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
* Asynchronously gather GCP cloud metadata.
|
|
11
|
-
*/
|
|
12
|
-
private _getAttributes;
|
|
13
|
-
/** Gets project id from GCP project metadata. */
|
|
14
|
-
private _getProjectId;
|
|
15
|
-
/** Gets instance id from GCP instance metadata. */
|
|
16
|
-
private _getInstanceId;
|
|
17
|
-
/** Gets zone from GCP instance metadata. */
|
|
18
|
-
private _getZone;
|
|
19
|
-
/** Gets cluster name from GCP instance metadata. */
|
|
20
|
-
private _getClusterName;
|
|
21
|
-
/** Gets hostname from GCP instance metadata. */
|
|
22
|
-
private _getHostname;
|
|
6
|
+
export declare class GcpDetector implements ResourceDetector {
|
|
7
|
+
private _asyncAttributes;
|
|
8
|
+
detect(): DetectedResource;
|
|
23
9
|
}
|
|
24
10
|
export declare const gcpDetector: GcpDetector;
|
|
25
|
-
export {};
|
|
26
11
|
//# sourceMappingURL=GcpDetector.d.ts.map
|