Skip to content

SUMO 264514: SQL Server OpenTelemetry App update #5608

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Jul 25, 2025
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ import TabItem from '@theme/TabItem';

<img src={useBaseUrl('img/integrations/microsoft-azure/sql.png')} alt="thumbnail icon" width="50"/> <img src={useBaseUrl('img/send-data/otel-color.svg')} alt="Thumbnail icon" width="45"/>

:::note logs only
This is a logs-only app. For collecting metrics and enabling comprehensive monitoring on both Linux and Windows, use the [Microsoft SQL Server - OpenTelemetry App](/docs/integrations/microsoft-azure/opentelemetry/sql-server-opentelemetry).
:::

The Sumo Logic app for Microsoft SQL Server is a logs-based app that provides insight into your SQL Server for Linux. The app consists of predefined dashboards, providing visibility into your environment for real-time or historical analysis on backup, restore mirroring, general health and operations of your system.

This app has been tested with following SQL Server versions:
Expand Down Expand Up @@ -142,7 +146,7 @@ Following is the query from **Error and warning count** panel from the **SQL Ser

### Overview

The **SQL Server - Overview** dashboard provides a snapshot overview of your SQL Server instance. Use this dashboard to understand CPU, memory, and disk utilization of your SQL Server(s) deployed in your cluster. This dashboard also provides login activities and methods by users.
The **SQL Server Linux - Overview** dashboard provides a snapshot overview of your SQL Server instance. Use this dashboard to understand CPU, memory, and disk utilization of your SQL Server(s) deployed in your cluster. This dashboard also provides login activities and methods by users.

Use this dashboard to:
- Keep track of deadlocks, errors, backup failures, mirroring errors, and insufficient space issue counts.
Expand All @@ -152,7 +156,7 @@ Use this dashboard to:

### General Health

The **SQL Server - General Health** dashboard provides you the overall health of SQL Server. Use this dashboard to analyze server events including stopped/up servers and its corresponding down/uptime, monitor disk space percentage utilization, wait time trend, and app-domain issues by SQL server.
The **SQL Server Linux - General Health** dashboard provides you the overall health of SQL Server. Use this dashboard to analyze server events including stopped/up servers and its corresponding down/uptime, monitor disk space percentage utilization, wait time trend, and app-domain issues by SQL server.

Use this dashboard to:

Expand All @@ -164,7 +168,7 @@ Use this dashboard to:

### Backup Restore Mirroring

The **SQL Server - Backup Restore Mirroring** dashboard provides information about:
The **SQL Server Linux - Backup Restore Mirroring** dashboard provides information about:

- Transaction log backup events
- Database backup events
Expand All @@ -176,7 +180,7 @@ The **SQL Server - Backup Restore Mirroring** dashboard provides information abo

### Operations

The **SQL Server - Operations** dashboard displays recent server configuration changes, number and type of configuration updates, error and warnings, high severity error, and warning trends.
The **SQL Server Linux - Operations** dashboard displays recent server configuration changes, number and type of configuration updates, error and warnings, high severity error, and warning trends.

Use this dashboard to:

Expand All @@ -195,10 +199,10 @@ import CreateMonitors from '../../../reuse/apps/create-monitors.md';

