-
Notifications
You must be signed in to change notification settings - Fork 479
[o11y] Additional hardening against missing outcome event, STW optimizations #5527
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
base: main
Are you sure you want to change the base?
Conversation
d8a2a9c to
3d6898e
Compare
| return buffered; | ||
| } | ||
|
|
||
| protected: |
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.
The protected thing here won't be needed once #5519 and the corresponding internal PR have landed.
| auto& tailStreamWriter = KJ_UNWRAP_OR_RETURN(maybeTailStreamWriter); | ||
| // This is where we'll actually encode the span. This function should never be invoked if STW is | ||
| // inactive as span tracing is only used in STW. | ||
| auto& tailStreamWriter = KJ_ASSERT_NONNULL(maybeTailStreamWriter); |
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.
this is intended as additional hardening, using KJ_UNWRAP_OR_RETURN could cause us to miss out on span tracing being set up when it is not being used – I'm highly confident that we're already avoiding this though.
|
|
||
| KJ_IF_SOME(writer, maybeTailStreamWriter) { | ||
| auto& spanContext = KJ_UNWRAP_OR_RETURN(topLevelInvocationSpanContext); | ||
| auto& spanContext = KJ_ASSERT_NONNULL(topLevelInvocationSpanContext); |
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.
This serves as additional hardening too, I'm very confident that we always provide the Onset event when doing tracing.
|
Downstream PR is still WIP, but this is ready for review. |
3d6898e to
5dc1403
Compare
|
The generated output of |
…zations - Introduce a new WorkerTracer parameter indicating whether any BTWs are present. In a follow-up, this will be used to optimize memory management, but for now it helps us assert that if we have a tracer with logLevel none, we have BTWs (otherwise the tracer would be redundant, indicating waste). - Log an error if a WorkerTracer is destructed without getting the Outcome event even when logLevel == none
5dc1403 to
b329282
Compare
present. In a follow-up, this will be used to optimize memory management,
but for now it helps us assert that if we have a tracer with logLevel none,
we have BTWs (otherwise the tracer would be redundant, indicating waste).
even when logLevel == none