File tree Expand file tree Collapse file tree 1 file changed +2
-0
lines changed
src/NTorSpectator.Observer/Services Expand file tree Collapse file tree 1 file changed +2
-0
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ public class SpectatorJob : IJob
18
18
Buckets = Histogram . LinearBuckets ( 0.5 , 0.5 , 20 )
19
19
} ) ;
20
20
private static readonly Gauge TotalSessionDuration = Metrics . CreateGauge ( "observation_session_duration" , "Total observation session duration, ms" ) ;
21
+ private static readonly Gauge SiteStatus = Metrics . CreateGauge ( "site_aliveness" , "Reports site aliveness status" , "site" ) ;
21
22
22
23
private readonly ILogger < SpectatorJob > _logger ;
23
24
private readonly ISitesCatalogue _sitesCatalogue ;
@@ -64,6 +65,7 @@ public async Task Execute(IJobExecutionContext context)
64
65
}
65
66
_logger . LogDebug ( "Site seems to be up" ) ;
66
67
await _siteObserver . AddNewObservation ( queuedSite . Site . SiteUri , observations . IsOk ) ;
68
+ SiteStatus . WithLabels ( queuedSite . Site . SiteUri ) . Set ( observations . IsOk ? 1 : 0 ) ;
67
69
_logger . LogInformation ( "Site observed" ) ;
68
70
}
69
71
catch ( Exception e )
You can’t perform that action at this time.
0 commit comments