| Name | Description | Alert Condition | Recover Condition |
|:--|:--|:--|:--|
| `SQL Server - AppDomain` | This alert is triggered when AppDomain-related issues are detected in your SQL Server instance. | Count `>=` 1 | Count `<` 1 |
| `SQL Server - Backup Fail` | This alert is triggered when the SQL Server backup fails. | Count `>=` 1 | Count `<` 1 |
| `SQL Server - Deadlock` | This alert is triggered when deadlocks are detected in a SQL Server instance. | Count `>` 5 | Count `<=` 5 |
| `SQL Server - Instance Down` | This alert is triggered when the SQL Server instance is down for 5 minutes. | Count `>` 0 | Count `<=` 0 |
| `SQL Server - Insufficient Space` | This alert is triggered when the SQL Server instance cannot allocate a new page for the database due to insufficient disk space in the filegroup. | Count `>` 0 | Count `<=` 0 |
| `SQL Server - Login Fail` | This alert is triggered when the user is unable to login to the SQL Server. | Count `>=` 1 | Count `<` 1 |
| `SQL Server - Mirroring Error` | This alert is triggered when an error occurs in SQL Server mirroring. | Count `>=` 1 | Count `<` 1 |
| `SQL Server Linux - AppDomain` | This alert is triggered when AppDomain-related issues are detected in your SQL Server instance. | Count `>=` 1 | Count `<` 1 |
| `SQL Server Linux - Backup Fail` | This alert is triggered when the SQL Server backup fails. | Count `>=` 1 | Count `<` 1 |
| `SQL Server Linux - Deadlock` | This alert is triggered when deadlocks are detected in a SQL Server instance. | Count `>` 5 | Count `<=` 5 |
| `SQL Server Linux - Instance Down` | This alert is triggered when the SQL Server instance is down for 5 minutes. | Count `>` 0 | Count `<=` 0 |
| `SQL Server Linux - Insufficient Space` | This alert is triggered when the SQL Server instance cannot allocate a new page for the database due to insufficient disk space in the filegroup. | Count `>` 0 | Count `<=` 0 |
| `SQL Server Linux - Login Fail` | This alert is triggered when the user is unable to login to the SQL Server. | Count `>=` 1 | Count `<` 1 |
| `SQL Server Linux - Mirroring Error` | This alert is triggered when an error occurs in SQL Server mirroring. | Count `>=` 1 | Count `<` 1 |
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,21 @@
id: sql-server-opentelemetry
title: Microsoft SQL Server - OpenTelemetry Collector
sidebar_label: Microsoft SQL Server - OTel Collector
description: Learn about the Sumo Logic OpenTelemetry app for Microsoft SQL Server for Windows.
description: Learn about the Sumo Logic OpenTelemetry app for Microsoft SQL Server.
---
import useBaseUrl from '@docusaurus/useBaseUrl';
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

<img src={useBaseUrl('img/integrations/microsoft-azure/sql.png')} alt="thumbnail icon" width="50"/> <img src={useBaseUrl('img/send-data/otel-color.svg')} alt="Thumbnail icon" width="45"/>

:::note
The information provided in this page will only support the Sumo Logic OpenTelemetry app for Microsoft SQL Server for Windows.
:::
The SQL Server app is a unifies logs and metrics app to help you monitor the availability, performance, health, and resource utilization of your Microsoft SQL Server database clusters. Preconfigured dashboards provide insight into cluster status, performance, operations as well as backup and restore operations along with Performance metrics and metrics for transaction and transaction logs.

This app has been tested with following SQL Server versions:

- `Microsoft SQL Server 2016`
- `Microsoft SQL Server 2022`

The diagram below illustrates the components of the SQL Server collection for each database server. OpenTelemetry collector runs on the same host as SQL Server, and uses the [SQL Server receiver](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/sqlserverreceiver) to obtain SQL Server metrics. This receiver grabs metrics about a Microsoft SQL Server instance using the Windows Performance Counters. Because of this, it is a Windows only receiver. Thus metrics for SQL Server can be collected only if its in a windows machine.
The diagram below illustrates the components of the SQL Server collection for each database server. OpenTelemetry collector runs on the same host as SQL Server, and uses the [SQL Server receiver](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/sqlserverreceiver) to obtain SQL Server metrics. This receiver grabs metrics about a Microsoft SQL Server instance using the Windows Performance Counters (Windows only) and by connecting to SQL Server using the credentials (Windows and Linux both)
SQL Server logs are sent to Sumo Logic through OpenTelemetry [filelog receiver](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/filelogreceiver).

<img src='https://sumologic-app-data-v2.s3.amazonaws.com/dashboards/SQLServer-OpenTelemetry/SQL-Server-Schematics.png' alt="Redis Logs dashboards"/>
Expand All @@ -40,15 +37,27 @@ Following are the [Fields](/docs/manage/fields/) which will be created as part o

