Greg Shackles: Exposing ADO.NET Performance Counters through Datadog

There are a number of useful performance counters exposed for System.Data.SqlClient that can provide some nice insight into what’s going on under the hood of your applications. Today I found myself monitoring the NumberOfReclaimedConnections counter to track down some connections that weren’t being properly disposed.

It’s certainly not ideal to need to log into the servers to monitor this, so I went off looking for how to expose this through our Datadog dashboards. On top of just being able to query it, this would also mean I could create some monitors and alerts based on the counters as well. Datadog provides support for Windows Management Instrumentation (WMI) out of the box, so it was just a matter of figuring out exactly how to query these ADO.NET counters.

Figuring out exactly what the class name was to get access to these counters required a bit of digging that brought me to some parts of the internet that time seems to have forgotten, so I thought I’d just document it here to hopefully save someone else (or future me) the same digging.

In your wmi_check.yaml file (see the WMI integration instructions for how to set this), add the following:

# ADO.NET performance counters
  - class: Win32_PerfFormattedData_NETDataProviderforSqlServer_NETDataProviderforSqlServer
      - [NumberOfActiveConnectionPools, adonet.activeconnectionpools.count, gauge]
      - [NumberOfReclaimedConnections, adonet.reclaimedconnections.count, gauge]
      - [HardConnectsPerSecond, adonet.hardconnects.rate, rate]
      - [HardDisconnectsPerSecond, adonet.harddisconnects.rate, rate]
      - [NumberOfActiveConnectionPoolGroups, adonet.activeconnectionpoolgroups.count, gauge]
      - [NumberOfInactiveConnectionPoolGroups, adonet.inactiveconnectionpoolgroups.count, gauge]
      - [NumberOfInactiveConnectionPools, adonet.inactiveconnectionpools.count, gauge]
      - [NumberOfNonPooledConnections, adonet.nonpooledconnections.count, gauge]
      - [NumberOfPooledConnections, adonet.pooledconnections.count, gauge]
      - [NumberOfStasisConnections, adonet.stasisconnections.count, gauge]
    tag_by: Name

After restarting your Datadog agent it will now start reporting the ADO.NET counters using the names provided here with the adonet. prefix. For each, the instance name for each counter will be included as a tag, allowing you to associate all of the incoming data with the process it came from.


Xamarin: Continuous Delivery to Google Play with Team Services

Mobile DevOps is much more than just continuously building an app with every commit, it also involves planning, testing, and iterating with continuous deployment. In the previous posts on continuous integration in Visual Studio Team Services (VSTS), we saw how to build and sign both an Android and an iOS application built with Xamarin and […]

The post Continuous Delivery to Google Play with Team Services appeared first on Xamarin Blog.


Gone Mobile: Gone Mobile 38: Microsoft Graph API with Simon Jager

In this episode we learn all about the Microsoft Graph API from Simon Jager, and how you can build your mobile apps on top of its offerings.

Hosts: Greg Shackles, Jon Dick

Guests: Simon Jager


Thanks to our Sponsors!

Raygun Pulse
is now available for mobile – Real user monitoring for your mobile apps! Get deep detail into how your mobile applications are performing for your users.