SQL Server Metrics and Logs

Overview

This documentation explains how to collect SQL Server metrics and logs using OpenTelemetry and send them to SigNoz for monitoring and analysis.

Prerequisites

  • Ensure a Microsoft SQL Server instance (any supported version) running.

Setup

Step 1. Setup OTel Collector

The OpenTelemetry (OTel) Collector helps collect telemetry data such as logs, traces and metrics from your application. Please follow the documentation here to setup the OpenTelmetry Collector in your VM.

Step 2. Setup SQL Server Receiver

Update the config.yaml file that you created in otelcol-contrib folder while setting up OTel Collector to include the sqlserver receiver under the receivers section.

/otelcol-contrib/config.yaml

receivers:
  sqlserver:
    collection_interval: 60s
    datasource: "Server=<ServerName>;User Id=<UserID>;Password=<Password>;Database=<DatabaseName>"
    metrics:
      sqlserver.cpu.count: 
        enabled: true
      sqlserver.database.backup_or_restore.rate:
        enabled: true
      sqlserver.database.count:
        enabled: true
      sqlserver.database.tempdb.space:
        enabled: true
      sqlserver.database.io:
        enabled: true
      sqlserver.database.latency:
        enabled: true

processors:
  resource:
    attributes:
      - key: service.name
        value: <service-name>
        action: insert

exporters:
  otlp:
    endpoint: ingest.<region>.signoz.cloud:443
    headers:
      signoz-access-token: <SIGNOZ_INGESTION_KEY>
  debug:
    verbosity: detailed

  • <ServerName>: Specifies the address or hostname of the SQL Server instance you want to connect to (e.g., localhost or myserver.database.windows.net)
  • <UserID>: Specifies the SQL Server login name used for authentication (e.g., SA or any other configured SQL login)
  • <Password>: Specifies the password corresponding to the provided UserID, allowing access to the database
  • <DatabaseName>: Specifies the target SQL Server database that the OpenTelemetry Collector will query for collecting metrics (e.g., master, mydb)
  • <service-name>: Specifies the service that emits the metrics, making it easier to identify and filter metrics related to a specific database
  • <region>: Your chosen region for SigNoz Cloud
  • <SIGNOZ_INGESTION_KEY>: Your SigNoz Cloud Ingestion Key

Step 3. Add SQL Server Receiver to pipelines

In the config.yaml file, under the service section, locate the pipelines block. Within the metrics pipeline, add sqlserver to the list of receivers.

/otelcol-contrib/config.yaml
...
service:
  pipelines:
    metrics:
      receivers: [sqlserver]
      processors: [resource]
      exporters: [otlp,debug]
...

Step 4. Run the OTel Collector

Inside otelcol-contrib folder, run the otelcol-contrib command.

./otelcol-contrib --config config.yaml

Validate Metrics in SigNoz

📝 Note

💡 Not all metrics are scraped from SQL Server when running on Linux. For complete metric collection, including Windows-specific counters, use a Windows-based SQL Server.

You can view the SQL server metrics in the Metrics Tab of your SigNoz UI.

SQL Server Metrics
Scraped Metrics from SQL Server

To see the complete list of metrics, refer this link.

Last updated: July 16, 2025

Was this page helpful?