-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
feat(core): Allow to pass start/end timestamp for spans flexibly #10060
Conversation
* 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; |
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.
If this is vendored we need to add license
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.
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?
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.
with these kind of things, better be safe than sorry - let's move to it's own file.
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.
done!
size-limit report 📦
|
We allow the same formats as OpenTelemetry: * `number` (we handle both seconds and milliseconds) * `Date` * `[seconds, nanoseconds]`
fd06fbc
to
86c5009
Compare
@@ -238,12 +239,17 @@ function createChildSpanOrTransaction( | |||
return parentSpan ? parentSpan.startChild(ctx) : hub.startTransaction(ctx); | |||
} | |||
|
|||
function normalizeContext(context: TransactionContext): TransactionContext { | |||
function normalizeContext(context: StartSpanOptions): TransactionContext { |
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.
Can we add a small comment explaining what is normalized and why things need normalization?
We allow the same formats as OpenTelemetry:
number
(we handle both seconds and milliseconds)Date
[seconds, nanoseconds]