@opentelemetry/resource-detector-aws
Advanced tools
Comparing version 1.2.5 to 1.3.0
@@ -92,2 +92,5 @@ "use strict"; | ||
const cluster = taskMetadata['Cluster']; | ||
const accountId = AwsEcsDetector._getAccountFromArn(taskArn); | ||
const region = AwsEcsDetector._getRegionFromArn(taskArn); | ||
const availabilityZone = taskMetadata === null || taskMetadata === void 0 ? void 0 : taskMetadata['AvailabilityZone']; | ||
const clusterArn = cluster.startsWith('arn:') | ||
@@ -97,4 +100,4 @@ ? cluster | ||
const containerArn = containerMetadata['ContainerARN']; | ||
// https://github.com/open-telemetry/opentelemetry-specification/blob/main/semantic_conventions/resource/cloud_provider/aws/ecs.yaml | ||
return new resources_1.Resource({ | ||
// https://github.com/open-telemetry/semantic-conventions/blob/main/semantic_conventions/resource/cloud_provider/aws/ecs.yaml | ||
const attributes = { | ||
[semantic_conventions_1.SemanticResourceAttributes.AWS_ECS_CONTAINER_ARN]: containerArn, | ||
@@ -106,3 +109,11 @@ [semantic_conventions_1.SemanticResourceAttributes.AWS_ECS_CLUSTER_ARN]: clusterArn, | ||
[semantic_conventions_1.SemanticResourceAttributes.AWS_ECS_TASK_REVISION]: taskMetadata['Revision'], | ||
}); | ||
[semantic_conventions_1.SemanticResourceAttributes.CLOUD_ACCOUNT_ID]: accountId, | ||
[semantic_conventions_1.SemanticResourceAttributes.CLOUD_REGION]: region, | ||
}; | ||
// The availability zone is not available in all Fargate runtimes | ||
if (availabilityZone) { | ||
attributes[semantic_conventions_1.SemanticResourceAttributes.CLOUD_AVAILABILITY_ZONE] = | ||
availabilityZone; | ||
} | ||
return new resources_1.Resource(attributes); | ||
} | ||
@@ -109,0 +120,0 @@ static async _getLogResource(containerMetadata) { |
@@ -17,18 +17,9 @@ "use strict"; | ||
*/ | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
__exportStar(require("./AwsEc2Detector"), exports); | ||
__exportStar(require("./AwsBeanstalkDetector"), exports); | ||
__exportStar(require("./AwsEcsDetector"), exports); | ||
__exportStar(require("./AwsEksDetector"), exports); | ||
__exportStar(require("./AwsLambdaDetector"), exports); | ||
const tslib_1 = require("tslib"); | ||
(0, tslib_1.__exportStar)(require("./AwsEc2Detector"), exports); | ||
(0, tslib_1.__exportStar)(require("./AwsBeanstalkDetector"), exports); | ||
(0, tslib_1.__exportStar)(require("./AwsEcsDetector"), exports); | ||
(0, tslib_1.__exportStar)(require("./AwsEksDetector"), exports); | ||
(0, tslib_1.__exportStar)(require("./AwsLambdaDetector"), exports); | ||
//# sourceMappingURL=index.js.map |
@@ -17,14 +17,5 @@ "use strict"; | ||
*/ | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
__exportStar(require("./detectors"), exports); | ||
const tslib_1 = require("tslib"); | ||
(0, tslib_1.__exportStar)(require("./detectors"), exports); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@opentelemetry/resource-detector-aws", | ||
"version": "1.2.5", | ||
"version": "1.3.0", | ||
"description": "OpenTelemetry SDK resource detector for AWS", | ||
@@ -45,3 +45,3 @@ "main": "build/src/index.js", | ||
"@opentelemetry/api": "^1.0.0", | ||
"@opentelemetry/contrib-test-utils": "^0.33.4", | ||
"@opentelemetry/contrib-test-utils": "^0.34.0", | ||
"@types/mocha": "8.2.3", | ||
@@ -64,6 +64,7 @@ "@types/node": "18.11.7", | ||
"@opentelemetry/resources": "^1.0.0", | ||
"@opentelemetry/semantic-conventions": "^1.0.0" | ||
"@opentelemetry/semantic-conventions": "^1.0.0", | ||
"tslib": "^2.3.1" | ||
}, | ||
"homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/detectors/node/opentelemetry-resource-detector-aws#readme", | ||
"gitHead": "efdfc727a49090accee7fea8ff93011b6b84c1e4" | ||
"gitHead": "f81f8a76a8f0af2101c62dbc73cde442f875d833" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
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
101293
5
856
+ Addedtslib@^2.3.1
+ Addedtslib@2.8.1(transitive)