storagenode/nodestats: add monkit metrics for reputation scores

Closes https://github.com/storj/storj/issues/4835

Change-Id: Ib56e34145b962bede3525066f9bd7ef950d21e9b
This commit is contained in:
Clement Sam 2022-09-13 13:29:41 +00:00 committed by Clement Sam
parent 507b099d44
commit a848c29b9b

View File

@ -76,6 +76,14 @@ func (s *Service) GetReputationStats(ctx context.Context, satelliteID storj.Node
audit := resp.GetAuditCheck() audit := resp.GetAuditCheck()
satelliteIDSeriesTag := monkit.NewSeriesTag("satellite_id", satelliteID.String())
mon.IntVal("audit_success_count", satelliteIDSeriesTag).Observe(audit.GetSuccessCount())
mon.IntVal("audit_total_count", satelliteIDSeriesTag).Observe(audit.GetTotalCount())
mon.FloatVal("audit_reputation_score", satelliteIDSeriesTag).Observe(audit.GetReputationScore())
mon.FloatVal("suspension_score", satelliteIDSeriesTag).Observe(audit.GetUnknownReputationScore())
mon.FloatVal("online_score", satelliteIDSeriesTag).Observe(resp.GetOnlineScore())
return &reputation.Stats{ return &reputation.Stats{
SatelliteID: satelliteID, SatelliteID: satelliteID,
Audit: reputation.Metric{ Audit: reputation.Metric{