File tree Expand file tree Collapse file tree 4 files changed +14
-13
lines changed
lib/java_buildpack/framework
framework_dynatrace_one_agent/.java-buildpack/dynatrace_one_agent Expand file tree Collapse file tree 4 files changed +14
-13
lines changed Original file line number Diff line number Diff line change @@ -68,8 +68,8 @@ def release
68
68
69
69
manifest = agent_manifest
70
70
71
- @droplet . java_opts . add_agentpath ( agent_path ( manifest ) )
72
- @droplet . java_opts . add_preformatted_options ( '-Xshare:off' )
71
+ environment_variables = @droplet . environment_variables
72
+ environment_variables . add_environment_variable ( LD_PRELOAD , agent_path ( manifest ) )
73
73
74
74
dynatrace_environment_variables ( manifest )
75
75
end
@@ -99,6 +99,8 @@ def supports?
99
99
100
100
DT_NETWORK_ZONE = 'DT_NETWORK_ZONE'
101
101
102
+ LD_PRELOAD = 'LD_PRELOAD'
103
+
102
104
ENVIRONMENTID = 'environmentid'
103
105
104
106
FILTER = /dynatrace/ . freeze
@@ -126,8 +128,8 @@ def agent_manifest
126
128
127
129
def agent_path ( manifest )
128
130
technologies = manifest [ 'technologies' ]
129
- java_binaries = technologies [ 'java ' ] [ 'linux-x86-64' ]
130
- loader = java_binaries . find { |bin | bin [ 'binarytype' ] == 'loader ' }
131
+ java_binaries = technologies [ 'process ' ] [ 'linux-x86-64' ]
132
+ loader = java_binaries . find { |bin | bin [ 'binarytype' ] == 'primary ' }
131
133
@droplet . sandbox + loader [ 'path' ]
132
134
end
133
135
Original file line number Diff line number Diff line change 1
1
{
2
2
"technologies" : {
3
- "java " : {
3
+ "process " : {
4
4
"linux-x86-64" : [
5
5
{
6
- "path" : " agent/lib64/liboneagentloader .so" ,
7
- "binarytype" : " loader "
6
+ "path" : " agent/lib64/liboneagentproc .so" ,
7
+ "binarytype" : " primary "
8
8
}
9
9
]
10
10
}
Original file line number Diff line number Diff line change 50
50
51
51
component . compile
52
52
53
- expect ( sandbox + 'agent/lib64/liboneagentloader .so' ) . to exist
53
+ expect ( sandbox + 'agent/lib64/liboneagentproc .so' ) . to exist
54
54
expect ( sandbox + 'manifest.json' ) . to exist
55
55
end
56
56
57
- it 'updates JAVA_OPTS with agent loader and share set to off ' ,
57
+ it 'sets LD_PRELOAD with liboneagentproc ' ,
58
58
app_fixture : 'framework_dynatrace_one_agent' do
59
59
60
60
component . release
61
61
62
- expect ( java_opts ) . to include ( '-agentpath:$PWD/.java-buildpack/dynatrace_one_agent/agent/lib64/' \
63
- 'liboneagentloader.so' )
64
- expect ( java_opts ) . to include ( '-Xshare:off' )
62
+ expect ( environment_variables ) . to include ( 'LD_PRELOAD=$PWD/.java-buildpack/dynatrace_one_agent/agent/lib64/' \
63
+ 'liboneagentproc.so' )
65
64
end
66
65
67
66
it 'updates environment variables' ,
112
111
113
112
component . compile
114
113
115
- expect ( sandbox + 'agent/lib64/liboneagentloader .so' ) . to exist
114
+ expect ( sandbox + 'agent/lib64/liboneagentproc .so' ) . to exist
116
115
expect ( sandbox + 'manifest.json' ) . to exist
117
116
end
118
117
end
You can’t perform that action at this time.
0 commit comments