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);