1
1
use chrono:: { DateTime , Utc } ;
2
2
use snafu:: { ResultExt , Snafu } ;
3
3
use stackable_shared:: time:: Duration ;
4
+ use tracing:: { Level , instrument} ;
4
5
5
6
/// Available options to configure a [`EndOfSupportChecker`].
6
7
///
@@ -103,6 +104,10 @@ impl EndOfSupportChecker {
103
104
// TODO: Add way to stop from the outside
104
105
// The first tick ticks immediately.
105
106
interval. tick ( ) . await ;
107
+ tracing:: info_span!(
108
+ "checking end-of-support state" ,
109
+ eos. interval = self . interval. to_string( ) ,
110
+ ) ;
106
111
107
112
// Continue the loop and wait for the next tick to run the check again.
108
113
if !self . is_eos ( ) {
@@ -114,6 +119,7 @@ impl EndOfSupportChecker {
114
119
}
115
120
116
121
/// Emits the end-of-support warning.
122
+ #[ instrument( level = Level :: DEBUG , skip( self ) ) ]
117
123
fn emit_warning ( & self ) {
118
124
tracing:: warn!(
119
125
eos. date = self . datetime. to_rfc3339( ) ,
@@ -123,8 +129,12 @@ impl EndOfSupportChecker {
123
129
124
130
/// Returns if the operator is considered as end-of-support based on the built-time and the
125
131
/// support duration.
132
+ #[ instrument( level = Level :: DEBUG , skip( self ) , fields( eos. now) ) ]
126
133
fn is_eos ( & self ) -> bool {
127
134
let now = Utc :: now ( ) ;
135
+
136
+ tracing:: Span :: current ( ) . record ( "eos.now" , now. to_rfc3339 ( ) ) ;
137
+
128
138
now > self . datetime
129
139
}
130
140
}
0 commit comments