From 8b1c3a70730ead0aaad2acc6d6c53ecf5a487fe6 Mon Sep 17 00:00:00 2001 From: Keepers Date: Mon, 20 Mar 2023 15:12:05 -0600 Subject: [PATCH] add labels to logged errors (#2824) #### Does this PR need a docs update or release note? - [x] :no_entry: No #### Type of change - [x] :broom: Tech Debt/Cleanup --- src/pkg/logger/logger.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pkg/logger/logger.go b/src/pkg/logger/logger.go index db80f8421..93ee86b13 100644 --- a/src/pkg/logger/logger.go +++ b/src/pkg/logger/logger.go @@ -284,7 +284,9 @@ func Ctx(ctx context.Context) *zap.SugaredLogger { // and packs all of the structured data in the error inside it. func CtxErr(ctx context.Context, err error) *zap.SugaredLogger { return Ctx(ctx). - With("error", err). + With( + "error", err, + "error_labels", clues.Labels(err)). With(clues.InErr(err).Slice()...) }