@opencensus/resource-util
Advanced tools
Comparing version 0.0.19 to 0.0.20
@@ -113,7 +113,6 @@ "use strict"; | ||
if (Object.keys(gkeResourceLabels).length === 0) { | ||
const [projectId, zoneId, clusterName, hostname] = yield Promise.all([ | ||
const [projectId, zoneId, clusterName] = yield Promise.all([ | ||
getProjectId(), | ||
getZone(), | ||
getClusterName(), | ||
getHostname(), | ||
]); | ||
@@ -125,3 +124,4 @@ gkeResourceLabels[constants_1.CLOUD_RESOURCE.ACCOUNT_ID_KEY] = projectId; | ||
process.env.NAMESPACE || ''; | ||
gkeResourceLabels[constants_1.K8S_RESOURCE.POD_NAME_KEY] = hostname; | ||
gkeResourceLabels[constants_1.K8S_RESOURCE.POD_NAME_KEY] = | ||
process.env.HOSTNAME || os.hostname(); | ||
gkeResourceLabels[constants_1.CONTAINER_RESOURCE.NAME_KEY] = | ||
@@ -230,13 +230,2 @@ process.env.CONTAINER_NAME || ''; | ||
} | ||
/** Gets hostname from GCP instance metadata. */ | ||
function getHostname() { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
try { | ||
return yield gcpMetadata.instance('hostname'); | ||
} | ||
catch (ignore) { | ||
return os.hostname(); | ||
} | ||
}); | ||
} | ||
function clear() { | ||
@@ -243,0 +232,0 @@ resourceType = undefined; |
{ | ||
"name": "@opencensus/resource-util", | ||
"version": "0.0.19", | ||
"version": "0.0.20", | ||
"description": "The OpenCensus Monitored Resource Util for Node.js is a collection of utilities for auto detecting monitored resource when exporting stats, based on the environment where the application is running.", | ||
@@ -55,3 +55,3 @@ "main": "build/src/index.js", | ||
"@types/node": "^9.4.7", | ||
"codecov": "^3.5.0", | ||
"codecov": "^3.6.2", | ||
"gts": "^1.0.0", | ||
@@ -66,5 +66,5 @@ "mocha": "^6.1.0", | ||
"dependencies": { | ||
"@opencensus/core": "^0.0.19", | ||
"@opencensus/core": "^0.0.20", | ||
"gcp-metadata": "^3.0.0" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
37880
593
5
+ Added@opencensus/core@0.0.20(transitive)
- Removed@opencensus/core@0.0.19(transitive)
Updated@opencensus/core@^0.0.20