From 781b553652f7fa6eaf13e7121277efcc9d0a8400 Mon Sep 17 00:00:00 2001 From: Gerry Agbobada Date: Thu, 25 Jan 2024 09:45:18 +0100 Subject: [PATCH 1/2] Fix bad copy-paste mistake Fix #85 --- pkg/autometrics/instrument.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From 8a96ced5547643970c91c1f6ee1f53e70c0c0658 Mon Sep 17 00:00:00 2001 From: Gerry Agbobada Date: Thu, 25 Jan 2024 09:47:34 +0100 Subject: [PATCH 2/2] Update changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) 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