Replacing trace.StartSpan with oc.StartSpan#1378
Draft
helsaawy wants to merge 2 commits intomicrosoft:mainfrom
Draft
Replacing trace.StartSpan with oc.StartSpan#1378helsaawy wants to merge 2 commits intomicrosoft:mainfrom
helsaawy wants to merge 2 commits intomicrosoft:mainfrom
Conversation
Added logrus hook that intercepts entries headed for ETW or stdout (for the Linux GCS case). Hook allows formatting structs, maps, arrays, etc. as JSON strings, as well formatting `time.Time` and `time.Duration` consistently. Added hook to shim and Linux GCS. Updated span export to: * include span kind * include status code * format time as string * log if span attributes were dropped Added helper `log.Format*` functions to format Time and other structs to JSON. This is done by the logging hook, but allows spans to also format their attributes consistently, since they must be converted to strings. 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>
Replaced `trace.StartSpan[WithRemoteParent]` to use `oc.`. Use `log.Format*` in span attributes and to format specific objects. Use `log.G()` or `log.L` instead of `logrus.*`. Signed-off-by: Hamza El-Saawy <hamzaelsaawy@microsoft.com>
This file contains hidden or 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
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.
No description provided.