This repository was archived by the owner on Jul 31, 2023. It is now read-only.
trace: add starttime start option#1176
Open
gwik wants to merge 1 commit intocensus-instrumentation:masterfrom
Open
trace: add starttime start option#1176gwik wants to merge 1 commit intocensus-instrumentation:masterfrom
gwik wants to merge 1 commit intocensus-instrumentation:masterfrom
Conversation
Adds a StartTime option when creating a new span.
In some cases, you are able to trace only after the operation
was made. for example in some post-operation hook/observer.
func myHook(ctx context.Context, info queryInfo) {
_, span := StartSpan("mydatabase", WithStartTime(time.Now().Add(-1 * info.Duration()))
span.End()
}
rghetia
reviewed
Sep 26, 2019
Contributor
rghetia
left a comment
There was a problem hiding this comment.
Overall LG. One minor comment.
| } | ||
| } | ||
|
|
||
| // WithStartTime sets the span start time. |
Contributor
There was a problem hiding this comment.
Perhaps a bit more description would be better.
WithStartTime sets the start time of the span to provided time t, when it is started.
In absence of this option, wall clock time is used as the start time.
This option is typically used when starting of a span is delayed.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Adds a StartTime option when creating a new span.
In some cases, you are able to trace only after the operation
was made. for example in some post-operation hook/observer.