{"id":47714508,"url":"https://github.com/kabisa/terraform-datadog-sql-server","last_synced_at":"2026-04-02T18:49:01.803Z","repository":{"id":39970954,"uuid":"395256583","full_name":"kabisa/terraform-datadog-sql-server","owner":"kabisa","description":null,"archived":false,"fork":false,"pushed_at":"2026-02-25T17:00:44.000Z","size":31,"stargazers_count":0,"open_issues_count":7,"forks_count":0,"subscribers_count":5,"default_branch":"main","last_synced_at":"2026-02-25T20:29:31.980Z","etag":null,"topics":["datadog","monitoring","sql-server","terraform"],"latest_commit_sha":null,"homepage":"","language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kabisa.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-08-12T08:57:22.000Z","updated_at":"2022-01-30T18:30:11.000Z","dependencies_parsed_at":"2026-02-25T19:02:13.865Z","dependency_job_id":null,"html_url":"https://github.com/kabisa/terraform-datadog-sql-server","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":"kabisa/terraform-module-template","purl":"pkg:github/kabisa/terraform-datadog-sql-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kabisa%2Fterraform-datadog-sql-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kabisa%2Fterraform-datadog-sql-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kabisa%2Fterraform-datadog-sql-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kabisa%2Fterraform-datadog-sql-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kabisa","download_url":"https://codeload.github.com/kabisa/terraform-datadog-sql-server/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kabisa%2Fterraform-datadog-sql-server/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31313403,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T12:59:32.332Z","status":"ssl_error","status_checked_at":"2026-04-02T12:54:48.875Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["datadog","monitoring","sql-server","terraform"],"created_at":"2026-04-02T18:48:57.804Z","updated_at":"2026-04-02T18:49:01.795Z","avatar_url":"https://github.com/kabisa.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n![Datadog](https://imgix.datadoghq.com/img/about/presskit/logo-v/dd_vertical_purple.png)\n\n[//]: # (This file is generated. Do not edit, module description can be added by editing / creating module_description.md)\n\n# Terraform module for Datadog Sql Server\n\nThis module requires the [sql server integration](https://docs.datadoghq.com/integrations/sqlserver/?tab=host) to be configured.\nIt has basic SQL Server monitoring. Locks, process blocked, connectivity.\nIt's best to also use Datadog's APM instrumentation to understand the way the application is using the database.\nThere's an upcoming feature in Datadog to fully support deep dive database monitoring.\n\nThis module is part of a larger suite of modules that provide alerts in Datadog.\nOther modules can be found on the [Terraform Registry](https://registry.terraform.io/search/modules?namespace=kabisa\u0026provider=datadog)\n\nWe have two base modules we use to standardise development of our Monitor Modules:\n- [generic monitor](https://github.com/kabisa/terraform-datadog-generic-monitor) Used in 90% of our alerts\n- [service check monitor](https://github.com/kabisa/terraform-datadog-service-check-monitor)\n\nModules are generated with this tool: https://github.com/kabisa/datadog-terraform-generator\n\n# Example Usage\n\n```terraform\nmodule \"sql_server\" {\n  source = \"kabisa/sql-server/datadog\"\n\n  notification_channel       = \"@mail@example.com\"\n  service                    = \"SQL Server\"\n  env                        = \"prd\"\n  filter_str                 = \"role:sqlserver\"\n  service_check_include_tags = [\"role:sqlserver\"]\n}\n\n```\n\n\n[Module Variables](#module-variables)\n\nMonitors:\n\n| Monitor name    | Default enabled | Priority | Query                  |\n|-----------------|------|----|------------------------|\n| [Batches Compiled Percent](#batches-compiled-percent) | True | 4  | `avg(last_1d):(max:sqlserver.stats.sql_compilations{tag:xxx} by {host} / max:sqlserver.stats.batch_requests{tag:xxx} by {host}) * 100 \u003e= 20` |\n| [Buffer Cache Hit Ratio](#buffer-cache-hit-ratio) | True | 4  | `avg(last_1d):min:sqlserver.buffer.cache_hit_ratio{tag:xxx} by {host} * 100 \u003c 75` |\n| [Connections](#connections) | True | 3  | `avg(last_30m):max:sqlserver.stats.connections{tag:xxx} by {host} \u003e= 500` |\n| [Database State](#database-state) | True | 1  | `max(last_5m):max:sqlserver.database.state{tag:xxx} by {host,database,database_state_desc} \u003e= 5` |\n| [Lock Waits](#lock-waits) | True | 4  | `avg(last_30m):max:sqlserver.stats.lock_waits{tag:xxx} by {host} \u003e 20` |\n| [Page Life Expectancy](#page-life-expectancy) | True | 4  | `avg(last_1d):min:sqlserver.buffer.page_life_expectancy{tag:xxx} by {host} \u003c 900` |\n| [Procs Blocked](#procs-blocked) | True | 3  | `avg(last_10m):max:sqlserver.stats.procs_blocked{tag:xxx} by {host} \u003e= 1` |\n\n# Getting started developing\n[pre-commit](http://pre-commit.com/) was used to do Terraform linting and validating.\n\nSteps:\n   - Install [pre-commit](http://pre-commit.com/). E.g. `brew install pre-commit`.\n   - Run `pre-commit install` in this repo. (Every time you clone a repo with pre-commit enabled you will need to run the pre-commit install command)\n   - That’s it! Now every time you commit a code change (`.tf` file), the hooks in the `hooks:` config `.pre-commit-config.yaml` will execute.\n\n## Batches Compiled Percent\n\nWhen this metric is high, a lot of queries need to be recompiled. Consider parameterizing more queries by using stored procedures, using forced parameterization or allocating more memory.\n\nQuery:\n```terraform\navg(last_1d):(max:sqlserver.stats.sql_compilations{tag:xxx} by {host} / max:sqlserver.stats.batch_requests{tag:xxx} by {host}) * 100 \u003e= 20\n```\n\n| variable                                   | default                                  | required | description                      |\n|--------------------------------------------|------------------------------------------|----------|----------------------------------|\n| batches_compiled_percent_enabled           | True                                     | No       |                                  |\n| batches_compiled_percent_warning           | 10                                       | No       |                                  |\n| batches_compiled_percent_critical          | 20                                       | No       |                                  |\n| batches_compiled_percent_evaluation_period | last_1d                                  | No       |                                  |\n| batches_compiled_percent_note              | \"\"                                       | No       |                                  |\n| batches_compiled_percent_docs              | When this metric is high, a lot of queries need to be recompiled. Consider parameterizing more queries by using stored procedures, using forced parameterization or allocating more memory. | No       |                                  |\n| batches_compiled_percent_filter_override   | \"\"                                       | No       |                                  |\n| batches_compiled_percent_alerting_enabled  | True                                     | No       |                                  |\n| batches_compiled_percent_priority          | 4                                        | No       | Number from 1 (high) to 5 (low). |\n\n\n## Buffer Cache Hit Ratio\n\nWhen this metric is low, pages are often read from disk. Consider allocating more memory.\n\nQuery:\n```terraform\navg(last_1d):min:sqlserver.buffer.cache_hit_ratio{tag:xxx} by {host} * 100 \u003c 75\n```\n\n| variable                                 | default                                  | required | description                      |\n|------------------------------------------|------------------------------------------|----------|----------------------------------|\n| buffer_cache_hit_ratio_enabled           | True                                     | No       |                                  |\n| buffer_cache_hit_ratio_warning           | 90                                       | No       |                                  |\n| buffer_cache_hit_ratio_critical          | 75                                       | No       |                                  |\n| buffer_cache_hit_ratio_evaluation_period | last_1d                                  | No       |                                  |\n| buffer_cache_hit_ratio_note              | \"\"                                       | No       |                                  |\n| buffer_cache_hit_ratio_docs              | When this metric is low, pages are often read from disk. Consider allocating more memory. | No       |                                  |\n| buffer_cache_hit_ratio_filter_override   | \"\"                                       | No       |                                  |\n| buffer_cache_hit_ratio_alerting_enabled  | True                                     | No       |                                  |\n| buffer_cache_hit_ratio_priority          | 4                                        | No       | Number from 1 (high) to 5 (low). |\n\n\n## Can Connect\n\n| variable                     | default  | required | description  |\n|------------------------------|----------|----------|--------------|\n| can_connect_enabled          | True     | No       |              |\n| can_connect_alerting_enabled | True     | No       |              |\n| can_connect_warning          | 1        | No       |              |\n| can_connect_critical         | 1        | No       |              |\n| can_connect_priority         | 1        | No       |              |\n| can_connect_docs             | \"\"       | No       |              |\n| can_connect_note             | \"\"       | No       |              |\n\n\n## Connections\n\nQuery:\n```terraform\navg(last_30m):max:sqlserver.stats.connections{tag:xxx} by {host} \u003e= 500\n```\n\n| variable                      | default  | required | description                      |\n|-------------------------------|----------|----------|----------------------------------|\n| connections_enabled           | True     | No       |                                  |\n| connections_warning           | 400      | No       |                                  |\n| connections_critical          | 500      | No       |                                  |\n| connections_evaluation_period | last_30m | No       |                                  |\n| connections_note              | \"\"       | No       |                                  |\n| connections_docs              | \"\"       | No       |                                  |\n| connections_filter_override   | \"\"       | No       |                                  |\n| connections_alerting_enabled  | True     | No       |                                  |\n| connections_priority          | 3        | No       | Number from 1 (high) to 5 (low). |\n\n\n## Database State\n\nQuery:\n```terraform\nmax(last_5m):max:sqlserver.database.state{tag:xxx} by {host,database,database_state_desc} \u003e= 5\n```\n\n| variable                         | default  | required | description                      |\n|----------------------------------|----------|----------|----------------------------------|\n| database_state_enabled           | True     | No       |                                  |\n| database_state_warning           | 1        | No       |                                  |\n| database_state_critical          | 5        | No       |                                  |\n| database_state_evaluation_period | last_5m  | No       |                                  |\n| database_state_note              | \"\"       | No       |                                  |\n| database_state_docs              | \"\"       | No       |                                  |\n| database_state_filter_override   | \"\"       | No       |                                  |\n| database_state_alerting_enabled  | True     | No       |                                  |\n| database_state_priority          | 1        | No       | Number from 1 (high) to 5 (low). |\n\n\n## Lock Waits\n\nHigh numbers of lock waits per second is caused by lock contention. Try reducing lock contention by using more fine grained locking in the queries.\n\nQuery:\n```terraform\navg(last_30m):max:sqlserver.stats.lock_waits{tag:xxx} by {host} \u003e 20\n```\n\n| variable                     | default                                  | required | description                      |\n|------------------------------|------------------------------------------|----------|----------------------------------|\n| lock_waits_enabled           | True                                     | No       |                                  |\n| lock_waits_warning           | 10                                       | No       |                                  |\n| lock_waits_critical          | 20                                       | No       |                                  |\n| lock_waits_evaluation_period | last_30m                                 | No       |                                  |\n| lock_waits_note              | \"\"                                       | No       |                                  |\n| lock_waits_docs              | High numbers of lock waits per second is caused by lock contention. Try reducing lock contention by using more fine grained locking in the queries. | No       |                                  |\n| lock_waits_filter_override   | \"\"                                       | No       |                                  |\n| lock_waits_alerting_enabled  | True                                     | No       |                                  |\n| lock_waits_priority          | 4                                        | No       | Number from 1 (high) to 5 (low). |\n\n\n## Page Life Expectancy\n\nWhen this metric is low, pages are not being cached for a short time and often read from disk. Consider allocating more memory.\n\nQuery:\n```terraform\navg(last_1d):min:sqlserver.buffer.page_life_expectancy{tag:xxx} by {host} \u003c 900\n```\n\n| variable                               | default                                  | required | description                      |\n|----------------------------------------|------------------------------------------|----------|----------------------------------|\n| page_life_expectancy_enabled           | True                                     | No       |                                  |\n| page_life_expectancy_warning           | 1800                                     | No       |                                  |\n| page_life_expectancy_critical          | 900                                      | No       |                                  |\n| page_life_expectancy_evaluation_period | last_1d                                  | No       |                                  |\n| page_life_expectancy_note              | \"\"                                       | No       |                                  |\n| page_life_expectancy_docs              | When this metric is low, pages are not being cached for a short time and often read from disk. Consider allocating more memory. | No       |                                  |\n| page_life_expectancy_filter_override   | \"\"                                       | No       |                                  |\n| page_life_expectancy_alerting_enabled  | True                                     | No       |                                  |\n| page_life_expectancy_priority          | 4                                        | No       | Number from 1 (high) to 5 (low). |\n\n\n## Procs Blocked\n\nHigh number of procs blocked can indicate deadlocks. Check for deadlocks by investigating which queries are waiting for locks to be released.\n\nQuery:\n```terraform\navg(last_10m):max:sqlserver.stats.procs_blocked{tag:xxx} by {host} \u003e= 1\n```\n\n| variable                        | default                                  | required | description                      |\n|---------------------------------|------------------------------------------|----------|----------------------------------|\n| procs_blocked_enabled           | True                                     | No       |                                  |\n| procs_blocked_warning           | None                                     | No       |                                  |\n| procs_blocked_critical          | 1                                        | No       |                                  |\n| procs_blocked_evaluation_period | last_10m                                 | No       |                                  |\n| procs_blocked_note              | \"\"                                       | No       |                                  |\n| procs_blocked_docs              | High number of procs blocked can indicate deadlocks. Check for deadlocks by investigating which queries are waiting for locks to be released. | No       |                                  |\n| procs_blocked_filter_override   | \"\"                                       | No       |                                  |\n| procs_blocked_alerting_enabled  | True                                     | No       |                                  |\n| procs_blocked_priority          | 3                                        | No       | Number from 1 (high) to 5 (low). |\n\n\n## Module Variables\n\n| variable                   | default  | required | description  |\n|----------------------------|----------|----------|--------------|\n| env                        |          | Yes      |              |\n| filter_str                 |          | Yes      |              |\n| service                    |          | Yes      |              |\n| notification_channel       |          | Yes      |              |\n| additional_tags            | []       | No       |              |\n| name_prefix                | \"\"       | No       |              |\n| name_suffix                | \"\"       | No       |              |\n| locked                     | True     | No       |              |\n| service_check_include_tags | None     | No       |              |\n| service_check_exclude_tags | None     | No       |              |\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkabisa%2Fterraform-datadog-sql-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkabisa%2Fterraform-datadog-sql-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkabisa%2Fterraform-datadog-sql-server/lists"}