$ show marcingminski/sqlwatch
SQLWATCH is a SQL Server performance monitoring solution designed for self-monitoring of database instances. The system collects performance metrics, wait statistics, disk utilization, index usage, and query performance data through Extended Events, DMVs, and performance counters, storing the data in a structured SQL Server schema. It features a dual-component architecture: a monitoring agent deployed on each target SQL Server instance (using SQL Agent jobs or Service Broker for scheduling) and an optional central repository importer (SqlWatchImport) for aggregating data from multiple instances. The solution includes alerting via threshold-based checks, automated actions, and integrates with Power BI and Grafana for visualization. Although the code demonstrates solid engineering patterns like snapshot-based collection, delta calculations, and metadata-driven configuration, the README explicitly states the open-source version is no longer actively developed, with active development moved to sqlwatch.cloud.
The LLM identified 2 files worth highlighting for reuse:
Provides a reusable pattern for collecting and processing Extended Events data in SQL Server. Standardizes the workflow of inserting snapshot headers, fetching raw XE data, parsing XML event data via dedicated functions, and inserting processed data into logger tables. Used by multiple collectors (waits, long queries, blockers, etc.) demonstrating consistent, efficient handling of XE data with minimal coupling to specific event types.
C# console application enabling robust centralization of monitoring data from multiple SQL Server instances. Implements dependency-aware table ordering using sqlwatch_stage_repository_tables_to_import, differentiates full/delta loads via snapshot times, performs merge operations with identity management, and includes error handling for foreign key violations with fallback to full load. Solves the complex problem of consolidating heterogeneous monitoring data with varying collection schedules while ensuring data consistency and referential integrity.