Add monitoring on queries with sentry alert + Fix check position list in db for backtest
This commit is contained in:
@@ -0,0 +1,77 @@
|
||||
namespace Managing.Infrastructure.Databases.PostgreSql;
|
||||
|
||||
/// <summary>
|
||||
/// Configuration settings for SQL query monitoring and loop detection
|
||||
/// </summary>
|
||||
public class SqlMonitoringSettings
|
||||
{
|
||||
/// <summary>
|
||||
/// Whether SQL monitoring is enabled globally (default: true)
|
||||
/// </summary>
|
||||
public bool Enabled { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// Whether SQL query logging is enabled (default: true)
|
||||
/// </summary>
|
||||
public bool LoggingEnabled { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// Whether Sentry integration is enabled (default: true)
|
||||
/// </summary>
|
||||
public bool SentryEnabled { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// Whether loop detection is enabled (default: true)
|
||||
/// </summary>
|
||||
public bool LoopDetectionEnabled { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// Whether performance monitoring is enabled (default: true)
|
||||
/// </summary>
|
||||
public bool PerformanceMonitoringEnabled { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// Time window for loop detection in seconds (default: 60)
|
||||
/// </summary>
|
||||
public int LoopDetectionWindowSeconds { get; set; } = 60;
|
||||
|
||||
/// <summary>
|
||||
/// Maximum query executions per window for loop detection (default: 100)
|
||||
/// </summary>
|
||||
public int MaxQueryExecutionsPerWindow { get; set; } = 100;
|
||||
|
||||
/// <summary>
|
||||
/// Maximum method executions per window for loop detection (default: 50)
|
||||
/// </summary>
|
||||
public int MaxMethodExecutionsPerWindow { get; set; } = 50;
|
||||
|
||||
/// <summary>
|
||||
/// Threshold for long-running queries in milliseconds (default: 1000)
|
||||
/// </summary>
|
||||
public int LongRunningQueryThresholdMs { get; set; } = 1000;
|
||||
|
||||
/// <summary>
|
||||
/// Threshold for Sentry alerts (default: 5)
|
||||
/// </summary>
|
||||
public int SentryAlertThreshold { get; set; } = 5;
|
||||
|
||||
/// <summary>
|
||||
/// Threshold for slow queries in milliseconds (default: 2000)
|
||||
/// </summary>
|
||||
public int SlowQueryThresholdMs { get; set; } = 2000;
|
||||
|
||||
/// <summary>
|
||||
/// Whether to log only slow queries (reduces overhead) (default: false)
|
||||
/// </summary>
|
||||
public bool LogSlowQueriesOnly { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// Whether to log only errors (minimal overhead) (default: false)
|
||||
/// </summary>
|
||||
public bool LogErrorsOnly { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// Data retention period in minutes for monitoring dashboard (default: 30)
|
||||
/// </summary>
|
||||
public int DataRetentionMinutes { get; set; } = 30;
|
||||
}
|
||||
Reference in New Issue
Block a user