Project: Grafana (Observability and Analysis / Observability)
File: get-started-grafana-ms-sql-server.md

aliases: ../guides/getting_started/ ../guides/gettingstarted/ getting-started-sql/ description: Learn how to build your first MS SQL Server dashboard in Grafana. labels: products: enterprise oss title: Get started with Grafana and MS SQL Server weight: 500 Microsoft SQL Server is a popular relational database management system that is widely used in development and production environments. This topic walks you through the steps to create a series of dashboards in Grafana to display metrics from a MS SQL Server database. MS SQL Server can be installed on Windows or Linux operating systems and also on Docker containers. Refer to the , for a complete list of all available options. You can install MS SQL Server on the host running Grafana or on a remote server. To install the software from the , follow their setup prompts. If you are on a Windows host but want to use Grafana and MS SQL data source on a Linux environment, refer to the . This will allow you to leverage the resources available in GitHub repository. Here you will find a collection of supported data sources, including MS SQL Server, along with test data and pre-configured dashboards for use. There are several ways to authenticate in MSSQL. Start by: Click Connections in the left-side menu and filter by `mssql`. Select the Microsoft SQL Server option. Click Create a Microsoft SQL Server data source in the top right corner to open the configuration page. Select the desired authentication method and fill in the right information as detailed below. Click Save & test. | Name | Description | | - | | | `Name` | The data source name. This is how you refer to the data source in panels and queries. | | `Host` | The IP address/hostname and optional port of your MS SQL instance. If port is omitted, the default 1433 will be used. | | `Database` | Name of your MS SQL database. | | Name | Description | | - | - | | `User` | Database user's

| | `Password` | Database user's password. | Below are the four possible ways to authenticate via Windows Active Directory/Kerberos. {{< admonition type="note" >}} Windows Active Directory (Kerberos) authentication is not supported in Grafana Cloud at the moment. {{< /admonition >}} | Method | Description | | - | | | Username + password | Enter the domain user and password | | Keytab file | Specify the path to a valid keytab file to use that for authentication. | | Credential cache | Log in on the host via `kinit` and pass the path to the credential cache. The cache path can be found by running `klist` on the host in question. | | Credential cache file | This option allows multiple valid configurations to be present and matching is performed on host, database, and user. See the example JSON below this table. | ```json [ { "user": "grot@GF.LAB", "database": "dbone", "address": "mysql1.mydomain.com:3306", "credentialCache": "/tmp/krb5cc_1000" }, { "user": "grot@GF.LAB", "database": "dbtwo", "address": "mysql2.gf.lab", "credentialCache": "/tmp/krb5cc_1000" } ] ``` For installations from the repository, `gdev-mssql` data source is available. Once you add this data source, you can use the `Datasource tests - MSSQL` dashboard with three panels showing metrics generated from a test database. Optionally, play around this dashboard and customize it to: Create different panels. Change titles for panels. Change frequency of data polling. Change the period for which the data is displayed. Rearrange and resize panels. Now that you have gained some idea of using the pre-packaged MS SQL data source and some test data, the next step is to setup your own instance of MS SQL Server database and data your development or sandbox area. To fetch data from your own instance of MS SQL Server, add the data source using instructions in Step 4 of this topic. In Grafana build queries to experiment with the metrics you want to monitor. Once you have a curated list of queries, create to render metrics from the SQL Server database. For troubleshooting, user permissions, known issues, and query examples, refer to .