-
Notifications
You must be signed in to change notification settings - Fork 38
Allow custom timestamps to be used on Span.end() #115
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
Conversation
Security InsightsNo security relevant content was detected by automated scans. Action Items
Questions or Comments? Reach out on Slack: #support-infosec. |
@rafaelring would you mind merging master or rebasing off master? |
9e978bd
to
db45aee
Compare
Hi folks, sorry for the radio silence! We've updated the branch with the current master and will update the code to be compatible with master :) |
db45aee
to
ce8154e
Compare
@blakeroberts-wk how could we get approval to run the CI again? I belive we've addressed the changes that made it break last time 😓 |
test/integration/sdk/span_test.dart
Outdated
[], | ||
sdk.SpanLimits(), | ||
startTime); | ||
expect(span.startTime, Int64(1000000000000)); |
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.
expect(span.startTime, Int64(1000000000000)); | |
expect(span.startTime, startTime); |
test/integration/sdk/span_test.dart
Outdated
span.end(endTime: Int64(1000000020000)); | ||
expect(span.startTime, Int64(1000000000000)); | ||
expect(span.endTime, Int64(1000000020000)); | ||
expect(span.endTime, greaterThan(span.startTime)); |
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.
nit: remove line, unnecessary expectation given the previous line
test/integration/sdk/span_test.dart
Outdated
verifyNever(() => mockProcessor1.onEnd(span)); | ||
verifyNever(() => mockProcessor2.onEnd(span)); | ||
|
||
span.end(endTime: Int64(1000000020000)); |
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.
span.end(endTime: Int64(1000000020000)); | |
final endTime = Int64(1000000020000); | |
span.end(endTime: endTime); |
test/integration/sdk/span_test.dart
Outdated
|
||
span.end(endTime: Int64(1000000020000)); | ||
expect(span.startTime, Int64(1000000000000)); | ||
expect(span.endTime, Int64(1000000020000)); |
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.
expect(span.endTime, Int64(1000000020000)); | |
expect(span.endTime, endTime); |
As it's possible for Spans to be started with a custom startTime, this commit adds support for ending a span with a custom endTime.
ce8154e
to
50e82aa
Compare
@blakeroberts-wk thank you for the review - changes made :) |
@Workiva/release-management-p |
QA +1 |
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.
+1 from RM
Which problem is this PR solving?
Currently it's possible to start spans with a custom
startTime
but it isn't possible to set a customendTime
when ending them. This is useful for dispatching spans that happened on a different time window than the moment in whichstart()/end()
were called.Short description of the change
This PR adds a new optional
endTime
parameter to theSpan.end()
method which allows a customendTime
to be set on the Span rather than always using thetimestamp.now
.How Has This Been Tested?
Added a new integration test in which we create a Span with a custom
startTime
and then end it with a customendTime
and validate the actual reported timestamps.Checklist: