Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@opentelemetry/resource-detector-container

Package Overview
Dependencies
Maintainers
3
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@opentelemetry/resource-detector-container - npm Package Compare versions

Comparing version 0.3.1 to 0.3.2

26

build/src/detectors/ContainerDetector.js

@@ -49,6 +49,26 @@ "use strict";

const splitData = rawData.trim().split('\n');
for (const str of splitData) {
if (str.length >= this.CONTAINER_ID_LENGTH) {
return str.substring(str.length - this.CONTAINER_ID_LENGTH);
for (const line of splitData) {
const lastSlashIdx = line.lastIndexOf('/');
if (lastSlashIdx === -1) {
continue;
}
const lastSection = line.substring(lastSlashIdx + 1);
const colonIdx = lastSection.lastIndexOf(':');
if (colonIdx !== -1) {
// since containerd v1.5.0+, containerId is divided by the last colon when the cgroupDriver is systemd:
// https://github.com/containerd/containerd/blob/release/1.5/pkg/cri/server/helpers_linux.go#L64
return lastSection.substring(colonIdx + 1);
}
else {
let startIdx = lastSection.lastIndexOf('-');
let endIdx = lastSection.lastIndexOf('.');
startIdx = startIdx === -1 ? 0 : startIdx + 1;
if (endIdx === -1) {
endIdx = lastSection.length;
}
if (startIdx > endIdx) {
continue;
}
return lastSection.substring(startIdx, endIdx);
}
}

@@ -55,0 +75,0 @@ return undefined;

2

build/src/version.d.ts

@@ -1,2 +0,2 @@

export declare const VERSION = "0.3.1";
export declare const VERSION = "0.3.2";
//# sourceMappingURL=version.d.ts.map

@@ -20,3 +20,3 @@ "use strict";

// this is autogenerated file, see scripts/version-update.js
exports.VERSION = '0.3.1';
exports.VERSION = '0.3.2';
//# sourceMappingURL=version.js.map
{
"name": "@opentelemetry/resource-detector-container",
"version": "0.3.1",
"version": "0.3.2",
"description": "Opentelemetry resource detector to get container resource attributes",

@@ -39,12 +39,12 @@ "main": "build/src/index.js",

"@opentelemetry/api": "^1.0.0",
"@opentelemetry/contrib-test-utils": "^0.34.1",
"@opentelemetry/contrib-test-utils": "^0.34.2",
"@types/mocha": "8.2.3",
"@types/node": "^18.0.0",
"@types/sinon": "10.0.16",
"@types/node": "18.6.5",
"@types/sinon": "10.0.18",
"eslint-plugin-header": "^3.1.1",
"mocha": "7.2.0",
"nock": "13.3.2",
"nock": "13.3.3",
"nyc": "15.1.0",
"rimraf": "5.0.1",
"sinon": "15.0.1",
"rimraf": "5.0.5",
"sinon": "15.2.0",
"ts-mocha": "10.0.0",

@@ -61,3 +61,3 @@ "typescript": "4.4.4"

"homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/detectors/node/opentelemetry-resource-detector-container#readme",
"gitHead": "b3d30afe7376760d211b20c4fb45988ac58c1d85"
"gitHead": "a8c225d2febcac561a70ca586d3efd5a84f9f3fa"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc