Skip to content

Commit 16a121e

Browse files
authored
Merge pull request #6 from kabisa/renovate/configure
Configure Renovate
2 parents 3708a3a + c8e1c8e commit 16a121e

26 files changed

+241
-123
lines changed

.github/workflows/documentation.yaml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Generate terraform docs
2+
3+
on:
4+
push:
5+
# don't run when we push a tag
6+
tags-ignore:
7+
- '*'
8+
# don't run when we merge to main
9+
# the action should have run already
10+
branches-ignore:
11+
- 'main'
12+
jobs:
13+
pre-commit:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: terraform-linters/setup-tflint@v2
17+
name: Setup TFLint
18+
with:
19+
tflint_version: v0.38.1
20+
- uses: actions/checkout@v3
21+
- uses: actions/setup-python@v4
22+
- uses: pre-commit/[email protected]
23+
# pre-commit fails if it changed files
24+
# we want to go on
25+
continue-on-error: true
26+
- uses: pre-commit/[email protected]
27+
- uses: EndBug/add-and-commit@v9
28+
with:
29+
default_author: github_actions

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
.terraform
2+
examples/.terraform.lock.hcl

.pre-commit-config.yaml

+2-3
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@ repos:
55
- id: terraform-fmt
66
- id: terraform-validate
77
- id: tflint
8-
- repo: git@github.com:kabisa/terraform-datadog-pre-commit-hook.git
9-
rev: "0.1.15"
8+
- repo: https://github.com/kabisa/terraform-datadog-pre-commit-hook
9+
rev: "1.3.6"
1010
hooks:
1111
- id: terraform-datadog-docs
12-
exclude: ^README.md$
1312
args:
1413
- "."

.terraform.lock.hcl

+18-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

+129-88
Large diffs are not rendered by default.

apm-hosts-variables.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@ variable "apm_hosts_priority" {
4242

4343
type = number
4444
default = 4
45-
}
45+
}

apm-hosts.tf

+3-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ locals {
66
}
77

88
module "apm_hosts" {
9-
source = "[email protected]:kabisa/terraform-datadog-generic-monitor.git?ref=0.7.0"
9+
source = "kabisa/generic-monitor/datadog"
10+
version = "1.0.0"
1011

1112
name = "Estimated APM Hosts Usage"
1213
query = "avg(${var.apm_hosts_evaluation_period}):sum:datadog.estimated_usage.apm_hosts{${local.apm_hosts_filter}} > ${var.apm_hosts_critical}"
@@ -23,7 +24,7 @@ module "apm_hosts" {
2324
note = var.apm_hosts_note
2425

2526
# module level vars
26-
env = var.alert_env
27+
env = var.env
2728
service = var.service
2829
notification_channel = var.notification_channel
2930
additional_tags = var.additional_tags

apm-spans-variables.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,4 @@ variable "apm_spans_priority" {
4141

4242
type = number
4343
default = 3
44-
}
44+
}

apm-spans.tf

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ locals {
44
}
55

66
module "apm_spans" {
7-
source = "[email protected]:kabisa/terraform-datadog-generic-monitor.git?ref=0.7.0"
7+
source = "kabisa/generic-monitor/datadog"
8+
version = "1.0.0"
89

910
name = "Estimated APM Analyzed Spans Usage"
1011
query = "sum(${var.apm_spans_evaluation_period}):sum:datadog.estimated_usage.apm.indexed_spans{${local.apm_spans_filter}}.as_count() > ${var.apm_spans_critical}"
@@ -21,7 +22,7 @@ module "apm_spans" {
2122
note = var.apm_spans_note
2223

2324
# module level vars
24-
env = var.alert_env
25+
env = var.env
2526
service = var.service
2627
notification_channel = var.notification_channel
2728
additional_tags = var.additional_tags

containers-variables.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@ variable "containers_priority" {
4242

4343
type = number
4444
default = 4
45-
}
45+
}

containers.tf

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ locals {
44
}
55

66
module "containers" {
7-
source = "[email protected]:kabisa/terraform-datadog-generic-monitor.git?ref=0.7.0"
7+
source = "kabisa/generic-monitor/datadog"
8+
version = "1.0.0"
89

910
name = "Estimated Containers Usage"
1011
query = "avg(${var.containers_evaluation_period}):sum:datadog.estimated_usage.containers{${local.containers_filter}} > ${var.containers_critical}"
@@ -21,7 +22,7 @@ module "containers" {
2122
note = var.containers_note
2223

2324
# module level vars
24-
env = var.alert_env
25+
env = var.env
2526
service = var.service
2627
notification_channel = var.notification_channel
2728
additional_tags = var.additional_tags

custom-metrics-variables.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@ variable "custom_metrics_priority" {
4242

4343
type = number
4444
default = 4
45-
}
45+
}

custom-metrics.tf

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ locals {
44
}
55

66
module "custom_metrics" {
7-
source = "[email protected]:kabisa/terraform-datadog-generic-monitor.git?ref=0.7.0"
7+
source = "kabisa/generic-monitor/datadog"
8+
version = "1.0.0"
89

910
name = "Estimated Custom Metrics Usage"
1011
query = "avg(${var.custom_metrics_evaluation_period}):sum:datadog.estimated_usage.metrics.custom{${local.custom_metrics_filter}} > ${var.custom_metrics_critical}"
@@ -21,7 +22,7 @@ module "custom_metrics" {
2122
note = var.custom_metrics_note
2223

2324
# module level vars
24-
env = var.alert_env
25+
env = var.env
2526
service = var.service
2627
notification_channel = var.notification_channel
2728
additional_tags = var.additional_tags

examples/example.tf

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# tflint-ignore: terraform_module_version
2+
module "costs" {
3+
source = "kabisa/costs/datadog"
4+
5+
notification_channel = "@[email protected]"
6+
env = "prd"
7+
alert_env = "prd"
8+
9+
# Example config, please adjust
10+
filter_str = "*"
11+
apm_hosts_critical = 2
12+
apm_spans_critical = 1000000
13+
apm_spans_warning = 800000
14+
containers_critical = 375
15+
custom_metrics_critical = 10000
16+
hosts_critical = 20
17+
logs_indexed_critical = 150000
18+
logs_ingestion_4h_critical = 208000000
19+
logs_ingestion_critical = 850000000
20+
logs_ingestion_warning = 600000000
21+
}

hosts-variables.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@ variable "hosts_priority" {
4242

4343
type = number
4444
default = 4
45-
}
45+
}

hosts.tf

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ locals {
44
}
55

66
module "hosts" {
7-
source = "[email protected]:kabisa/terraform-datadog-generic-monitor.git?ref=0.7.0"
7+
source = "kabisa/generic-monitor/datadog"
8+
version = "1.0.0"
89

910
name = "Estimated Hosts Usage"
1011
query = "avg(${var.hosts_evaluation_period}):sum:datadog.estimated_usage.hosts{${local.hosts_filter}} > ${var.hosts_critical}"
@@ -21,7 +22,7 @@ module "hosts" {
2122
note = var.hosts_note
2223

2324
# module level vars
24-
env = var.alert_env
25+
env = var.env
2526
service = var.service
2627
notification_channel = var.notification_channel
2728
additional_tags = var.additional_tags

logs-indexed-variables.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@ variable "logs_indexed_priority" {
4242

4343
type = number
4444
default = 3
45-
}
45+
}

logs-indexed.tf

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ locals {
44
}
55

66
module "logs_indexed" {
7-
source = "[email protected]:kabisa/terraform-datadog-generic-monitor.git?ref=0.7.0"
7+
source = "kabisa/generic-monitor/datadog"
8+
version = "1.0.0"
89

910
name = "Indexed Logs"
1011
query = "sum(${var.logs_indexed_evaluation_period}):sum:custom_datadog.estimated_usage.logs.ingested_events{${local.logs_indexed_filter}}.as_count() > ${var.logs_indexed_critical}"
@@ -21,7 +22,7 @@ module "logs_indexed" {
2122
note = var.logs_indexed_note
2223

2324
# module level vars
24-
env = var.alert_env
25+
env = var.env
2526
service = var.service
2627
notification_channel = var.notification_channel
2728
additional_tags = var.additional_tags

logs-ingestion-4h-variables.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,4 @@ variable "logs_ingestion_4h_priority" {
4343

4444
type = number
4545
default = 3
46-
}
46+
}

logs-ingestion-4h.tf

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ locals {
44
}
55

66
module "logs_ingestion_4h" {
7-
source = "[email protected]:kabisa/terraform-datadog-generic-monitor.git?ref=0.7.0"
7+
source = "kabisa/generic-monitor/datadog"
8+
version = "1.0.0"
89

910
name = "Logs ingestion high"
1011
query = "sum(${var.logs_ingestion_4h_evaluation_period}):sum:custom_datadog.estimated_usage.logs.ingested_bytes{${local.logs_ingestion_4h_filter}}.as_count() > ${var.logs_ingestion_4h_critical}"
@@ -21,7 +22,7 @@ module "logs_ingestion_4h" {
2122
note = var.logs_ingestion_4h_note
2223

2324
# module level vars
24-
env = var.alert_env
25+
env = var.env
2526
service = var.service
2627
notification_channel = var.notification_channel
2728
additional_tags = var.additional_tags

logs-ingestion-variables.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,4 @@ variable "logs_ingestion_priority" {
4141

4242
type = number
4343
default = 3
44-
}
44+
}

logs-ingestion.tf

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ locals {
44
}
55

66
module "logs_ingestion" {
7-
source = "[email protected]:kabisa/terraform-datadog-generic-monitor.git?ref=0.7.0"
7+
source = "kabisa/generic-monitor/datadog"
8+
version = "1.0.0"
89

910
name = "Daily Logs Ingestion"
1011
query = "sum(${var.logs_ingestion_evaluation_period}):sum:custom_datadog.estimated_usage.logs.ingested_bytes{${local.logs_ingestion_filter}}.as_count() > ${var.logs_ingestion_critical}"
@@ -21,7 +22,7 @@ module "logs_ingestion" {
2122
note = var.logs_ingestion_note
2223

2324
# module level vars
24-
env = var.alert_env
25+
env = var.env
2526
service = var.service
2627
notification_channel = var.notification_channel
2728
additional_tags = var.additional_tags

module_description.md

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
This module will set up alerts to make sure you don't suddenly overspend on you datadog bill.
2+
It will also generate a costs dashboard

provider.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ terraform {
22
required_providers {
33
datadog = {
44
source = "DataDog/datadog"
5-
version = "~> 3.4"
5+
version = "~> 3.12"
66
}
77
}
88
}

renovate.json

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3+
"extends": [
4+
"config:base"
5+
]
6+
}

variables.tf

-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@ variable "env" {
22
type = string
33
}
44

5-
variable "alert_env" {
6-
type = string
7-
}
8-
95
variable "service" {
106
type = string
117
default = "Costs"

0 commit comments

Comments
 (0)