11use chrono:: { DateTime , Utc } ;
22use snafu:: { ResultExt , Snafu } ;
33use stackable_shared:: time:: Duration ;
4+ use tracing:: { Level , instrument} ;
45
56/// Available options to configure a [`EndOfSupportChecker`].
67///
@@ -103,6 +104,10 @@ impl EndOfSupportChecker {
103104 // TODO: Add way to stop from the outside
104105 // The first tick ticks immediately.
105106 interval. tick ( ) . await ;
107+ tracing:: info_span!(
108+ "checking end-of-support state" ,
109+ eos. interval = self . interval. to_string( ) ,
110+ ) ;
106111
107112 // Continue the loop and wait for the next tick to run the check again.
108113 if !self . is_eos ( ) {
@@ -114,6 +119,7 @@ impl EndOfSupportChecker {
114119 }
115120
116121 /// Emits the end-of-support warning.
122+ #[ instrument( level = Level :: DEBUG , skip( self ) ) ]
117123 fn emit_warning ( & self ) {
118124 tracing:: warn!(
119125 eos. date = self . datetime. to_rfc3339( ) ,
@@ -123,8 +129,12 @@ impl EndOfSupportChecker {
123129
124130 /// Returns if the operator is considered as end-of-support based on the built-time and the
125131 /// support duration.
132+ #[ instrument( level = Level :: DEBUG , skip( self ) , fields( eos. now) ) ]
126133 fn is_eos ( & self ) -> bool {
127134 let now = Utc :: now ( ) ;
135+
136+ tracing:: Span :: current ( ) . record ( "eos.now" , now. to_rfc3339 ( ) ) ;
137+
128138 now > self . datetime
129139 }
130140}
0 commit comments