We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 31223db commit 431dedeCopy full SHA for 431dede
1 file changed
src/java/frameworks/open_telemetry_javaagent.go
@@ -111,8 +111,9 @@ func (o *OpenTelemetryJavaagentFramework) Finalize() error {
111
// Set otel.service.name to the application name if not specified in credentials
112
if _, hasServiceName := service.Credentials["otel.service.name"]; !hasServiceName {
113
// Use the build directory name as the application name
114
- appName := filepath.Base(o.context.Stager.BuildDir())
115
- javaOpts += fmt.Sprintf(" -Dotel.service.name=%s", appName)
+ if appName := GetApplicationName(false); appName != "" {
+ javaOpts += fmt.Sprintf(" -Dotel.service.name=%s", appName)
116
+ }
117
}
118
119
0 commit comments