Skip to content

Commit ca73d29

Browse files
committed
use HostIncubatingAttributes and remove enabling for java 16, make HostResource attribute constants private
1 parent b14e7bd commit ca73d29

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

instrumentation/resources/library/src/main/java/io/opentelemetry/instrumentation/resources/HostResource.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
public final class HostResource {
1818

1919
// copied from HostIncubatingAttributes
20-
public static final AttributeKey<String> HOST_ARCH = AttributeKey.stringKey("host.arch");
21-
public static final AttributeKey<String> HOST_NAME = AttributeKey.stringKey("host.name");
20+
private static final AttributeKey<String> HOST_ARCH = AttributeKey.stringKey("host.arch");
21+
private static final AttributeKey<String> HOST_NAME = AttributeKey.stringKey("host.name");
2222

2323
private static final Resource INSTANCE = buildResource();
2424

instrumentation/resources/library/src/testSecurityManager/java/io/opentelemetry/instrumentation/resources/SecurityManagerResourceTest.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
import io.opentelemetry.api.common.Attributes;
1111
import io.opentelemetry.sdk.resources.Resource;
12+
import io.opentelemetry.semconv.incubating.HostIncubatingAttributes;
1213
import io.opentelemetry.semconv.incubating.ProcessIncubatingAttributes;
1314
import org.junit.jupiter.api.Test;
1415
import org.junit.jupiter.api.TestInstance;
@@ -19,14 +20,14 @@
1920
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
2021
@ExtendWith(SecurityManagerExtension.class)
2122
@EnabledOnJre(
22-
value = {JRE.JAVA_8, JRE.JAVA_11, JRE.JAVA_16},
23+
value = {JRE.JAVA_8, JRE.JAVA_11},
2324
disabledReason = "Java 17 deprecates security manager for removal")
2425
class SecurityManagerResourceTest {
2526

2627
@Test
2728
void hostResourceTestEmpty() {
2829
Attributes attributes = HostResource.buildResource().getAttributes();
29-
assertThat(attributes.asMap()).containsOnlyKeys(HostResource.HOST_NAME);
30+
assertThat(attributes.asMap()).containsOnlyKeys(HostIncubatingAttributes.HOST_NAME);
3031
}
3132

3233
@Test

0 commit comments

Comments
 (0)