# Agents y modules generated by the plugin The plugin will create one agent for each target database. **Instance metrics**
server_startup
Monitors the uptime (in days) of the database server
locks_used
Monitors percentage of used lock and lock owner blocks
workspace_memory
Monitors amount of memory that is used for executing processes such as hash, sort, bulk copy, and index creation operations
average_waittime
SQL Server Average Lock Wait Time
Each agent will contain the following modules if "**engine\_uptime**" is activated:
restart\_detectionIt will be 0 if an unexpected restart is detected, and 1 if this is not the case. When a server restarts unexpectedly, there can be a disruption in database access, and potentially, transactions or data may not be saved correctly, leading to data integrity issues.
If "**query\_stats**" is activated, each agent will contain the following modules:
queries**The total number of queries**. Monitoring queries is essential for understanding the workload running on the server and assessing the overall system performance. By monitoring the total number of queries, you can identify activity spikes, optimize performance, and detect potential issues such as inefficient or excessive queries.
update**The number of UPDATE queries**. UPDATE queries are used to modify existing data in the database. Monitoring UPDATE queries is important to assess the frequency and efficiency of data updates. You can identify UPDATE queries that affect a large number of rows or have a significant impact on server performance. This allows you to optimize queries, review table structures, or take measures to reduce the load generated by updates.
delete**The number of DELETE queries**. DELETE queries are used to remove data from the database. Monitoring DELETE queries is useful to assess the frequency and efficiency of data deletions. You can identify DELETE queries that affect a large number of rows or have a significant impact on server performance. This allows you to optimize queries, review table structures, or take measures to reduce the load generated by deletions.
insert**The number of INSERT queries.** INSERT queries are used to add new data to the database. Monitoring INSERT queries allows you to assess the frequency and efficiency of data insertions. You can identify INSERT queries that are generating a high load on the server or may be causing performance issues. This enables you to optimize queries, review table structures, or consider strategies like deferred insertion to enhance performance in high-concurrency environments.
If "**analyze\_connections**" is activated, each agent will contain the following modules:
session usage**The number of current connections relative to the total maximum connections**. Monitoring session usage in SQL Server is important for optimizing performance, identifying locking issues, enhancing security and auditing, and efficiently planning server resources.
If "**retrieve\_memory\_statistics"** is activated, each agent will contain the following modules :
lock_memory
Monitors amount of allocated lock memory in Bytes
connection_memory
Monitors amount of connection memory in Bytes
optimizer_memory
Monitors amount of optimizer memory in Bytes
sqlcache_memory
Monitors amount of SQL cache memory in Bytes
total_memory
Monitors total amount of dynamic server memory in Bytes
Si esta activado **retrieve\_locks\_statistics:**
retrieve_locks_statistics
Monitors the number of deadlocks per second
lock_timeouts
Monitor the number of lock-timeouts per second
lock_requests
Monitor the number of lock-requests per second
lock_waits
Monitor the number of lock-waits per second
Si esta activado **retrieve\_buffer\_statistics:**
buf_cachehit_ratio
Percentage of pages found in the buffer cache without having to read from the disk
free_connections
Monitors % free connections to SQL Server instance
page_reads
Monitors the number of database page reads per second
page_writes
Monitors the number of database page writes per second
Si esta activado **monitor\_latch\_requests:**
latch_waits
Monitors the number of latch requests per second
Si esta activado **monitor\_full\_scans:**
full_scans
Monitors the number of full scans (table or index) per second
Si esta activado **check\_engine\_performance:**
server_cpu
Monitors % of CPU usage by SQL Server instance
io_busy
Monitors % of I/O busy for SQL Server instance
server_io
Monitors % of I/O busy for SQL Server instance
Si esta activado **retrieve\_users\_information:**
active_connection_ratio
Monitors ratio of active connections to total allowed connections
locked_users
Monitors the number of users suspended by locks
blocked_users
Monitors the number of users suspended by locks
active_users
Monitors the number of users currently logged onto the server
Si esta activado **monitor\_long\_queries:**
long_queries
Monitors long running queries (in seconds)
long_queries_string
Complete output of long running queries
Si esta activado **retrieve\_cluster\_state:**
aag_cluster_quorum_state
State: < desc >. Monitors AlwaysOn WSFC quorum State.
aag_cluster_members_state
State: < desc >. Monitors AlwaysOn WSFC nodes state
aag_synchronization_health
State: <desc >. Monitors the synchronization health of an availability group
aag_replica_synchronization_health
State: < desc >. Role: < role > . Monitors the synchronization health of an availability replica
aag_replica_connected_state
State: < desc >. Role: < rol > .Monitors connected state of an availability replica
aag_replica_recovery_health
State: < desc >. Role: < rol> . Monitors the recovery health of an availability replica
aag_replica_operational_state
State: < state >. Role: < rol >. Monitors the Current operational state of the availability replica
aag_db_replica_synchronization_state
State: < desc >. Monitors the synchronization state of databases on availability replica
aag_listener_state
State: < desc >. Role: < rol >. Monitor the AlwaysOn availability Group Listener state
**Database metrics** If monitor\_active\_users is enabled :
active users
Monitors the number of active user transactions per database
If retrieve\_transactions\_statistics is enabled:
transactions
Monitors the number of transactions per second
active transactions
Active Transactions
If retrieve\_logs\_statistics is enabled:
log\_flush\_waits
Monitors the number of log flush waits per second
log\_file\_growths
Monitors the usage (growth) of the transaction logs
log\_file\_shrinks
Monitors the usage (shrinking) of the transaction logs
logfile\_size
Monitors logfile size
logfile\_usage
Monitors free space in log files
If monitor\_backups is enabled:
backup\_status\_minutes
Monitors number of minutes since last backup
backup\_status\_last\_backup
Monitors when last backup was done
If monitor\_filegroups\_space is enabled:
fg\_free\_space
Monitors free space in filegroups
If monitor\_user\_reserved\_space is enabled:
Monitors reserved space in user tables
Monitors reserved space in user tables
Monitors reserved space free data % in user tables
Monitors reserved space free data % in user tables
The plugin will also create one module for each custom query defined in the configuration file.