peschuster

Technology, .NET and Web

  • Info

sql server

Sending stats to Graphite from within SQL Server

July 9, 2012 by peter

I am playing with Graphite and StatsD with all the different possibilities to record and transmit metrics lately.

My recent addition to the “graphite-client” project is a TSQL CLR procedure for sending stats to Graphite directly from within SQL server: https://github.com/peschuster/graphite-client/tree/master/source/Graphite.TSql.

It is just a simple one-liner in SQL:

exec sp_graphitesend '192.168.0.1', 2003, 'stats.events.myserver.test', 1

Installation of the stored procedure is “described” here: https://github.com/peschuster/graphite-client/blob/master/source/Graphite.TSql/sp_graphitesend.sql

Only restriction is that it requires a “TRUSTWORTHY” database, clr code execution enabled and import of a custom DLL (Graphite.TSql.dll).

A typical scenario for sending stats directly from within SQL Server is e.g. logging of backup or maintenance tasks for being able to put it in correlation with other metrics like cache-hit-ratio or memory usage.

Posted in: .NET, Monitoring Tagged: Graphite, sql server

Syndication

  • RSS 2.0

Recent Posts

  • Ubiquiti EdgeRouter™ X SFP – Teardown
  • Force HttpWebRequest to IPv4
  • Blackmagic Design ATEM GPI and Tally Interface Teardown
  • WinForms ListView DoubleClick Event for Empty Lists
  • Planning Center Online – Custom Plan Reports in Landscape Orientation

Tags

.NET AntiXssEncoder ASP.NET Build c# Configuration crawler Debugging EF ELMAH Expression tree Graphite Interop IssuerNameRegistry iTunes Linq ListView MVC pco pdf Security SecurityKey SecurityToken simulatebe sql server StatsD STS teardown TYPO3 UAC UI UserSettings Visual Studio WIF WIF in depth WinForms WndProc
profile for Peter at Stack Overflow, Q&A for professional and enthusiast programmers Peter Schuster

Copyright © 2025 peschuster.

Alpha WordPress Theme by themehall.com