From 97f5d29e36c3faf615af78cb7504cc30c32f1a9d Mon Sep 17 00:00:00 2001 From: Dimitar Dimitrov Date: Tue, 5 Apr 2022 17:41:20 +0300 Subject: [PATCH 1/2] SpanLogger: Change org_id log labels to user --- CHANGELOG.md | 1 + spanlogger/spanlogger.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c0e99694..0a6359c9d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ * [CHANGE] Lifecycler: It's now possible to change default value of lifecycler's `final-sleep`. #121 * [CHANGE] Minor cosmetic changes in ring and memberlist HTTP status templates. #149 * [CHANGE] flagext.Secret: `value` field is no longer exported. Value can be read using `String()` method and set using `Set` method. #154 +* [CHANGE] spanlogger.SpanLogger: Log the user ID from the context with the `user` label instead of `org_id` * [ENHANCEMENT] Add middleware package. #38 * [ENHANCEMENT] Add the ring package #45 * [ENHANCEMENT] Add limiter package. #41 diff --git a/spanlogger/spanlogger.go b/spanlogger/spanlogger.go index 91876a728..a4affd841 100644 --- a/spanlogger/spanlogger.go +++ b/spanlogger/spanlogger.go @@ -101,7 +101,7 @@ func withContext(ctx context.Context, logger log.Logger, resolver TenantResolver // even though the code-base generally uses `userID` to refer to the same thing. userID, err := resolver.TenantID(ctx) if err == nil && userID != "" { - logger = log.With(logger, "org_id", userID) + logger = log.With(logger, "user", userID) } traceID, ok := tracing.ExtractSampledTraceID(ctx) From d85bfb0332894e7848f7097303c617cb813c2838 Mon Sep 17 00:00:00 2001 From: Dimitar Dimitrov Date: Tue, 5 Apr 2022 17:46:06 +0300 Subject: [PATCH 2/2] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a6359c9d..f73d054d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,7 +24,7 @@ * [CHANGE] Lifecycler: It's now possible to change default value of lifecycler's `final-sleep`. #121 * [CHANGE] Minor cosmetic changes in ring and memberlist HTTP status templates. #149 * [CHANGE] flagext.Secret: `value` field is no longer exported. Value can be read using `String()` method and set using `Set` method. #154 -* [CHANGE] spanlogger.SpanLogger: Log the user ID from the context with the `user` label instead of `org_id` +* [CHANGE] spanlogger.SpanLogger: Log the user ID from the context with the `user` label instead of `org_id`. #156 * [ENHANCEMENT] Add middleware package. #38 * [ENHANCEMENT] Add the ring package #45 * [ENHANCEMENT] Add limiter package. #41