feat(core): Allow to pass start/end timestamp for spans flexibly#10060
Merged
feat(core): Allow to pass start/end timestamp for spans flexibly#10060
Conversation
AbhiPrasad
reviewed
Jan 4, 2024
| * HrTime[1] = Number((1609504210.150 - HrTime[0]).toFixed(9)) * 1e9 = 150000000. | ||
| * This is represented in HrTime format as [1609504210, 150000000]. | ||
| */ | ||
| return input[0] + input[1] / 1e9; |
Contributor
There was a problem hiding this comment.
If this is vendored we need to add license
Member
Author
There was a problem hiding this comment.
it is only inspired, not copied - only the comment I took verbatim 🤔 but we can also move this to it's own file, then we can still add the licence even if it is adapted from there?
Contributor
There was a problem hiding this comment.
with these kind of things, better be safe than sorry - let's move to it's own file.
Contributor
size-limit report 📦
|
We allow the same formats as OpenTelemetry: * `number` (we handle both seconds and milliseconds) * `Date` * `[seconds, nanoseconds]`
fd06fbc to
86c5009
Compare
lforst
approved these changes
Jan 5, 2024
| } | ||
|
|
||
| function normalizeContext(context: TransactionContext): TransactionContext { | ||
| function normalizeContext(context: StartSpanOptions): TransactionContext { |
Contributor
There was a problem hiding this comment.
Can we add a small comment explaining what is normalized and why things need normalization?
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.
We allow the same formats as OpenTelemetry:
number(we handle both seconds and milliseconds)Date[seconds, nanoseconds]