File tree 2 files changed +6
-7
lines changed
instrumentation/resources/library/src
main/java/io/opentelemetry/instrumentation/resources
testSecurityManager/java/io/opentelemetry/instrumentation/resources
2 files changed +6
-7
lines changed Original file line number Diff line number Diff line change 23
23
public final class ProcessResource {
24
24
25
25
// copied from ProcessIncubatingAttributes
26
- private static final AttributeKey <List <String >> PROCESS_COMMAND_ARGS =
26
+ static final AttributeKey <List <String >> PROCESS_COMMAND_ARGS =
27
27
AttributeKey .stringArrayKey ("process.command_args" );
28
- private static final AttributeKey <String > PROCESS_COMMAND_LINE =
28
+ static final AttributeKey <String > PROCESS_COMMAND_LINE =
29
29
AttributeKey .stringKey ("process.command_line" );
30
- private static final AttributeKey <String > PROCESS_EXECUTABLE_PATH =
30
+ static final AttributeKey <String > PROCESS_EXECUTABLE_PATH =
31
31
AttributeKey .stringKey ("process.executable.path" );
32
- private static final AttributeKey <Long > PROCESS_PID = AttributeKey .longKey ("process.pid" );
32
+ static final AttributeKey <Long > PROCESS_PID = AttributeKey .longKey ("process.pid" );
33
33
34
34
// Note: This pattern doesn't support file paths with spaces in them.
35
35
// Important: This is statically used in buildResource, so must be declared/initialized first.
Original file line number Diff line number Diff line change 7
7
8
8
import static org .assertj .core .api .Assertions .assertThat ;
9
9
10
- import io .opentelemetry .api .common .AttributeKey ;
11
10
import io .opentelemetry .api .common .Attributes ;
12
11
import io .opentelemetry .sdk .resources .Resource ;
13
12
import org .junit .jupiter .api .Test ;
@@ -26,7 +25,7 @@ class SecurityManagerResourceTest {
26
25
@ Test
27
26
void hostResourceTestEmpty () {
28
27
Attributes attributes = HostResource .buildResource ().getAttributes ();
29
- assertThat (attributes .asMap ()).containsOnlyKeys (AttributeKey . stringKey ( "host.name" ) );
28
+ assertThat (attributes .asMap ()).containsOnlyKeys (HostResource . HOST_NAME );
30
29
}
31
30
32
31
@ Test
@@ -37,7 +36,7 @@ void osResourceEmpty() {
37
36
@ Test
38
37
void processResourceEmpty () {
39
38
Attributes attributes = ProcessResource .buildResource ().getAttributes ();
40
- assertThat (attributes .asMap ()).containsOnlyKeys (AttributeKey . longKey ( "process.pid" ) );
39
+ assertThat (attributes .asMap ()).containsOnlyKeys (ProcessResource . PROCESS_PID );
41
40
}
42
41
43
42
@ Test
You can’t perform that action at this time.
0 commit comments