-
Notifications
You must be signed in to change notification settings - Fork 38
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!: add evaluation details to finally hook #280
Conversation
Signed-off-by: Michael Beemer <beeme1mr@users.noreply.github.com>
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.
I really like the change, I am just wondering if we should make this a breaking change.
Maybe we could avoid it as stated in the comment.
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.
Signed-off-by: Michael Beemer <michael.beemer@dynatrace.com>
I'm going to merge on Friday unless there's an objection. Thanks! |
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.
Approving, and for the record, I think we should generally implement this in SDKs as a breaking change without incrementing the major version, using the leeway this policy gives us. I really don't think many will be impacted, and I think it's an easy and clear fix for those few who are.
## This PR - adds evaluation details to the `finally` stage in hooks. ### Notes This breaks the signature of the `finally` stages based on [this spec enhancement](open-feature/spec#280). It is **not** considered a breaking change to the SDK because hooks are marked as experimental in the spec, and the change has no impact on known hooks. The noteworthy change to the interface is: ```diff - finally?(hookContext: Readonly<HookContext<T>>, hookHints?: HookHints): HooksReturn; + finally?(hookContext: Readonly<HookContext<T>>, evaluationDetails: EvaluationDetails<T>, hookHints?: HookHints): HooksReturn; ``` ### Follow-up Tasks - Update the JS contribs repo --------- Signed-off-by: Michael Beemer <beeme1mr@users.noreply.github.com>
## This PR - adds evaluation details to the `finally` stage in hooks. ### Notes This breaks the signature of the `finally` stages based on [this spec enhancement](open-feature/spec#280). It is **not** considered a breaking change to the SDK because hooks are marked as experimental in the spec, and the change has no impact on known hooks. The noteworthy change to the interface is: ```diff - finally?(hookContext: Readonly<HookContext<T>>, hookHints?: HookHints): HooksReturn; + finally?(hookContext: Readonly<HookContext<T>>, evaluationDetails: EvaluationDetails<T>, hookHints?: HookHints): HooksReturn; ``` ### Follow-up Tasks - Update the JS contribs repo --------- Signed-off-by: Michael Beemer <beeme1mr@users.noreply.github.com>
This PR
finally
stage in hooks to include evaluation details.Related Issues
#281
Notes
This is a breaking change but will significantly enhance the usefulness of the
finally
stage. Currently, thefinally
stage is used to perform end-of-transaction or clean-up tasks. If this proposal is accepted, thefinally
stage will have access to the same evaluation details that are returned to the application author.This change will make implementing the OpenTelemetry Feature Flag Semantic Convention changes easier because the evaluation details in the
finally
stage can contain all the telemetry we'll need. Values likeflag set id
andflag set version
can be supplied via flag metadata, which isn't accessible in theerror
or currentfinally
stages.Here's a draft PR showing how this could be implemented in JavaScript.
Follow-up Tasks
Implement the changes in all SDKs.