Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SpanLogger: Change org_id log labels to user #156

Merged
merged 2 commits into from
Apr 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`. #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