File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -129,7 +129,7 @@ func (s *SplunkOtelJavaAgentFramework) Finalize() error {
129129 opts = append (opts , fmt .Sprintf ("-javaagent:%s" , runtimeJarPath ))
130130
131131 // Configure service name
132- if appName := s . getApplicationName ( ); appName != "" {
132+ if appName := GetApplicationName ( false ); appName != "" {
133133 opts = append (opts , fmt .Sprintf ("-Dotel.service.name=%s" , appName ))
134134 }
135135
@@ -234,25 +234,6 @@ func (s *SplunkOtelJavaAgentFramework) getCredentials() SplunkCredentials {
234234 return creds
235235}
236236
237- // getApplicationName returns the application name
238- func (s * SplunkOtelJavaAgentFramework ) getApplicationName () string {
239- vcapApp := os .Getenv ("VCAP_APPLICATION" )
240- if vcapApp == "" {
241- return ""
242- }
243-
244- var appData map [string ]interface {}
245- if err := json .Unmarshal ([]byte (vcapApp ), & appData ); err != nil {
246- return ""
247- }
248-
249- if name , ok := appData ["application_name" ].(string ); ok {
250- return name
251- }
252-
253- return ""
254- }
255-
256237func (s * SplunkOtelJavaAgentFramework ) constructJarPath (agentDir string ) error {
257238 jarPattern := filepath .Join (agentDir , "splunk-otel-javaagent.jar" )
258239 if _ , err := os .Stat (jarPattern ); err != nil {
You can’t perform that action at this time.
0 commit comments