This check lets you track the performance of your SQL Server instances. It collects metrics for number of user connections, rate of SQL compilations, and more.
You can also create your own metrics by having the check run custom queries.
The SQL Server check is included in the Datadog Agent package, so you don't need to install anything else on your SQL Server instances.
Make sure that your SQL Server instance supports SQL Server authentication by enabling "SQL Server and Windows Authentication mode" in the server properties. Server Properties -> Security -> SQL Server and Windows Authentication mode
-
Create a read-only user to connect to your server:
CREATE LOGIN datadog WITH PASSWORD = 'YOUR_PASSWORD'; CREATE USER datadog FOR LOGIN datadog; GRANT SELECT on sys.dm_os_performance_counters to datadog; GRANT VIEW SERVER STATE to datadog; -
Create a file
sqlserver.d/conf.yaml, in theconf.d/folder at the root of your Agent's configuration directory. See the sample sqlserver.d/conf.yaml for all available configuration options:init_config: instances: - host: <SQL_HOST>,<SQL_PORT> username: <SQL_ADMIN_USER> password: <SQL_ADMIN_PASSWORD> connector: odbc # alternative is 'adodbapi' driver: SQL Server
See the example check configuration for a comprehensive description of all options, including how to use custom queries to create your own metrics.
-
Restart the Agent to start sending SQL Server metrics to Datadog.
Run the Agent's status subcommand and look for sqlserver under the Checks section.
See metadata.csv for a list of metrics provided by this check.
Most of these metrics come from your SQL Server's sys.dm_os_performance_counters table.
The SQL server check does not include any events at this time.
sqlserver.can_connect:
Returns CRITICAL if the Agent cannot connect to SQL Server to collect metrics, otherwise OK.
Need help? Contact Datadog Support.
