Project: HertzBeat (Observability and Analysis / Observability)
File: sqlserver.md

id: sqlserver title: MonitoringSqlServer database monitoring sidebar_label: SqlServer database keywords: [open source monitoring tool, open source database monitoring tool, monitoring sqlserver database metrics] Collect and monitor the general performance Metrics of SqlServer database. Support SqlServer 2017+. | Parameter name | Parameter help description | | -- | -- | | Monitoring Host | Monitored IPV4, IPV6 or domain name. NoteWithout protocol header (eg: https://, http://) | | Monitoring name | Identify the name of this monitoring. The name needs to be unique | | Port | Port provided by the database. The default is 1433 | | Query timeout | Set the timeout time when SQL query does not respond to data, unit: ms, default: 3000ms | | Database name | Database instance name, optional | | Username | Database connection user name, optional | | Password | Database connection password, optional | | URL | Database connection URLoptionalIf configured, the database name, user name, password and other parameters in the URL will overwrite the above configured parameters | | Collection interval | Interval time of monitor periodic data collection, unit: second, and the minimum interval that can be set is 30 seconds | | Whether to detect | Whether to detect and check the availability of monitoring before adding monitoring. Adding and modifying operations will continue only after the detection is successful | | Description remarks | For more information about identifying and describing this monitoring, users can note information here | | Metric name | Metric unit | Metric help description | | -- | -- | -- | | machine_name | none | Windows computer name running the server instance | | server_name | none | Server and instance information SQL Server associated with Windows instance | | version | none | Version of the instanceSQL Serverformat is

| | edition | none | The product SQL server version of the installed instance | | start_time | none | Database start time | | Metric name | Metric unit | Metric help description | | -- | -- | -- | | database_pages | none | Database pages, Number of pages obtained (buffer pool) | | target_pages | none | Target pages, The desired number of pages that the buffer pool must have | | pagelifeexpectancy | s | Page life expectancy. The time that data pages stay in the buffer pool. This time is generally greater than 300 | | buffercachehit_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 | | checkpointpagessec | none | Checkpoint 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 | | pagereadssec | none | Page reads/sec, Number of pages read per second in the cache pool | | pagewritessec | none | Page writes/sec, Number of pages written per second in the cache pool | | Metric name | Metric unit | Metric help description | | -- | -- | -- | | user_connection | none | Number of connected sessions | 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: ```text 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: 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: