Skip to content

Commit ec4123c

Browse files
committed
Configure StackDriver Debugger
Previously the application name and version of an application debugged using Google Stackdriver Debugger were fixed to the name and version as defined by Cloud Foundry. While this is a great default case, there are reasons for overriding it. This change makes those values configurable.
1 parent b73db04 commit ec4123c

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

config/google_stackdriver_debugger.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,5 @@
1717
---
1818
version: 2.+
1919
repository_root: "{default.repository.root}/google-stackdriver-debugger/{platform}/{architecture}"
20+
application_name:
21+
application_version:

lib/java_buildpack/framework/google_stackdriver_debugger.rb

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ def release
3939
.add_agentpath_with_props(@droplet.sandbox + 'cdbg_java_agent.so', '--logtostderr' => 1)
4040
.add_system_property('com.google.cdbg.auth.serviceaccount.enable', true)
4141
.add_system_property('com.google.cdbg.auth.serviceaccount.jsonfile', json_file)
42-
.add_system_property('com.google.cdbg.module', @application.details['application_name'])
43-
.add_system_property('com.google.cdbg.version', @application.details['application_version'])
42+
.add_system_property('com.google.cdbg.module', application_name)
43+
.add_system_property('com.google.cdbg.version', application_version)
4444
end
4545

4646
protected
@@ -58,6 +58,14 @@ def supports?
5858

5959
private
6060

61+
def application_name
62+
@configuration['application_name'] || @application.details['application_name']
63+
end
64+
65+
def application_version
66+
@configuration['application_version'] || @application.details['application_version']
67+
end
68+
6169
def json_file
6270
@droplet.sandbox + 'svc.json'
6371
end

0 commit comments

Comments
 (0)