diff --git a/host/build.gradle b/host/build.gradle index e93f309..1e2195a 100644 --- a/host/build.gradle +++ b/host/build.gradle @@ -4,7 +4,7 @@ plugins { } group = "com.instana.dc" -version = "0.1.3" +version = "0.1.4" repositories { mavenCentral() @@ -20,7 +20,7 @@ dependencies { implementation("io.opentelemetry:opentelemetry-exporter-sender-okhttp:1.34.1") implementation("io.opentelemetry.semconv:opentelemetry-semconv:1.23.1-alpha") implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.16.0-rc1") - implementation(files("libs/otel-dc-0.9.7.jar")) + implementation(files("libs/otel-dc-0.9.8.jar")) testImplementation("org.junit.jupiter:junit-jupiter-api:5.8.1") testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.8.1") diff --git a/host/libs/otel-dc-0.9.7.jar b/host/libs/otel-dc-0.9.8.jar similarity index 80% rename from host/libs/otel-dc-0.9.7.jar rename to host/libs/otel-dc-0.9.8.jar index 31f485f..0195378 100644 Binary files a/host/libs/otel-dc-0.9.7.jar and b/host/libs/otel-dc-0.9.8.jar differ diff --git a/internal/otel-dc/build.gradle b/internal/otel-dc/build.gradle index d3ac3f0..7c0d60e 100644 --- a/internal/otel-dc/build.gradle +++ b/internal/otel-dc/build.gradle @@ -4,7 +4,7 @@ plugins { } group = "com.instana.dc" -version = "0.9.7" +version = "0.9.8" repositories { mavenCentral() diff --git a/internal/otel-dc/src/main/java/com/instana/dc/resources/CgroupV2ContainerIdExtractor.java b/internal/otel-dc/src/main/java/com/instana/dc/resources/CgroupV2ContainerIdExtractor.java index fcf04fb..cf76f5a 100644 --- a/internal/otel-dc/src/main/java/com/instana/dc/resources/CgroupV2ContainerIdExtractor.java +++ b/internal/otel-dc/src/main/java/com/instana/dc/resources/CgroupV2ContainerIdExtractor.java @@ -18,9 +18,7 @@ import static java.util.Optional.empty; -/** - * Utility for extracting the container ID from runtimes inside cgroup v2 containers. - */ +/** Utility for extracting the container ID from runtimes inside cgroup v2 containers. */ class CgroupV2ContainerIdExtractor { private static final Logger logger = @@ -28,7 +26,9 @@ class CgroupV2ContainerIdExtractor { static final Path V2_CGROUP_PATH = Paths.get("/proc/self/mountinfo"); private static final Pattern CONTAINER_ID_RE = Pattern.compile("^[0-9a-f]{64}$"); - private static final Pattern CRI_CONTAINER_ID_RE = Pattern.compile("cri-containerd:[0-9a-f]{64}"); + private static final Pattern CONTAINERD_CONTAINER_ID_RE = + Pattern.compile("cri-containerd:[0-9a-f]{64}"); + private static final Pattern CRIO_CONTAINER_ID_RE = Pattern.compile("\\/crio-[0-9a-f]{64}"); private final ContainerResource.Filesystem filesystem; @@ -56,20 +56,32 @@ Optional extractContainerId() { Optional optCid = fileAsList.stream() - .filter(line -> line.contains("/containers/")) - .flatMap(line -> Stream.of(line.split("/"))) - .map(CONTAINER_ID_RE::matcher) - .filter(Matcher::matches) - .reduce((first, second) -> second) - .map(matcher -> matcher.group(0)); + .filter(line -> line.contains("/crio-")) + .map(CRIO_CONTAINER_ID_RE::matcher) + .filter(Matcher::find) + .findFirst() + .map(matcher -> matcher.group(0).substring(6)); if (optCid.isPresent()) { return optCid; } + + optCid = + fileAsList.stream() + .filter(line -> line.contains("cri-containerd:")) + .map(CONTAINERD_CONTAINER_ID_RE::matcher) + .filter(Matcher::find) + .findFirst() + .map(matcher -> matcher.group(0).substring(15)); + if (optCid.isPresent()) { + return optCid; + } + return fileAsList.stream() - .filter(line -> line.contains("cri-containerd:")) - .map(CRI_CONTAINER_ID_RE::matcher) - .filter(Matcher::find) - .findFirst() - .map(matcher -> matcher.group(0).substring(15)); + .filter(line -> line.contains("/containers/")) + .flatMap(line -> Stream.of(line.split("/"))) + .map(CONTAINER_ID_RE::matcher) + .filter(Matcher::matches) + .reduce((first, second) -> second) + .map(matcher -> matcher.group(0)); } -} \ No newline at end of file +} diff --git a/llm/build.gradle b/llm/build.gradle index 6c8650d..5515c02 100644 --- a/llm/build.gradle +++ b/llm/build.gradle @@ -4,7 +4,7 @@ plugins { } group = "com.instana.dc" -version = "1.0.0" +version = "1.0.1" sourceCompatibility = 11 targetCompatibility = 11 @@ -27,7 +27,7 @@ dependencies { implementation("com.google.protobuf:protobuf-java-util:3.23.4") implementation("com.linecorp.armeria:armeria:1.27.3") implementation("com.linecorp.armeria:armeria-grpc:1.27.3") - implementation(files("libs/otel-dc-0.9.7.jar")) + implementation(files("libs/otel-dc-0.9.8.jar")) testImplementation("org.junit.jupiter:junit-jupiter-api:5.8.1") testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.8.1") diff --git a/llm/libs/otel-dc-0.9.7.jar b/llm/libs/otel-dc-0.9.8.jar similarity index 80% rename from llm/libs/otel-dc-0.9.7.jar rename to llm/libs/otel-dc-0.9.8.jar index 31f485f..0195378 100644 Binary files a/llm/libs/otel-dc-0.9.7.jar and b/llm/libs/otel-dc-0.9.8.jar differ diff --git a/rdb/build.gradle b/rdb/build.gradle index ef73245..7f87c68 100644 --- a/rdb/build.gradle +++ b/rdb/build.gradle @@ -4,7 +4,7 @@ plugins { } group = "com.instana.dc" -version = "0.5.2" +version = "0.5.3" repositories { mavenCentral() @@ -20,7 +20,7 @@ dependencies { implementation("io.opentelemetry:opentelemetry-exporter-sender-okhttp:1.34.1") implementation("io.opentelemetry.semconv:opentelemetry-semconv:1.23.1-alpha") implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.16.0-rc1") - implementation(files("libs/otel-dc-0.9.7.jar")) + implementation(files("libs/otel-dc-0.9.8.jar")) implementation(files("libs/ngdbc-2.4.64.jar")) implementation("org.apache.commons:commons-dbcp2:2.11.0") diff --git a/rdb/config/config.yaml b/rdb/config/config.yaml index 0d0be8f..74cac8e 100644 --- a/rdb/config/config.yaml +++ b/rdb/config/config.yaml @@ -13,13 +13,13 @@ instances: #Data collector properties: poll.interval: 30 callback.interval: 20 - otel.backend.url: http://9.112.252.66:4317 + otel.backend.url: http://localhost:4317 #otel.backend.using.http: true #otel.backend.url: https://host.docker.internal:8991/v1/metrics - #otel.backend.url: http://9.112.252.66:4318 + #otel.backend.url: http://localhost:4318/v1/metrics #OTel properties: - otel.service.name: DamengDC1 + otel.service.name: DamengDcA - db.address: 9.46.118.22 db.port: 5236 @@ -31,10 +31,10 @@ instances: #Data collector properties: poll.interval: 30 callback.interval: 20 - otel.backend.url: http://9.112.252.66:4317 + otel.backend.url: http://localhost:4317 #otel.backend.using.http: true #otel.backend.url: https://host.docker.internal:8991/v1/metrics - #otel.backend.url: http://9.112.252.66:4318 + #otel.backend.url: http://localhost:8992/v1/metrics #OTel properties: - otel.service.name: DamengDC2 + otel.service.name: DamengDcB diff --git a/rdb/libs/otel-dc-0.9.7.jar b/rdb/libs/otel-dc-0.9.8.jar similarity index 80% rename from rdb/libs/otel-dc-0.9.7.jar rename to rdb/libs/otel-dc-0.9.8.jar index 31f485f..0195378 100644 Binary files a/rdb/libs/otel-dc-0.9.7.jar and b/rdb/libs/otel-dc-0.9.8.jar differ