@@ -182,22 +182,24 @@ where
182182 self . maybe_opamp_client . as_ref ( ) . inspect ( |c| {
183183 let _ = c
184184 . update_effective_config ( )
185- . inspect_err ( |e| error ! ( "Effective config update failed : {e}" ) ) ;
185+ . inspect_err ( |e| error ! ( "Failed to update effective config : {e}" ) ) ;
186186 } ) ;
187187 return None ;
188188 } ;
189189
190190 let effective_agent = self
191191 . effective_agent ( config. get_yaml_config ( ) . clone ( ) )
192- . map_err ( SupervisorCreationError :: from) ;
192+ . map_err ( SupervisorCreationError :: from)
193+ . inspect_err ( |e| error ! ( "Failed to create effective agent: {e}" ) ) ;
193194
194195 let not_started_supervisor = effective_agent. and_then ( |effective_agent| {
195196 self . supervisor_builder
196197 . build_supervisor ( effective_agent)
197198 . map_err ( SupervisorCreationError :: from)
199+ . inspect_err ( |e| error ! ( "Failed to create supervisor: {e}" ) )
198200 } ) ;
199201
200- if not_started_supervisor. is_ok ( ) {
202+ let started_supervisor = not_started_supervisor. and_then ( |stopped_supervisor| {
201203 // Communicate the config that we will be using
202204 // FIXME: only if we successfully build a supervisor?
203205 // What if we fail and we don't have a supervisor? Should we report?
@@ -210,13 +212,12 @@ where
210212 self . maybe_opamp_client . as_ref ( ) . inspect ( |c| {
211213 let _ = c
212214 . update_effective_config ( )
213- . inspect_err ( |e| error ! ( "Effective config update failed : {e}" ) ) ;
215+ . inspect_err ( |e| error ! ( "Failed to update effective config : {e}" ) ) ;
214216 } ) ;
215- }
216217
217- let started_supervisor = not_started_supervisor. and_then ( |stopped_supervisor| {
218218 self . start_supervisor ( stopped_supervisor)
219219 . map_err ( SupervisorCreationError :: from)
220+ . inspect_err ( |e| error ! ( "Failed to start supervisor: {e}" ) )
220221 } ) ;
221222
222223 // After all operations, set the hash to a final state
@@ -253,6 +254,12 @@ where
253254
254255 let mut supervisor = self . init_supervisor ( ) ;
255256
257+ if supervisor. is_none ( ) {
258+ debug ! (
259+ "No supervisor found, but the runtime will continue to run waiting for remote configs"
260+ ) ;
261+ }
262+
256263 // Stores the current health state for logging purposes.
257264 let mut previous_health = None ;
258265
0 commit comments