Skip to content

Commit 51bb898

Browse files
authored
Restore unique_host_name logic (#884)
PR #870 reversed the logic overriding the default_unique_host_name with the application_name. This results in problems with AppDynamics where applications running on multiple foundations are unable to add metrics when using the same application name in Cloud Foundry. Really, application_name should never be used. unique_host_name is by definition a unique identifier vs an application_name, which is not guaranteed to be unique. But this restores the previous logic, which was functional and may have handled cases I am not aware of.
1 parent 4d41218 commit 51bb898

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/java_buildpack/framework/app_dynamics_agent.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,8 @@ def tier_name(java_opts, credentials)
138138
end
139139

140140
def unique_host_name(java_opts)
141-
name = @configuration['default_unique_host_name']
142-
name = Shellwords.escape(@application.details['application_name']) if @application.details['application_name']
141+
name = Shellwords.escape(@application.details['application_name'])
142+
name = @configuration['default_unique_host_name'] if @configuration['default_unique_host_name']
143143

144144
java_opts.add_system_property('appdynamics.agent.uniqueHostId', name.to_s)
145145
end

0 commit comments

Comments
 (0)