mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 04:56:49 +00:00
fix: don't write raw sql queries to influxdb metrics
This commit is contained in:
parent
2745ee6156
commit
12323f3662
2 changed files with 5 additions and 3 deletions
|
|
@ -87,6 +87,7 @@ internal partial class Database: IDatabase
|
||||||
NpgsqlConnection.GlobalTypeMapper.MapEnum<PrivacyLevel>("privacy_level");
|
NpgsqlConnection.GlobalTypeMapper.MapEnum<PrivacyLevel>("privacy_level");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: make sure every SQL query is behind a logged query method
|
||||||
public async Task<IPKConnection> Obtain()
|
public async Task<IPKConnection> Obtain()
|
||||||
{
|
{
|
||||||
// Mark the request (for a handle, I guess) in the metrics
|
// Mark the request (for a handle, I guess) in the metrics
|
||||||
|
|
|
||||||
|
|
@ -124,9 +124,10 @@ internal class PKCommand: DbCommand, IPKCommand
|
||||||
elapsed, _ourConnection.ConnectionId);
|
elapsed, _ourConnection.ConnectionId);
|
||||||
|
|
||||||
// One "BCL compatible tick" is 100 nanoseconds
|
// One "BCL compatible tick" is 100 nanoseconds
|
||||||
var micros = elapsed.BclCompatibleTicks / 10;
|
|
||||||
_metrics.Provider.Timer.Instance(CoreMetrics.DatabaseQuery, new MetricTags("query", CommandText))
|
// var micros = elapsed.BclCompatibleTicks / 10;
|
||||||
.Record(micros, TimeUnit.Microseconds, CommandText);
|
// _metrics.Provider.Timer.Instance(CoreMetrics.DatabaseQuery, new MetricTags("query", CommandText))
|
||||||
|
// .Record(micros, TimeUnit.Microseconds, CommandText);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue