-
Notifications
You must be signed in to change notification settings - Fork 16
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
context.Context and/or evaluation hooks #63
Comments
Hi @nelzkiddom, Thanks for the suggestion! We've actually already had internal discussions about the idea of adding evaluation hooks to our suite of SDKs. The main use case we've considered is to be able to accumulate flag metrics for observability purposes. Unfortunately we haven't yet made progress on implementing this feature in our SDKs. In the meantime, one thing you could consider doing is implementing a wrapper layer around the LaunchDarkly SDK. The wrapper would accept a context and would just decorate the LaunchDarkly SDK while also accumulating data into the context. As long as you keep the wrapper lightweight and minimal then I don't expect it to cause much extra lift to your team, but that's up to you. |
FYI, I tried my hand at a first pass, will probably serve us for now: https://github.com/nelz9999/goldhook |
Is your feature request related to a problem? Please describe.
I would like my feature flag evaluations to participate in my telemetry collection
Describe the solution you'd like
I'd like to see new
XXXVariation
andXXXVariationDetails
functions that take acontext.Context
as a first parameter.Then, also the ability to configure a hook/"observable" style function that takes the
context.Context
and theldreason.EvaluationDetail
so that I can emit this information to my telemetry system.Describe alternatives you've considered
I've thought about writing an extension of the SDK to provide context-aware extensions, but that just seems like I'd always be chasing the current implementation, and it is probably in LD's interests to provide flexible post-evaluation hooks, possibly with provided default hook implementations that work with OpenTelemetry.
The text was updated successfully, but these errors were encountered: