feat: also report database connection count by cluster in scheduled tasks worker

This commit is contained in:
spiral 2022-03-23 20:28:56 -04:00
parent d097436f3e
commit 81cc1465cd
No known key found for this signature in database
GPG Key ID: 244A11E4B0BCF40E

View File

@ -94,6 +94,13 @@ public class TaskHandler
// this is pretty much always inaccurate but oh well
_metrics.Measure.Gauge.SetValue(CoreMetrics.DatabaseConnections, stats.Sum(x => x.DatabaseConnectionCount));
foreach (var stat in redisStats)
_metrics.Measure.Gauge.SetValue(
CoreMetrics.DatabaseConnectionsByCluster,
new MetricTags("cluster_id", stat.Name),
JsonConvert.DeserializeObject<ClusterMetricInfo>(stat.Value).DatabaseConnectionCount
);
// Other shiz
_metrics.Measure.Gauge.SetValue(Metrics.WebhookCacheSize, stats.Sum(x => x.WebhookCacheSize));