-
Notifications
You must be signed in to change notification settings - Fork 335
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
Add script version to worker trace events. #1445
Conversation
src/workerd/api/trace.h
Outdated
@@ -100,6 +102,7 @@ class TraceItem final: public jsg::Object { | |||
kj::Maybe<kj::String> dispatchNamespace; | |||
jsg::Optional<kj::Array<kj::String>> scriptTags; | |||
kj::String outcome; | |||
kj::Maybe<kj::String> scriptVersion; |
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.
could you add a comment a two about Maybe
here? What does it mean? Not every script has a version? It is empty first and changed later?
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 means not every script necessarily has a version. The same question could be asked of all the other Maybe
fields here, so I think we should either add similar comments for all optional fields or none?
@@ -39,6 +39,7 @@ struct Trace @0x8e8d911203762d34 { | |||
|
|||
outcome @2 :EventOutcome; | |||
scriptName @4 :Text; | |||
scriptVersion @19 :Text; |
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.
Should this be scriptVersionId
to be most specific?
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.
Yeah, agree.
- Update to
scriptVersionId
6c1162f
to
ec08613
Compare
@@ -71,6 +71,11 @@ class TraceItem final: public jsg::Object { | |||
kj::ArrayPtr<jsg::Ref<TraceException>> getExceptions(); | |||
kj::ArrayPtr<jsg::Ref<TraceDiagnosticChannelEvent>> getDiagnosticChannelEvents(); | |||
kj::Maybe<kj::StringPtr> getScriptName(); | |||
// TODO(someday): we expose this as jsg::Optional for now, since that ensures that the property will |
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.
@jasnell I've gone for this approach to "hide" the scriptVersionId
property for now when it's not explicitly set. I did briefly consider making it a *_PROTOTYPE_PROPERTY
instead to further "hide" it as they don't show up when calling Object.keys()
but that seems like it would be weirdly inconsistent with the other properties here. LMK what you think.
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 fine I think.
ec08613
to
b7e14e6
Compare
Last push was rebase only. |
No description provided.