-
Notifications
You must be signed in to change notification settings - Fork 259
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
Log context integration changes #1382
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
helsaawy
force-pushed
the
he/trace-log-context
branch
2 times, most recently
from
April 27, 2022 22:36
9d36957
to
e41a89c
Compare
helsaawy
force-pushed
the
he/trace-log-context
branch
4 times, most recently
from
April 29, 2022 20:40
d7bc8cf
to
c967588
Compare
anmaxvl
reviewed
May 2, 2022
@anmaxvl I'm embarrassed I didn't catch those |
anmaxvl
reviewed
May 2, 2022
helsaawy
force-pushed
the
he/trace-log-context
branch
2 times, most recently
from
May 2, 2022 22:15
2ef2e13
to
bb92ba5
Compare
anmaxvl
reviewed
May 2, 2022
helsaawy
force-pushed
the
he/trace-log-context
branch
2 times, most recently
from
May 3, 2022 14:44
c36bebc
to
c99c73d
Compare
rebased to preserve commit split between updates to logging and tracing, and then replacement in code |
anmaxvl
reviewed
May 4, 2022
anmaxvl
approved these changes
May 4, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one question, otherwise LGTM
kiashok
approved these changes
May 6, 2022
Changed `internal\log` functions interacts with context. `log.G` no longer adds trace/span IDs to entry. Added logrus hook to add trace/span ID to entry when exporting log entry. Added `log.S()` to set the log entry stored in the context with provided fields. `log.G()` now checks the context for a stored context. Added `log.Copy()` to add log entry and trace span from source context to destination, allowing for duplicating contexts but not cancellation. Added `log.U()` to update the context an entry (in the context) points to, allowing it to reference the latest span and other information. Added `oc.StartSpan[WithRemoteParent]` to set the context for log entries to reference the newly created context. Signed-off-by: Hamza El-Saawy <hamzaelsaawy@microsoft.com>
Signed-off-by: Hamza El-Saawy <hamzaelsaawy@microsoft.com>
helsaawy
force-pushed
the
he/trace-log-context
branch
from
May 9, 2022 15:03
c99c73d
to
50896fa
Compare
rebased to fix merge conflict |
princepereira
pushed a commit
to princepereira/hcsshim
that referenced
this pull request
Aug 28, 2024
Log integration changes Changed `internal\log` functions interacts with context. `log.G` no longer adds trace/span IDs to entry. Added logrus hook to add trace/span ID to entry when exporting log entry. Added `log.S()` to set the log entry stored in the context with provided fields. `log.G()` now checks the context for a stored context. Added `log.Copy()` to add log entry and trace span from source context to destination, allowing for duplicating contexts but not cancellation. Added `log.U()` to update the context an entry (in the context) points to, allowing it to reference the latest span and other information. Added `oc.StartSpan[WithRemoteParent]` to set the context for log entries to reference the newly created context. Switch to oc.StartSpan to update log context Signed-off-by: Hamza El-Saawy <hamzaelsaawy@microsoft.com>
princepereira
pushed a commit
to princepereira/hcsshim
that referenced
this pull request
Aug 29, 2024
Log integration changes Changed `internal\log` functions interacts with context. `log.G` no longer adds trace/span IDs to entry. Added logrus hook to add trace/span ID to entry when exporting log entry. Added `log.S()` to set the log entry stored in the context with provided fields. `log.G()` now checks the context for a stored context. Added `log.Copy()` to add log entry and trace span from source context to destination, allowing for duplicating contexts but not cancellation. Added `log.U()` to update the context an entry (in the context) points to, allowing it to reference the latest span and other information. Added `oc.StartSpan[WithRemoteParent]` to set the context for log entries to reference the newly created context. Switch to oc.StartSpan to update log context Signed-off-by: Hamza El-Saawy <hamzaelsaawy@microsoft.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is broken into two commits: the second is a text-replace of trace.StartSpan with oc.StartSpan
Changed how
internal\log
functions interacts with context.log.G
no longer adds trace/span IDs to entry.Added logrus hook to add trace/span ID to entry when exporting log
entry.
This reduces overhead associated creating a log entry such that tracing
information is only added if the entry will be exported.
Added
log.U(ctx)
to update the context an entry (in the context) pointsto, allowing it to reference the latest span and other values stored in the
context.
Added
log.S(ctx)
to set the log entry stored in the context withprovided fields.
log.G(ctx)
now checks the context for a storedcontext.
log.S
andlog.U
are the logging equivalent of span attributes, exceptthe logrus fields added will be present on all log entries in the context
retrieved with
log.G(ctx)
.Added
log.Copy()
to add log entry and trace span from source contextto destination, allowing for duplicating log entries and span context
but not cancellation.
Added
oc.StartSpan[WithRemoteParent]
to set the context for log entriesto reference the newly created context that contains the span using
log.U
.Replaced instances of
trace.StartSpan
withoc.StartSpan
.Signed-off-by: Hamza El-Saawy hamzaelsaawy@microsoft.com