@@ -721,15 +721,19 @@ func TestFleetConfigManager_OnReadyHook_InitializesBridgeOnFirstCall(t *testing.
721721 pub := otlpbridge .NewCMAdapterPublisher (cm )
722722 fleetManager .otlpBridge .SetPublisher (pub )
723723 fleetManager .otlpBridge .SetIngestTopic (topics .Ingest )
724- fleetManager .logger .Info ("OTLP bridge bound to Fleet MQTT" , slog .String ("topic" , topics .Ingest ))
724+ fleetManager .otlpBridge .SetTelemetryTopic (topics .Telemetry )
725+ fleetManager .logger .Info ("OTLP bridge bound to Fleet MQTT" ,
726+ slog .String ("ingest_topic" , topics .Ingest ),
727+ slog .String ("telemetry_topic" , topics .Telemetry ))
725728 }
726729
727730 // Register the hook
728731 fleetManager .connection .AddOnReadyHook (hookFunc )
729732
730733 // Simulate first connection ready event
731734 topics := fleet.TokenResponseTopics {
732- Ingest : "test/otlp/topic" ,
735+ Ingest : "test/otlp/topic" ,
736+ Telemetry : "test/telemetry/topic" ,
733737 }
734738
735739 // Call the hook manually (simulating first connection)
@@ -738,6 +742,7 @@ func TestFleetConfigManager_OnReadyHook_InitializesBridgeOnFirstCall(t *testing.
738742 // Verify bridge was initialized
739743 require .NotNil (t , fleetManager .otlpBridge , "bridge should be initialized after first hook call" )
740744 assert .Equal (t , "test/otlp/topic" , fleetManager .otlpBridge .GetIngestTopic (), "bridge should have correct ingest topic" )
745+ assert .Equal (t , "test/telemetry/topic" , fleetManager .otlpBridge .GetTelemetryTopic (), "bridge should have correct telemetry topic" )
741746
742747 // Cleanup
743748 if fleetManager .otlpBridge != nil {
@@ -791,15 +796,19 @@ func TestFleetConfigManager_OnReadyHook_SkipsInitializationOnReconnect(t *testin
791796 pub := otlpbridge .NewCMAdapterPublisher (cm )
792797 fleetManager .otlpBridge .SetPublisher (pub )
793798 fleetManager .otlpBridge .SetIngestTopic (topics .Ingest )
794- fleetManager .logger .Info ("OTLP bridge bound to Fleet MQTT" , slog .String ("topic" , topics .Ingest ))
799+ fleetManager .otlpBridge .SetTelemetryTopic (topics .Telemetry )
800+ fleetManager .logger .Info ("OTLP bridge bound to Fleet MQTT" ,
801+ slog .String ("ingest_topic" , topics .Ingest ),
802+ slog .String ("telemetry_topic" , topics .Telemetry ))
795803 }
796804
797805 // Register the hook
798806 fleetManager .connection .AddOnReadyHook (hookFunc )
799807
800808 // Simulate reconnection ready event
801809 topics := fleet.TokenResponseTopics {
802- Ingest : "test/otlp/topic/reconnect" ,
810+ Ingest : "test/otlp/topic/reconnect" ,
811+ Telemetry : "test/telemetry/topic/reconnect" ,
803812 }
804813
805814 // Call the hook manually (simulating reconnection)
@@ -808,6 +817,7 @@ func TestFleetConfigManager_OnReadyHook_SkipsInitializationOnReconnect(t *testin
808817 // Verify bridge was NOT recreated (same instance)
809818 assert .Equal (t , originalBridge , fleetManager .otlpBridge , "bridge should not be recreated on reconnect" )
810819 assert .Equal (t , "test/otlp/topic/reconnect" , fleetManager .otlpBridge .GetIngestTopic (), "bridge should have updated ingest topic" )
820+ assert .Equal (t , "test/telemetry/topic/reconnect" , fleetManager .otlpBridge .GetTelemetryTopic (), "bridge should have updated telemetry topic" )
811821
812822 // Cleanup
813823 if fleetManager .otlpBridge != nil {
0 commit comments