Skip to main content

Monitoring:SqlServer database monitoring

Collect and monitor the general performance Metrics of SqlServer database. Support SqlServer 2017+.

Configuration parameter

Parameter nameParameter help description
Monitoring HostMonitored IPV4, IPV6 or domain name. Note⚠️Without protocol header (eg: https://, http://)
Monitoring nameIdentify the name of this monitoring. The name needs to be unique
PortPort provided by the database. The default is 1433
Query timeoutSet the timeout time when SQL query does not respond to data, unit: ms, default: 3000ms
Database nameDatabase instance name, optional
UsernameDatabase connection user name, optional
PasswordDatabase connection password, optional
URLDatabase connection URL,optional,If configured, the database name, user name, password and other parameters in the URL will overwrite the above configured parameters
Collection intervalInterval time of monitor periodic data collection, unit: second, and the minimum interval that can be set is 30 seconds
Whether to detectWhether to detect and check the availability of monitoring before adding monitoring. Adding and modifying operations will continue only after the detection is successful
Description remarksFor more information about identifying and describing this monitoring, users can note information here

Collection Metric

Metric set:basic

Metric nameMetric unitMetric help description
machine_namenoneWindows computer name running the server instance
server_namenoneServer and instance information SQL Server associated with Windows instance
versionnoneVersion of the instance,SQL Server,format is "major.minor.build.revision"
editionnoneThe product SQL server version of the installed instance
start_timenoneDatabase start time

Metric set:performance_counters

Metric nameMetric unitMetric help description
database_pagesnoneDatabase pages, Number of pages obtained (buffer pool)
target_pagesnoneTarget pages, The desired number of pages that the buffer pool must have
page_life_expectancysPage life expectancy. The time that data pages stay in the buffer pool. This time is generally greater than 300
buffer_cache_hit_ratio%Buffer cache hit ratio, Database buffer pool cache hit rate. The probability that the requested data is found in the buffer pool is generally greater than 80%, otherwise the buffer pool capacity may be too small
checkpoint_pages_secnoneCheckpoint pages/sec, The number of dirty pages written to the disk by the checkpoint per second. If the data is too high, it indicates that there is a lack of memory capacity
page_reads_secnonePage reads/sec, Number of pages read per second in the cache pool
page_writes_secnonePage writes/sec, Number of pages written per second in the cache pool

Metric set:connection

Metric nameMetric unitMetric help description
user_connectionnoneNumber of connected sessions

Common Problem

  1. SSL connection problem fixed

jdk version: jdk11
Description of the problem: SQL Server 2019 uses the SA user connection to report an error
Error message:

The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption. Error: "PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target". ClientConnectionId:xxxxxxxxxxxxxxxxxxxx

Screenshot of the problem:
issue

solution:
Use advanced settings when adding SqlServer monitoring, customize JDBC URL, add parameter configuration after the spliced jdbc url, ;encrypt=true;trustServerCertificate=true;This parameter true means unconditionally trust the server returned any root certificate.

Example: jdbc:sqlserver://127.0.0.1:1433;DatabaseName=demo;encrypt=true;trustServerCertificate=true;

Reference document: [microsoft pkix-path-building-failed-unable-to-find-valid-certification](https://techcommunity.microsoft.com/t5/azure-database-support-blog/pkix-path-building- failed-unable-to-find-valid-certification/ba-p/2591304)