{"id":428,"date":"2019-09-13T05:05:00","date_gmt":"2019-09-12T16:05:00","guid":{"rendered":"https:\/\/blog.wiseowls.co.nz\/?p=428"},"modified":"2026-03-08T00:44:45","modified_gmt":"2026-03-07T11:44:45","slug":"monitoring-sql-server-setting-up-elkg","status":"publish","type":"post","link":"https:\/\/blog.wiseowls.co.nz\/index.php\/2019\/09\/13\/monitoring-sql-server-setting-up-elkg\/","title":{"rendered":"Monitoring SQL Server: setting up ELK+G"},"content":{"rendered":"\n<p>In 9 cases out of 10 our clients have some sort of database that they want to interface with. And 8 out of those 9 cases the database is going to be SQL Server. Yes, this is us being biased, but you know what?<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">It does not matter<\/h2>\n\n\n\n<p>The important bit is &#8211; out clients like to know how the database is doing. Some are happy to pay for commercial APMs, others either have very specific needs or love the challenge to DIY.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">We are here to help<\/h2>\n\n\n\n<p>One way to get better picture of what&#8217;s happening with the DB would be to keep grabbing vitals over time and plotting them on a graph of some sort. <a href=\"https:\/\/grafana.com\/\">Grafana<\/a> is a fantastic way to achieve that. It supports a whole bunch of backends (including SQL server) and allows insane amount of customisations.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Diversify<\/h2>\n\n\n\n<p>It is possible to store SQL telemetry in another SQL database on the same server (you could even set up SQL Agent jobs to do the polling &#8211; all nicely packaged). We however thought it might be a good idea to not store all data on the same machine. We&#8217;d like to not overstrain the main database in time of pinch and completely decouple analytics from critical business processes.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">EL<s>K<\/s> G stack<\/h2>\n\n\n\n<p>One of many ways to approach this is to introduce a (somewhat) free and open source ElasticSearch into the mix. And mightly <a href=\"https:\/\/www.elastic.co\/logstash\">Logstash<\/a> for data ingestion. This is where we&#8217;d normally go on to <a href=\"https:\/\/www.elastic.co\/what-is\/kibana\">Kibana<\/a> for dashboards and nice UI (and we did end up running it), but the main focus of this exercise will still fall onto Grafana.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Setting it up<\/h2>\n\n\n\n<p>Theres no point repeating official documentation for respective products, let&#8217;s instead write up a docker-compose file:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"yaml\" class=\"language-yaml\">version: '3'\nservices:\n    elasticsearch:\n        image: docker.elastic.co\/elasticsearch\/elasticsearch:7.6.1\n        environment:\n            - node.name=elastic01\n            - discovery.type=single-node  \n            - bootstrap.memory_lock=true\n            - \"ES_JAVA_OPTS=-Xms512m -Xmx512m\"        \n        volumes:\n            - .\/elastic:\/usr\/share\/elasticsearch\/data\n    logstash:\n        image: docker.elastic.co\/logstash\/logstash:7.6.1\n        volumes: \n            - .\/logstash-pipeline:\/usr\/share\/logstash\/pipeline\/\n            - .\/logstash-config\/usr\/share\/logstash\/config\/\n        depends_on:\n          - elasticsearch\n    kibana:\n        image: docker.elastic.co\/kibana\/kibana:7.6.1\n        environment:\n          - ELASTICSEARCH_HOSTS=http:\/\/elasticsearch:9200\n        ports:\n          - 5601:5601\n        depends_on:\n          - elasticsearch\n    grafana:\n        image: grafana\/grafana\n        ports:\n          - 3000:3000\n        depends_on:\n          - elasticsearch<\/code><\/pre>\n\n\n\n<p>All that&#8217;s left to do is <code>docker-compose up -d<\/code>  and run. Stay tuned for next posts in the series.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In 9 cases out of 10 our clients have some sort of database that they want to interface with. And 8 out of those 9 cases the database is going to be SQL Server. Yes, this is us being biased, but you know what? It does not matter The important bit is &#8211; out clients &hellip; <a href=\"https:\/\/blog.wiseowls.co.nz\/index.php\/2019\/09\/13\/monitoring-sql-server-setting-up-elkg\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Monitoring SQL Server: setting up ELK+G&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":465,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[7],"tags":[38],"class_list":["post-428","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-infrastructure","tag-monitoring"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Monitoring SQL Server: setting up ELK+G - Timur and associates<\/title>\n<meta name=\"description\" content=\"Setting up ELK+G stack to monitor SQL Server. Docker Compose, sensible defaults, and getting Grafana talking to Elasticsearch.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/blog.wiseowls.co.nz\/index.php\/2019\/09\/13\/monitoring-sql-server-setting-up-elkg\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Monitoring SQL Server: setting up ELK+G - Timur and associates\" \/>\n<meta property=\"og:description\" content=\"Setting up ELK+G stack to monitor SQL Server. Docker Compose, sensible defaults, and getting Grafana talking to Elasticsearch.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/blog.wiseowls.co.nz\/index.php\/2019\/09\/13\/monitoring-sql-server-setting-up-elkg\/\" \/>\n<meta property=\"og:site_name\" content=\"Timur and associates\" \/>\n<meta property=\"article:published_time\" content=\"2019-09-12T16:05:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-03-07T11:44:45+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/blog.wiseowls.co.nz\/wp-content\/uploads\/2020\/03\/elk_1920.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1920\" \/>\n\t<meta property=\"og:image:height\" content=\"778\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"timur\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@TimurKh\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/blog.wiseowls.co.nz\\\/index.php\\\/2019\\\/09\\\/13\\\/monitoring-sql-server-setting-up-elkg\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/blog.wiseowls.co.nz\\\/index.php\\\/2019\\\/09\\\/13\\\/monitoring-sql-server-setting-up-elkg\\\/\"},\"author\":{\"name\":\"timur\",\"@id\":\"https:\\\/\\\/blog.wiseowls.co.nz\\\/#\\\/schema\\\/person\\\/34d0ed30d573b5bc317ea990bd2e0c59\"},\"headline\":\"Monitoring SQL Server: setting up ELK+G\",\"datePublished\":\"2019-09-12T16:05:00+00:00\",\"dateModified\":\"2026-03-07T11:44:45+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/blog.wiseowls.co.nz\\\/index.php\\\/2019\\\/09\\\/13\\\/monitoring-sql-server-setting-up-elkg\\\/\"},\"wordCount\":311,\"image\":{\"@id\":\"https:\\\/\\\/blog.wiseowls.co.nz\\\/index.php\\\/2019\\\/09\\\/13\\\/monitoring-sql-server-setting-up-elkg\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/blog.wiseowls.co.nz\\\/wp-content\\\/uploads\\\/2020\\\/03\\\/elk_1920.jpg\",\"keywords\":[\"monitoring\"],\"articleSection\":[\"Infrastructure\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/blog.wiseowls.co.nz\\\/index.php\\\/2019\\\/09\\\/13\\\/monitoring-sql-server-setting-up-elkg\\\/\",\"url\":\"https:\\\/\\\/blog.wiseowls.co.nz\\\/index.php\\\/2019\\\/09\\\/13\\\/monitoring-sql-server-setting-up-elkg\\\/\",\"name\":\"Monitoring SQL Server: setting up ELK+G - Timur and associates\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/blog.wiseowls.co.nz\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/blog.wiseowls.co.nz\\\/index.php\\\/2019\\\/09\\\/13\\\/monitoring-sql-server-setting-up-elkg\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/blog.wiseowls.co.nz\\\/index.php\\\/2019\\\/09\\\/13\\\/monitoring-sql-server-setting-up-elkg\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/blog.wiseowls.co.nz\\\/wp-content\\\/uploads\\\/2020\\\/03\\\/elk_1920.jpg\",\"datePublished\":\"2019-09-12T16:05:00+00:00\",\"dateModified\":\"2026-03-07T11:44:45+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/blog.wiseowls.co.nz\\\/#\\\/schema\\\/person\\\/34d0ed30d573b5bc317ea990bd2e0c59\"},\"description\":\"Setting up ELK+G stack to monitor SQL Server. Docker Compose, sensible defaults, and getting Grafana talking to Elasticsearch.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/blog.wiseowls.co.nz\\\/index.php\\\/2019\\\/09\\\/13\\\/monitoring-sql-server-setting-up-elkg\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/blog.wiseowls.co.nz\\\/index.php\\\/2019\\\/09\\\/13\\\/monitoring-sql-server-setting-up-elkg\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/blog.wiseowls.co.nz\\\/index.php\\\/2019\\\/09\\\/13\\\/monitoring-sql-server-setting-up-elkg\\\/#primaryimage\",\"url\":\"https:\\\/\\\/blog.wiseowls.co.nz\\\/wp-content\\\/uploads\\\/2020\\\/03\\\/elk_1920.jpg\",\"contentUrl\":\"https:\\\/\\\/blog.wiseowls.co.nz\\\/wp-content\\\/uploads\\\/2020\\\/03\\\/elk_1920.jpg\",\"width\":1920,\"height\":778},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/blog.wiseowls.co.nz\\\/index.php\\\/2019\\\/09\\\/13\\\/monitoring-sql-server-setting-up-elkg\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/blog.wiseowls.co.nz\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Monitoring SQL Server: setting up ELK+G\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/blog.wiseowls.co.nz\\\/#website\",\"url\":\"https:\\\/\\\/blog.wiseowls.co.nz\\\/\",\"name\":\"Timur and associates\",\"description\":\"Notes of an IT contractor\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/blog.wiseowls.co.nz\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/blog.wiseowls.co.nz\\\/#\\\/schema\\\/person\\\/34d0ed30d573b5bc317ea990bd2e0c59\",\"name\":\"timur\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/23d55e17d4f0990ee4d12bc6e5dcfb58a292934efd62a185756876379e780b16?s=96&r=pg\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/23d55e17d4f0990ee4d12bc6e5dcfb58a292934efd62a185756876379e780b16?s=96&r=pg\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/23d55e17d4f0990ee4d12bc6e5dcfb58a292934efd62a185756876379e780b16?s=96&r=pg\",\"caption\":\"timur\"},\"sameAs\":[\"https:\\\/\\\/x.com\\\/TimurKh\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Monitoring SQL Server: setting up ELK+G - Timur and associates","description":"Setting up ELK+G stack to monitor SQL Server. Docker Compose, sensible defaults, and getting Grafana talking to Elasticsearch.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/blog.wiseowls.co.nz\/index.php\/2019\/09\/13\/monitoring-sql-server-setting-up-elkg\/","og_locale":"en_US","og_type":"article","og_title":"Monitoring SQL Server: setting up ELK+G - Timur and associates","og_description":"Setting up ELK+G stack to monitor SQL Server. Docker Compose, sensible defaults, and getting Grafana talking to Elasticsearch.","og_url":"https:\/\/blog.wiseowls.co.nz\/index.php\/2019\/09\/13\/monitoring-sql-server-setting-up-elkg\/","og_site_name":"Timur and associates","article_published_time":"2019-09-12T16:05:00+00:00","article_modified_time":"2026-03-07T11:44:45+00:00","og_image":[{"width":1920,"height":778,"url":"https:\/\/blog.wiseowls.co.nz\/wp-content\/uploads\/2020\/03\/elk_1920.jpg","type":"image\/jpeg"}],"author":"timur","twitter_card":"summary_large_image","twitter_creator":"@TimurKh","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/blog.wiseowls.co.nz\/index.php\/2019\/09\/13\/monitoring-sql-server-setting-up-elkg\/#article","isPartOf":{"@id":"https:\/\/blog.wiseowls.co.nz\/index.php\/2019\/09\/13\/monitoring-sql-server-setting-up-elkg\/"},"author":{"name":"timur","@id":"https:\/\/blog.wiseowls.co.nz\/#\/schema\/person\/34d0ed30d573b5bc317ea990bd2e0c59"},"headline":"Monitoring SQL Server: setting up ELK+G","datePublished":"2019-09-12T16:05:00+00:00","dateModified":"2026-03-07T11:44:45+00:00","mainEntityOfPage":{"@id":"https:\/\/blog.wiseowls.co.nz\/index.php\/2019\/09\/13\/monitoring-sql-server-setting-up-elkg\/"},"wordCount":311,"image":{"@id":"https:\/\/blog.wiseowls.co.nz\/index.php\/2019\/09\/13\/monitoring-sql-server-setting-up-elkg\/#primaryimage"},"thumbnailUrl":"https:\/\/blog.wiseowls.co.nz\/wp-content\/uploads\/2020\/03\/elk_1920.jpg","keywords":["monitoring"],"articleSection":["Infrastructure"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/blog.wiseowls.co.nz\/index.php\/2019\/09\/13\/monitoring-sql-server-setting-up-elkg\/","url":"https:\/\/blog.wiseowls.co.nz\/index.php\/2019\/09\/13\/monitoring-sql-server-setting-up-elkg\/","name":"Monitoring SQL Server: setting up ELK+G - Timur and associates","isPartOf":{"@id":"https:\/\/blog.wiseowls.co.nz\/#website"},"primaryImageOfPage":{"@id":"https:\/\/blog.wiseowls.co.nz\/index.php\/2019\/09\/13\/monitoring-sql-server-setting-up-elkg\/#primaryimage"},"image":{"@id":"https:\/\/blog.wiseowls.co.nz\/index.php\/2019\/09\/13\/monitoring-sql-server-setting-up-elkg\/#primaryimage"},"thumbnailUrl":"https:\/\/blog.wiseowls.co.nz\/wp-content\/uploads\/2020\/03\/elk_1920.jpg","datePublished":"2019-09-12T16:05:00+00:00","dateModified":"2026-03-07T11:44:45+00:00","author":{"@id":"https:\/\/blog.wiseowls.co.nz\/#\/schema\/person\/34d0ed30d573b5bc317ea990bd2e0c59"},"description":"Setting up ELK+G stack to monitor SQL Server. Docker Compose, sensible defaults, and getting Grafana talking to Elasticsearch.","breadcrumb":{"@id":"https:\/\/blog.wiseowls.co.nz\/index.php\/2019\/09\/13\/monitoring-sql-server-setting-up-elkg\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/blog.wiseowls.co.nz\/index.php\/2019\/09\/13\/monitoring-sql-server-setting-up-elkg\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/blog.wiseowls.co.nz\/index.php\/2019\/09\/13\/monitoring-sql-server-setting-up-elkg\/#primaryimage","url":"https:\/\/blog.wiseowls.co.nz\/wp-content\/uploads\/2020\/03\/elk_1920.jpg","contentUrl":"https:\/\/blog.wiseowls.co.nz\/wp-content\/uploads\/2020\/03\/elk_1920.jpg","width":1920,"height":778},{"@type":"BreadcrumbList","@id":"https:\/\/blog.wiseowls.co.nz\/index.php\/2019\/09\/13\/monitoring-sql-server-setting-up-elkg\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/blog.wiseowls.co.nz\/"},{"@type":"ListItem","position":2,"name":"Monitoring SQL Server: setting up ELK+G"}]},{"@type":"WebSite","@id":"https:\/\/blog.wiseowls.co.nz\/#website","url":"https:\/\/blog.wiseowls.co.nz\/","name":"Timur and associates","description":"Notes of an IT contractor","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/blog.wiseowls.co.nz\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/blog.wiseowls.co.nz\/#\/schema\/person\/34d0ed30d573b5bc317ea990bd2e0c59","name":"timur","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/23d55e17d4f0990ee4d12bc6e5dcfb58a292934efd62a185756876379e780b16?s=96&r=pg","url":"https:\/\/secure.gravatar.com\/avatar\/23d55e17d4f0990ee4d12bc6e5dcfb58a292934efd62a185756876379e780b16?s=96&r=pg","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/23d55e17d4f0990ee4d12bc6e5dcfb58a292934efd62a185756876379e780b16?s=96&r=pg","caption":"timur"},"sameAs":["https:\/\/x.com\/TimurKh"]}]}},"_links":{"self":[{"href":"https:\/\/blog.wiseowls.co.nz\/index.php\/wp-json\/wp\/v2\/posts\/428","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.wiseowls.co.nz\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.wiseowls.co.nz\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.wiseowls.co.nz\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.wiseowls.co.nz\/index.php\/wp-json\/wp\/v2\/comments?post=428"}],"version-history":[{"count":6,"href":"https:\/\/blog.wiseowls.co.nz\/index.php\/wp-json\/wp\/v2\/posts\/428\/revisions"}],"predecessor-version":[{"id":993,"href":"https:\/\/blog.wiseowls.co.nz\/index.php\/wp-json\/wp\/v2\/posts\/428\/revisions\/993"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.wiseowls.co.nz\/index.php\/wp-json\/wp\/v2\/media\/465"}],"wp:attachment":[{"href":"https:\/\/blog.wiseowls.co.nz\/index.php\/wp-json\/wp\/v2\/media?parent=428"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.wiseowls.co.nz\/index.php\/wp-json\/wp\/v2\/categories?post=428"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.wiseowls.co.nz\/index.php\/wp-json\/wp\/v2\/tags?post=428"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}