Collect data from Microsoft SQL Server

Configure the Splunk Distribution of OpenTelemetry Collector to collect metrics and events from your Microsoft SQL Server instance.

  • You must have a Splunk Database Monitoring license.

  • These are the combinations that we've tested the sqlserver receiver on. Other combinations might work but are untested:

    Microsoft SQL Server versionEditionPlatform (where the database is deployed or hosted)Deployment type
    2016StandardAWSRDS
    2019ExpressAWSRDS
    2019EnterpriseAWSRDS
    2019WebAWSRDS
    GP_Gen5Managed InstanceAzureSQL Managed Instance
    12:0Azure SQL ServerAzureAzure Managed Instance
    sql2022-ws2022SQL Virtual MachineAzureAzure VM (SQL Image)
    2017Developer EditionOn-premisesKubernetes
  • Be aware of the limitations of this release.

  • If you're currently using the deprecated Smart Agent receiver (smartagent/sqlserver) to send metrics from Microsoft SQL Server to Splunk Observability Cloud, migrate to the Splunk Distribution of the OpenTelemetry Collector sqlserver receiver.

  • Upgrade your Splunk Distribution of the OpenTelemetry Collector to v0.137.0 or later, or your community (OSS) version of the OpenTelemetry Collector to v0.137.0 or later.

  1. Deploy a supported OpenTelemetry collector if it's not already deployed.
  2. Configure sqlserver receiver to collect infrastructure metrics from your Microsoft SQL Server instance.
  3. Enable Database Monitoring by modifying your OpenTelemetry Collector configuration.
    1. In your collector's YAML file, add additional configuration to the sqlserver receiver:
      The example below shows the minimum required configuration, but you can add other options. See the Microsoft SQL Server Receiver README for details. For performance reasons, don't change top_query_collection.collection_interval. It's set to 60 seconds by default.
        # Receivers collect telemetry data from various sources
        receivers:
          # Collects metrics and queries from mssqltest
          sqlserver:
            ...
            # ADD to ENABLE Database Monitoring
            events:
              db.server.query_sample:
                enabled: true
              db.server.top_query:
                enabled: true
    2. Add an additional exporter, named dbmon, with the configuration shown in the codeblock below.
      Note: The dbmon exporter sends OpenTelemetry-formatted logs to your Splunk Observability Cloud event endpoint rather than to its metrics endpoint.
      # Exporters define where the telemetry data is sent to
        exporters:
          # Exports dbmon events as logs
          otlphttp/dbmon:
            headers:
              X-SF-Token: your-splunk-observability-cloud-access-token
              X-splunk-instrumentation-library: dbmon
            logs_endpoint: https://ingest.<your-splunk-realm>.signalfx.com/v3/event
            sending_queue:
              batch:
                flush_timeout: 15s
                max_size: 10485760 # 10 MiB
                sizer: bytes      
    3. Add a new logs pipeline named dbmon, with the following components:
      Important: If you use the resourcedetection processor in the collector, make sure to add this processor into the logs/dbmon pipeline, as shown in the example below.
      service:
        pipelines:
      	…
          logs/dbmon:
            receivers:
              - sqlserver
            processors:
              - memory_limiter
              - resource/tns
              - batch
              - resourcedetection
            exporters:
              - otlphttp/dbmon 
    4. Restart your collector.
      The command to restart the collector varies depending on which collector you deployed, which platform you deployed it on, and what tool you used to deploy it. For the Splunk Distribution of the OpenTelemetry Collector deployed on Kubernetes platforms with Helm, the restart command is:
      helm upgrade <your-splunk-otel-collector> splunk-otel-collector-chart/splunk-otel-collector -f <your-override-values.yaml>

      where splunk-otel-collector-chart is the name you gave to the Helm chart in the helm repo add command (in other words, your command was helm repo add splunk-otel-collector-chart https://signalfx.github.io/splunk-otel-collector-chart ).

    5. Confirm that you can see the Microsoft SQL Server database service on APM > Database Monitoring Overview.

Your Microsoft SQL Server instance should now be visible as database service in Database Monitoring (APM > Database Monitoring Overview).