Skip to content

Commit

Permalink
SpanLogger: Change org_id log labels to user (#156)
Browse files Browse the repository at this point in the history
* SpanLogger: Change org_id log labels to user

* Update CHANGELOG.md
  • Loading branch information
dimitarvdimitrov authored Apr 21, 2022
1 parent 2348722 commit 4c034f4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
* [CHANGE] Lifecycler: Default value of lifecycler's `final-sleep` is now `0s` (i.e. no 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`. #156
* [ENHANCEMENT] Add middleware package. #38
* [ENHANCEMENT] Add the ring package #45
* [ENHANCEMENT] Add limiter package. #41
Expand Down
2 changes: 1 addition & 1 deletion spanlogger/spanlogger.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 4c034f4

Please sign in to comment.