Monitoring Microsoft SQL Server

The Microsoft SQL Server sensor is automatically deployed and installed after you install the Instana agent.

Support information

To make sure that the Microsoft SQL Server sensor is compatible with your current setup, check the following support information sections:

Supported operating systems

The sensor supports the following operating systems:

  • Windows
  • Linux

Supported versions and support policy

The sensor supports the following versions of Microsoft SQL Server:

  • SQL Server 2016
  • SQL Server 2017
  • SQL Server 2019
  • SQL Server 2022

The following table shows the latest supported version and support policy:

Technology Support policy Latest technology version Latest supported version
Microsoft SQL Server 45 days 2025 2025

For more information about the support policy, see Support strategy for sensors.

Configuring the MS SQL Server sensor

Instana supports both local and remote monitoring for MS SQL sensor.

Note: When you configure MS SQL monitoring with Instana, ensure that both the instance name and port are correct. With the SQL Server authentication, the port number takes precedence over the instance name. As a result, even if the instance name is incorrect, a connection might still be established by using the specified port and user credentials. However, an incorrect port might leading to Instana monitoring the wrong instance.

Local

You must install the Instana host agent on the same system in which Microsoft SQL Server is installed. To install the Instana host agent on Windows, see the Installing the host agent on Windows topic. To install the Instana host agent on Linux, see the Installing the host agent on Linux topic.

After the Instana agent is installed, the MS SQL Server sensor is enabled by default. You can choose how the Instana agent connects to the SQL Server as follows:

  • SQL Server authentication: If you provide the instance, username, password, and port (clear-text) in the agent configuration file *instanaAgentDir*/etc/instana/configuration.yaml as shown in the following configuration, the agent connects to the SQL Server by using the SQL Server authentication:

    Note: The local monitoring sensor design is updated to support multiple database instances that use the SQL Server authentication. As a result, all the local monitoring configurations must now be defined under the local tag. However, the design remains compatible with the existing configuration for monitoring single database instance, which continues to be supported.
    com.instana.plugin.mssql:
      local: # multiple configurations supported
        - instance: 'MSSQLSERVER'  # instance name of MsSQL Server
          user: 'mssql'
          password: 'password'
          port: '1433'
          poll_rate: 60 # seconds.
          top_queries_poll_rate: 120 # seconds.
     
  • Windows Authentication: If you leave the configuration section in the agent configuration file commented out or leave the username and password empty, the agent tries to connect by using Windows Authentication. When the Windows Authentication is used, the agent authenticates with the credentials that it is running under.

  • poll_rate: Specify the poll rate. By default, the value is 1 second.

  • top_queries_poll_rate: Specify the poll rate for top queries. By default, the value is 60 seconds.

    When the Windows Authentication is used, ensure that your account has appropriate permissions as described in the Required server or database permissions section.

Remote

For remote monitoring, use the following configuration:

com.instana.plugin.mssql:
  remote: # multiple configurations supported
    - host: 'host-1'
      instance: 'MSSQLSERVER02' #Instance name of MSSQL Server
      user: 'mssql'
      password: 'password'
      port: '1434'
      availabilityZone: 'MSSQLSERVER02_REMOTE'
      poll_rate: 60 # seconds
      top_queries_poll_rate: 120 # seconds
 

The configured remote MS SQL instance is then shown as a separate box in the specified availabilityZone on the Infrastructure dashboard in the Instana UI.

Setting up SSL or TLS support

For the Instana agent to securely connect to your MS SQL Server, configure the agent configuration files<agent_install_dir>/etc/instana/configuration.yaml as follows:

Local

For local monitoring, use the following configuration:

com.instana.plugin.mssql:
  local:
    ...
    sslTrustStoreLocation: '/path/to/truststore.jks'
    sslTrustStorePassword: 'trustStorePassword'
 

Remote

For remote monitoring, use the following configuration:

com.instana.plugin.mssql:
  remote:
    ...
    sslTrustStoreLocation: '/path/to/truststore.jks'
    sslTrustStorePassword: 'trustStorePassword'
 

Network settings

If you are running the Microsoft SQL database and the Instana agent on a Windows system, ensure that the TCP/IP protocol is enabled and the SQL Server Browser service is running.

Setting a custom port

If you want to specify a custom port that the sensor must use to monitor the instance (other than the default port 1433), specify the port field in the agent configuration file:

com.instana.plugin.mssql:
  port: 2529    # custom Microsoft SQL TCP port
 

Required server or database permissions

Instana queries dynamic management views (DMV) on SQL Server by using the user credentials specified in the agent configuration file. Ensure that the SQL user specified in the agent configuration file has the VIEW SERVER STATE and VIEW DATABASE STATE permissions. For more information on these permissions, see System dynamic management views.

Metrics collection

To view the metrics, select Infrastructure in the sidebar of the Instana User interface, click a specific monitored host, and then you can see a host dashboard with all the collected metrics and monitored processes.

Configuration data

  • Instance Name
  • Version
  • Process ID
  • Start Time

Performance metrics

Metric Description Granularity
User Connections The number of user connections 1 second
Maximum Connection The maximum number of concurrent user connections. By default, the value is 0, which means that an unlimited number of users can connect. To change this value, see Configure the user connections Server Configuration Option. 1 second
Wait-Times on server Page IO-Latch EX, Page IO-Latch SH, Async Network IO, CX-Packet, Writelog 1 second
Reads and Writes Virtual file reads and writes in bytes 1 second
Transactions The number of write transactions 1 second
Errors User, DB Offline and Kill Connection errors 1 second
Locks The number of Lock requests and Deadlocks 1 second
Db Memory Db memory used and capacity in MB 1 second
Virtual Memory Virtual memory in MB 1 second
Response Time Response Time of Transaction 1 second
DB Cache Hit Rate DB Cache Hit Rate in % 1 second

Database

Metric Description Granularity
User Connections The number of user connections 1 second
Reads and Writes Virtual file reads and writes in bytes 1 second
Transactions The number of write transactions 1 second

Top Queries

You can find the section "Top Queries" on the dashboard of your SQL Server. This table lists the top 50 queries (based on the time that is consumed by these queries) being issued against the monitored instance. In addition to the processed SQL Statement, you can see the following metrics:

Metric Description Granularity
Execution Time Total and Last Execution Time 60 seconds
Logical Reads Last Logical Reads 60 seconds
Logical Writes Last Logical Writes 60 seconds

Troubleshooting encrypted connections (SSL or TLS)

If the Instana agent fails to connect to your encrypted MSSQL server, import your trusted certificate into your JRE's cacerts (jvm/jre/lib/security/cacerts) file by using the following keytool command:

keytool -import -alias ALIAS_NAME -keystore "/path/to/jre/cacerts" -file YOUR_CERTIFICATE_NAME.crt