From edbd9aa8ab0ba9588a5fe21eff6ddc821cc0874e Mon Sep 17 00:00:00 2001 From: Lauri Tulmin Date: Wed, 22 Jan 2025 18:50:21 +0200 Subject: [PATCH] Disable container id detection on z/os (#13042) --- .../instrumentation/resources/ContainerResource.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/instrumentation/resources/library/src/main/java/io/opentelemetry/instrumentation/resources/ContainerResource.java b/instrumentation/resources/library/src/main/java/io/opentelemetry/instrumentation/resources/ContainerResource.java index db46fbb138cb..3cb14268b538 100644 --- a/instrumentation/resources/library/src/main/java/io/opentelemetry/instrumentation/resources/ContainerResource.java +++ b/instrumentation/resources/library/src/main/java/io/opentelemetry/instrumentation/resources/ContainerResource.java @@ -50,6 +50,12 @@ private ContainerResource() { // Visible for testing Resource buildResource() { + // disable container id detection on z/os + // https://github.com/open-telemetry/opentelemetry-java-instrumentation/issues/12418 + String osName = System.getProperty("os.name"); + if (osName.equalsIgnoreCase("z/OS") || osName.equalsIgnoreCase("OS/390")) { + return Resource.empty(); + } return getContainerId() .map(id -> Resource.create(Attributes.of(CONTAINER_ID, id))) .orElseGet(Resource::empty);