@@ -75,6 +75,9 @@ def __init__(self, config: Config):
7575
7676 # Update processor created in start(), because it needs the ready Event
7777 self ._update_processor : Optional [UpdateProcessor ] = None
78+
79+ # Diagnostic accumulator provided by client for streaming metrics
80+ self ._diagnostic_accumulator = None
7881
7982 # Track current data availability
8083 self ._data_availability : DataAvailability = (
@@ -118,6 +121,13 @@ def set_flag_value_eval_fn(self, eval_fn):
118121 (key: str, context: Context) -> Any.
119122 """
120123 self ._flag_tracker_impl = FlagTrackerImpl (self ._flag_change_listeners , eval_fn )
124+
125+ def set_diagnostic_accumulator (self , diagnostic_accumulator ):
126+ """
127+ Sets the diagnostic accumulator for streaming initialization metrics.
128+ This should be called before start() to ensure metrics are collected.
129+ """
130+ self ._diagnostic_accumulator = diagnostic_accumulator
121131
122132 @property
123133 def data_source_status_provider (self ) -> DataSourceStatusProvider :
@@ -151,8 +161,7 @@ def _make_update_processor(self, config: Config, store: FeatureStore, ready: Eve
151161 return NullUpdateProcessor (config , store , ready )
152162
153163 if config .stream :
154- # Diagnostic accumulator is handled in client; pass None here
155- return StreamingUpdateProcessor (config , store , ready , None )
164+ return StreamingUpdateProcessor (config , store , ready , self ._diagnostic_accumulator )
156165
157166 # Polling mode
158167 feature_requester = (
0 commit comments