diff --git a/instrumentation.go b/instrumentation.go index bf0bc4eea..0402a1401 100644 --- a/instrumentation.go +++ b/instrumentation.go @@ -185,7 +185,7 @@ func newInstConfig(ctx context.Context, opts []InstrumentationOption) (instConfi // Defaults. if c.serviceName == "" { - c.serviceName = c.defualtServiceName() + c.serviceName = c.defaultServiceName() } if c.traceExp == nil { var e error @@ -201,7 +201,7 @@ func newInstConfig(ctx context.Context, opts []InstrumentationOption) (instConfi return c, err } -func (c instConfig) defualtServiceName() string { +func (c instConfig) defaultServiceName() string { name := "unknown_service" if c.target.ExePath != "" { name = fmt.Sprintf("%s:%s", name, filepath.Base(c.target.ExePath)) diff --git a/instrumentation_test.go b/instrumentation_test.go index a9073ac2e..d638af53b 100644 --- a/instrumentation_test.go +++ b/instrumentation_test.go @@ -38,7 +38,7 @@ func TestWithServiceName(t *testing.T) { // No service name provided - check for default value c, err = newInstConfig(ctx, []InstrumentationOption{}) require.NoError(t, err) - assert.Equal(t, c.defualtServiceName(), c.serviceName) + assert.Equal(t, c.defaultServiceName(), c.serviceName) } func TestWithPID(t *testing.T) {