Uh oh!
There was an error while loading. Please reload this page.
feat: Propagate environment ID to evaluation hooks - #484
Draft
kinyoklion wants to merge 1 commit into
Draft
Conversation
Co-Authored-By: rlamb@launchdarkly.com <4955475+kinyoklion@users.noreply.github.com>
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requirements
Related issues
Implements the
environmentIdfield ofEvaluationSeriesContextfrom the hooks spec, which the OTel tracing hook uses forfeature_flag.set.id. Mirrors launchdarkly/dotnet-core#81.Describe the solution you've provided
EvaluationSeriesContextgains an optionalenvironment_id, populated from theX-LD-EnvIDresponse header sent by LaunchDarkly. Both data systems are supported, and each exposes it through a newDataSystem.environment_idproperty that the client reads when building the series context:Basis.environment_id/Update.environment_idbut discarded it;FDv2now latches the last non-Nonevalue (including from initializer error headers).Start/Faultactions of the SSE client, polling reads it from the response headers, and both record it onDataSourceUpdateSinkImpl.Sketch of the FDv1 path:
Describe alternatives you've considered
Following the .NET implementation more literally, where the environment ID is stored as init metadata on the data store, would require optional extension interfaces on the public
FeatureStore/DataSourceUpdateSinktypes. Instead, header handling stays inside the data sources and is surfaced by the data system, so externally implemented stores, sinks, feature requesters, and update processors continue to work unchanged (they simply report no environment ID).Additional context
launchdarkly-eventsource: it already exposes response headers onStartandFault(unlike the .NET event source, which needed feat: Report event source headers on open. dotnet-eventsource#104).environmentIdsupport in the OTel tracing hook lives inpython-server-sdk-oteland is a follow-up.Link to Devin session: https://app.devin.ai/sessions/bfe54128e2804a96bb100e6120e9a3ef
Requested by: @kinyoklion