Report database query stats as tags

This commit is contained in:
Ske 2019-08-12 02:33:56 +02:00
parent f5c5291877
commit 213db91ade

View File

@ -620,7 +620,8 @@ namespace PluralKit
_logger.Debug("Executed query {Query} in {ElapsedTime}", _commandText, _stopwatch.Elapsed); _logger.Debug("Executed query {Query} in {ElapsedTime}", _commandText, _stopwatch.Elapsed);
// One tick is 100 nanoseconds // One tick is 100 nanoseconds
_metrics.Provider.Timer.Instance(CoreMetrics.DatabaseQuery).Record(_stopwatch.ElapsedTicks / 10, TimeUnit.Microseconds, _commandText); _metrics.Provider.Timer.Instance(CoreMetrics.DatabaseQuery, new MetricTags("query", _commandText))
.Record(_stopwatch.ElapsedTicks / 10, TimeUnit.Microseconds, _commandText);
} }
} }