diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c3df1a..94a1cfd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,9 @@ versioning](https://go.dev/doc/modules/version-numbers). ### Fixed +- [All] Fixes an issue where the caller function name is badly reported as a random slice of the + current function name (#85) + ### Security ## [1.0.0](https://github.com/autometrics-dev/autometrics-go/releases/tag/v1.0.0) 2023-12-01 diff --git a/pkg/autometrics/instrument.go b/pkg/autometrics/instrument.go index dac0cec..aef74f2 100644 --- a/pkg/autometrics/instrument.go +++ b/pkg/autometrics/instrument.go @@ -66,7 +66,7 @@ func callerInfo(ctx context.Context) (callInfo CallInfo) { ")", ""), "*", "") - callInfo.Parent.Function = functionName[index+1:] + callInfo.Parent.Function = parentFrameFunctionName[index+1:] } return