---
title: Collect more metrics from the SQL Server integration
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: >-
  Docs > Integrations > Integration Guides > Collect more metrics from the SQL
  Server integration
---

# Collect more metrics from the SQL Server integration

{% callout %}
# Important note for users on the following Datadog sites: us2.ddog-gov.com

{% alert level="info" %}
To find out if this integration is available in your organization, see your [Datadog Integrations](https://app.datadoghq.com/integrations) page or ask your organization administrator.

To initiate an exception request to enable this integration for your organization, email [support@ddog-gov.com](mailto:support@ddog-gov.com).
{% /alert %}

{% /callout %}

## Overview{% #overview %}

By default, the SQL Server integration only collects [the metrics listed in the documentation page](https://docs.datadoghq.com/integrations/sqlserver.md). But you can collect additional metrics from your SQL Server integration by configuring your `sqlserver.d/conf.yaml` following [the syntax in our example file](https://github.com/DataDog/integrations-core/blob/master/sqlserver/datadog_checks/sqlserver/data/conf.yaml.example) (these goes under "init_config").

At this time, the Datadog sqlserver check only queries data from the [sys.dm_os_performance_counters](https://msdn.microsoft.com/en-us/library/ms187743.aspx) table, although you can [use WMI to expose metrics](https://docs.datadoghq.com/integrations/guide/use-wmi-to-collect-more-sql-server-performance-metrics.md) from other counter tables. To collect specific data, find `counter_name` and, when applicable, `instance_name` to correspond to the metric you're interested in collecting. Once you access your server from [powershell's sqlcmd](https://msdn.microsoft.com/en-us/library/ms188247.aspx), run the following or similar query to get a list of what `count_names` are available in that table in your SQL Server.

**Note**: This returns a long list.

```text
1> SELECT counter_name, instance_name, cntr_value, cntr_type FROM sys.dm_os_performance_counters;
2> go
```

From there you can pick out the counter_names that are most interesting to you, add them to your custom metric section of the sqlserver.yaml in the "counter_name" options, and give your metric an appropriate name in the "- name:" options (you may want to start them with "sqlserver." like all the other sqlserver metrics).

## Example{% #example %}

An example of what your `sqlserver.d/conf.yaml` might look like if you wanted to collect metrics for the CLR Execution, Queued requests, and Active requests properties is as follows:

```yaml
init_config:

  custom_metrics:

    - name: sqlserver.clr.execution
      counter_name: CLR Execution
    - name: sqlserver.requests.queued
      counter_name: Queued requests
      instance_name: internal
    - name: sqlserver.requests.active
      counter_name: Active requests
      instance_name: internal

instances:
  - host: 127.0.0.1,1433
    username: datadog
    password: *******
    tags:
      - test:sqlserver
```
