Microsoft SQL Server receiver

The Microsoft SQL server receiver grabs metrics from a Microsoft SQL Server instance.

The Microsoft SQL Server receiver queries and retrieves metrics from Microsoft SQL Server instances. The receiver works by either using the Windows Performance Counters, or by directly connecting to the instance and querying it. The supported pipeline type is metrics. See Process your data with pipelines for more information.

The following applies:

  • Windows Performance Counters are only available when running on Windows.

  • Make sure to run the Collector as an administrator in order to collect all performance counters for metrics.

Get started

Follow these steps to configure and activate the component:

  1. Deploy the Splunk Distribution of the OpenTelemetry Collector to your host or container platform:

  2. Configure the MSSQL Server receiver as described in the next section.

  3. Restart the Collector.

Sample configuration

To activate the receiver, add sqlserver to the receivers section of your configuration file:

receivers:
    sqlserver:
      collection_interval: 10s
    sqlserver/1:
      collection_interval: 5s
      username: sa
      password: securepassword
      server: 0.0.0.0
      port: 1433

Next, include the receiver in the metrics pipeline of the service section of your configuration file:

service:
  pipelines:
    metrics:
      receivers:
        - sqlserver
CAUTION: To retrieve out-of-the-box content properly, you need to explicitly activate and deactivate specific metrics and resource attributes in your configuration file. Read more at Enable built-in content.

Configure a named instance on Windows

If you’re using a named instance on Windows, you need to specify a computer and instance name. For example:

receivers:
  sqlserver:
    collection_interval: 10s
    computer_name: CustomServer
    instance_name: CustomInstance
    resource_attributes:
      sqlserver.computer.name:
        enabled: true
      sqlserver.instance.name:
        enabled: true

Advanced configuration

The following settings are optional:

  • collection_interval. 10s by default. The interval at which the receiver emits metrics.

  • instance_name. Optional. The instance name identifies the specific SQL Server instance to monitor. If unspecified, metrics are scraped from all instances. If configured, you must also set computer_name when running on Windows.

These are the optional direct connection options:

  • username. The username used to connect to the SQL Server instance.

  • password. The password used to connect to the SQL Server instance.

  • server. IP address or hostname of the SQL Server instance to connect to.

  • port. Port of the SQL Server instance to connect to.

  • datasource. Use this option to specify the direct connection using a string. It can't be used in conjunction with the username, password, server and port options. For more information refer to the example and to Microsoft's connection string descriptions in the MS SQL documentation.

The following are Windows-specific optional options:

  • computer_name. The computer name identifies the SQL Server name or IP address of the computer being monitored. If specified, instance_name is also required. This option is ignored in non-Windows environments.

Enable built-in content

Splunk Observability Cloud provides built-in dashboards with charts that give you immediate visibility into the technologies and services being used in your environment. Learn more at Monitor the Collector with Splunk Observability Cloud’s built-in dashboards.

CAUTION: For the MS SQL Server receiver out-of-the-box content to work properly, you need to explicitly activate and deactivate specific metrics and resource attributes in your configuration file.

For more information:

Enable metrics and resource attributes

Some resource attributes, such as sqlserver.instance.name, are deactivated by default.

To activate them, specify the option in your configuration file:

receivers:
    sqlserver:
      collection_interval: 10s
    sqlserver/1:
      collection_interval: 5s
      username: sa
      password: securepassword
      server: 0.0.0.0
      port: 1433
      resource_attributes:
        sqlserver.instance.name:
          enabled: true

Use datasource to specify your connection string

Use this option to define the connection string used when connecting to the database:
receivers:
    sqlserver:
      datasource: sqlserver://username:password@host/instance?param1=value&param2=value
      server: 127.0.0.1
      trusted_connection: true

Settings

The following table shows the configuration options for the Microsoft SQL server receiver:

included

https://raw.githubusercontent.com/splunk/collector-config-tools/main/cfg-metadata/receiver/sqlserver.yaml

Metrics

The following metrics, resource attributes, and attributes, are available.

included

https://raw.githubusercontent.com/splunk/collector-config-tools/main/metric-metadata/sqlserverreceiver.yaml

Activate or deactivate specific metrics

You can activate or deactivate specific metrics by setting the enabled field in the metrics section for each metric. For example:

receivers:
  samplereceiver:
    metrics:
      metric-one:
        enabled: true
      metric-two:
        enabled: false

The following is an example of host metrics receiver configuration with activated metrics:

receivers:
  hostmetrics:
    scrapers:
      process:
        metrics:
          process.cpu.utilization:
            enabled: true
Note: Deactivated metrics aren’t sent to Splunk Observability Cloud.
Billing
  • If you’re in a MTS-based subscription, all metrics count towards metrics usage.

  • If you’re in a host-based plan, metrics listed as active (Active: Yes) on this document are considered default and are included free of charge.

Learn more at Infrastructure Monitoring subscription usage (Host and metric plans).

Troubleshooting

If you are a Splunk Observability Cloud customer and are not able to see your data in Splunk Observability Cloud, you can get help in the following ways.

Available to Splunk Observability Cloud customers

Available to prospective customers and free trial users

  • Ask a question and get answers through community support at Splunk Answers.

  • Join the Splunk #observability user group Slack channel to communicate with customers, partners, and Splunk employees worldwide. To join, see Chat groups.