### For metrics collection

The [SQL server receiver](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/receiver/sqlserverreceiver/README.md) for OpenTelemetry grabs metrics about a Microsoft SQL Server instance using the Windows Performance Counters.
The [SQL server receiver](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/receiver/sqlserverreceiver/README.md) for OpenTelemetry grabs metrics about a Microsoft SQL Server instance using different methods:

**Windows:**
- Uses Windows Performance Counters for collecting system-level metrics
- Connects directly to SQL Server using credentials for database-specific metrics

**Linux:**
- Connects to SQL Server using credentials (Windows Authentication is not available on Linux)
- Requires SQL Server authentication

### For logs collection

Make sure logging is turned on in SQL Server. Follow [this documentation](https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/scm-services-configure-sql-server-error-logs?view=sql-server-ver15) to enable it.

The Microsoft SQL Server App's queries and dashboards depend on logs from the SQL Server ERRORLOG, which is typically found in: `C:\Program Files\Microsoft SQL Server\MSSQL<version>.MSSQLSERVER\MSSQL\Log\ERRORLOG*`.
The Microsoft SQL Server App's queries and dashboards depend on logs from the SQL Server ERRORLOG, which is typically found in:

**Windows:** `C:\Program Files\Microsoft SQL Server\MSSQL<version>.MSSQLSERVER\MSSQL\Log\ERRORLOG*`

The ERRORLOG is typically in UTF-16LE encoding, however, be sure to verify the file encoding used in your SQL Server configuration.
**Linux:** `/var/opt/mssql/log/errorlog*` (default path for SQL Server on Linux)

The ERRORLOG is typically in UTF-16LE encoding on Windows and Linux both. Be sure to verify the file encoding used in your SQL Server configuration.

**ACL Support**

Expand All @@ -68,6 +77,12 @@ $NewAcl.SetAccessRule($fileSystemAccessRule)
Set-Acl -Path "<PATH_TO_LOG_FILE>" -AclObject $NewAcl
```

For Linux systems, ensure the OpenTelemetry collector process has read access to the log files:
```bash
# Grant read access to the collector user (adjust paths as needed)
sudo chmod +r /var/opt/mssql/log/errorlog*
```

## Collection configuration and app installation

import ConfigAppInstall from '../../../reuse/apps/opentelemetry/config-app-install.md';
Expand All @@ -86,13 +101,31 @@ This will generate a command you can execute on the machine that you need to mon

### Step 2: Configure integration

1. The Microsoft SQL Server App's queries and dashboards depend on logs from the SQL Server ERRORLOG, which is typically found in:
`C:\Program Files\Microsoft SQL Server\MSSQL<version>.MSSQLSERVER\MSSQL\Log\ERRORLOG*`
2. To collect from a SQL Server with a named instance, both **Computer Name** and **Instance Name** are required. Toggle the `Enable metric collection for SQL Server with a named instance.` button. For a default SQL Server setup, these settings are optional.
* **Computer Name**. The computer name identifies the SQL Server name or IP address of the computer being monitored.
* **Instance Name**. The instance name identifies the specific SQL Server instance being monitored.
3. You can add any custom fields which you want to tag along with the data ingested in Sumo Logic.
4. Click on the **Download YAML File** button to get the yaml file.<br/><img src='https://sumologic-app-data-v2.s3.amazonaws.com/dashboards/SQLServer-OpenTelemetry/SQL-Server-YAML.png' style={{border:'1px solid gray'}} alt="YAML" />
1. **Log File Path Configuration**:
- **Windows**: The Microsoft SQL Server App's queries and dashboards depend on logs from the SQL Server ERRORLOG, which is typically found in: `C:\Program Files\Microsoft SQL Server\MSSQL<version>.MSSQLSERVER\MSSQL\Log\ERRORLOG*`
- **Linux**: For SQL Server on Linux, logs are typically located at: `/var/opt/mssql/log/errorlog*`

2. **SQL Server Connection Configuration**: To collect metrics, you'll need to provide connection details:
- **Server Address**: The hostname or IP address of your SQL Server instance (default: 0.0.0.0)
- **Port**: The port number for SQL Server connection (default: 1433)
- **Username**: SQL Server authentication username
- **Password**: SQL Server authentication password

3. **Monitoring a Named SQL Server Instance (Windows Only)**

To collect metrics from a specific named instance of SQL Server on a **Windows** host, enable the `Enable metric collection for SQL Server with a named instance` option. For a default SQL Server setup, these settings are optional.

* **Computer Name**: The computer name identifies the SQL Server name or IP address of the computer being monitored. This is the network name of the machine hosting SQL Server.
* **Instance Name**: The instance name identifies the specific SQL Server instance being monitored. This is required when SQL Server is installed as a named instance (e.g., SQLEXPRESS, INSTANCE01) rather than the default instance.

---
:::note
Monitoring metrics for named instance is not supported in linux.
:::

4. You can add any custom fields which you want to tag along with the data ingested in Sumo Logic.

5. Click on the **Download YAML File** button to get the yaml file.<br/><img src='https://sumologic-app-data-v2.s3.amazonaws.com/dashboards/SQLServer-OpenTelemetry/SQL-Server-YAML.png' style={{border:'1px solid gray'}} alt="YAML" />

### Step 3: Send logs to Sumo Logic

Expand All @@ -105,6 +138,7 @@ import LogsIntro from '../../../reuse/apps/opentelemetry/send-logs-intro.md';
defaultValue="Windows"
values={[
{label: 'Windows', value: 'Windows'},
{label: 'Linux', value: 'Linux'},
{label: 'Chef', value: 'Chef'},
{label: 'Ansible', value: 'Ansible'},
{label: 'Puppet', value: 'Puppet'},
Expand All @@ -120,6 +154,16 @@ import LogsIntro from '../../../reuse/apps/opentelemetry/send-logs-intro.md';

</TabItem>

<TabItem value="Linux">

1. Copy the YAML file to `/etc/otelcol-sumo/conf.d/` folder in the machine which needs to be monitored.
2. Restart the collector using:
```sh
sudo systemctl restart otelcol-sumo
```

</TabItem>

<TabItem value="Chef">

import ChefNoEnv from '../../../reuse/apps/opentelemetry/chef-without-env.md';
Expand Down Expand Up @@ -256,16 +300,29 @@ Use this dashboard to:

<img src='https://sumologic-app-data-v2.s3.amazonaws.com/dashboards/SQLServer-OpenTelemetry/SQL-Server-Transaction-And-Transaction-Logs.png' alt="Operations" />

### Performance Counters
### Performance

The **SQL Server - Performance Counters** dashboard shows performance counters related to database activities, SQL statistics, and buffer cache.
The **SQL Server - Performance** dashboard provides a deep dive into the internal workings of the SQL Server query engine. It helps DBAs and developers identify inefficient queries, contention issues, and opportunities for optimization.

Use this dashboard to:
<img src='https://sumologic-app-data-v2.s3.amazonaws.com/dashboards/SQLServer-OpenTelemetry/SQL-Server-Performance.png' alt="Performance" />

### I/O

The **SQL Server - I/O** dashboard shows the performance of the underlying disk subsystem as it relates to SQL Server database files. It helps answer questions like, "Is slow disk performance the cause of my application slowdown?" and "Which specific files are the hottest or slowest?"

<img src='https://sumologic-app-data-v2.s3.amazonaws.com/dashboards/SQLServer-OpenTelemetry/SQL-Server-I-O.png' alt="Performance" />

### Replication

The **SQL Server - Replication** dashboard provide dedicated visibility into the health, throughput, and latency of SQL Server's high-availability and disaster recovery (HA/DR) features, such as Availability Groups.

<img src='https://sumologic-app-data-v2.s3.amazonaws.com/dashboards/SQLServer-OpenTelemetry/SQL-Server-Replication.png' alt="Performance" />

### Windows Host Performance

- Get info for page buffer hit % and page split rate.
- Insight into lock waits rate, page read and write rate along with patch request rate and SQL compilation, and recompilation per sec.
The **SQL Server - Windows Host Performance** dashboard isolates metrics that are only available via Windows Performance Counters. It provides deeper insights into Windows-specific memory management and transaction log behavior. The key use case is to provide continuity for Windows DBAs familiar with these classic counters.

<img src='https://sumologic-app-data-v2.s3.amazonaws.com/dashboards/SQLServer-OpenTelemetry/SQL-Server-Performance-Counters.png' alt="Performance-Counters" />
<img src='https://sumologic-app-data-v2.s3.amazonaws.com/dashboards/SQLServer-OpenTelemetry/SQL-Server-Windows-Host-Performance.png' alt="Performance" />

## Create monitors for Microsoft SQL Server app

Expand All @@ -275,12 +332,15 @@ import CreateMonitors from '../../../reuse/apps/create-monitors.md';

### Microsoft SQL Server alerts

| Alert Name | Alert Description and conditions | Alert Condition | Recover Condition |
| Name | Description | Alert Condition | Recover Condition |
|:--|:--|:--|:--|
| `SQL Server - AppDomain Alert` | This alert gets triggered when we detect AppDomain related issues in your SQL Server instance. | Count > = 1 | Count < 1 |
| `SQL Server - Backup Fail Alert` | This alert gets triggered when we detect that the SQL Server backup failed. | Count > = 1 | Count < 1 |
| `SQL Server - Instance Down Alert` | This alert gets triggered when we detect that the SQL Server instance is down for 5 minutes. | Count > 0 | Count < = 0 |
| `SQL Server - Insufficient Space Alert` | This alert gets triggered when SQL Server instance could not allocate a new page for database because of insufficient disk space in filegroup. | Count > = 1 | Count < 1 |
| `SQL Server - Login Fail Alert` | This alert gets triggered when we detect that the user cannot login to SQL Server. | Count > = 1 | Count < 1 |
| `SQL Server - Mirroring Error Alert` | This alert gets triggered when we detect that the SQL Server mirroring has error. | Count > = 1 | Count < 1 |
| `SQL Server - Processes Blocked Alert` | This alert gets triggered when we detect that SQL Server has blocked processes. | Count > 1 | Count < = 1 |
| `SQL Server - AppDomain` | This alert is triggered when we detect AppDomain related issues in your SQL Server instance. | Count > = 1 | Count < 1 |
| `SQL Server - Backup Fail` | This alert is triggered when we detect that the SQL Server backup failed. | Count > = 1 | Count < 1 |
| `SQL Server - Buffer Cache Hit Ratio` | This alert is triggered when the Buffer Cache Hit Ratio drops below 95%, indicating significant memory pressure and a potential for slow performance due to increased disk reads. | Count < 95 | Count > = 95 |
| `SQL Server - Deadlock` | This alert is triggered when we detect deadlocks in a SQL Server instance. | Count > 5 | Count < = 5 |
| `SQL Server - Instance Down` | This alert is triggered when we detect that the SQL Server instance is down for 5 minutes. | Count > 0 | Count < = 0 |
| `SQL Server - Insufficient Space` | This alert is triggered when SQL Server instance could not allocate a new page for database because of insufficient disk space in filegroup. | Count > 0 | Count < = 0 |
| `SQL Server - Login Fail` | This alert is triggered when we detect that the user cannot login to SQL Server. | Count > = 1 | Count < 1 |
| `SQL Server - Mirroring Error` | This alert is triggered when we detect that the SQL Server mirroring has error. | Count > = 1 | Count < 1 |
| `SQL Server - Non Operational Database` | This alert is triggered if any database enters a 'suspect' or 'offline' state, indicating it is unavailable. | Count > 0 | Count < = 0 |
| `SQL Server - Processes Blocked` | This alert is triggered when blocked processes are detected in SQL Server. | Count > 0 | Count < = 0 |