Skip to content

Commit eeda733

Browse files
authored
Merge pull request #27 from zetroot/feature/big-statusmap
Added new metric +semver: feature
2 parents fffaade + 0a52bf1 commit eeda733

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/NTorSpectator.Observer/Services/SpectatorJob.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ public class SpectatorJob : IJob
1818
Buckets = Histogram.LinearBuckets(0.5, 0.5, 20)
1919
});
2020
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");
2122

2223
private readonly ILogger<SpectatorJob> _logger;
2324
private readonly ISitesCatalogue _sitesCatalogue;
@@ -64,6 +65,7 @@ public async Task Execute(IJobExecutionContext context)
6465
}
6566
_logger.LogDebug("Site seems to be up");
6667
await _siteObserver.AddNewObservation(queuedSite.Site.SiteUri, observations.IsOk);
68+
SiteStatus.WithLabels(queuedSite.Site.SiteUri).Set(observations.IsOk ? 1 : 0);
6769
_logger.LogInformation("Site observed");
6870
}
6971
catch (Exception e)

0 commit comments

Comments
 (0)