Skip to content

Commit

Permalink
Merge pull request #6 from kabisa/renovate/configure
Browse files Browse the repository at this point in the history
Configure Renovate
  • Loading branch information
obeleh authored Jul 22, 2022
2 parents 3708a3a + c8e1c8e commit 16a121e
Show file tree
Hide file tree
Showing 26 changed files with 241 additions and 123 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/documentation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Generate terraform docs

on:
push:
# don't run when we push a tag
tags-ignore:
- '*'
# don't run when we merge to main
# the action should have run already
branches-ignore:
- 'main'
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: terraform-linters/setup-tflint@v2
name: Setup TFLint
with:
tflint_version: v0.38.1
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: pre-commit/action@v3.0.0
# pre-commit fails if it changed files
# we want to go on
continue-on-error: true
- uses: pre-commit/action@v3.0.0
- uses: EndBug/add-and-commit@v9
with:
default_author: github_actions
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.terraform
examples/.terraform.lock.hcl
5 changes: 2 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@ repos:
- id: terraform-fmt
- id: terraform-validate
- id: tflint
- repo: git@github.com:kabisa/terraform-datadog-pre-commit-hook.git
rev: "0.1.15"
- repo: https://github.com/kabisa/terraform-datadog-pre-commit-hook
rev: "1.3.6"
hooks:
- id: terraform-datadog-docs
exclude: ^README.md$
args:
- "."
21 changes: 18 additions & 3 deletions .terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

217 changes: 129 additions & 88 deletions README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion apm-hosts-variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ variable "apm_hosts_priority" {

type = number
default = 4
}
}
5 changes: 3 additions & 2 deletions apm-hosts.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ locals {
}

module "apm_hosts" {
source = "git@github.com:kabisa/terraform-datadog-generic-monitor.git?ref=0.7.0"
source = "kabisa/generic-monitor/datadog"
version = "1.0.0"

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

# module level vars
env = var.alert_env
env = var.env
service = var.service
notification_channel = var.notification_channel
additional_tags = var.additional_tags
Expand Down
2 changes: 1 addition & 1 deletion apm-spans-variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ variable "apm_spans_priority" {

type = number
default = 3
}
}
5 changes: 3 additions & 2 deletions apm-spans.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ locals {
}

module "apm_spans" {
source = "git@github.com:kabisa/terraform-datadog-generic-monitor.git?ref=0.7.0"
source = "kabisa/generic-monitor/datadog"
version = "1.0.0"

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

# module level vars
env = var.alert_env
env = var.env
service = var.service
notification_channel = var.notification_channel
additional_tags = var.additional_tags
Expand Down
2 changes: 1 addition & 1 deletion containers-variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ variable "containers_priority" {

type = number
default = 4
}
}
5 changes: 3 additions & 2 deletions containers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ locals {
}

module "containers" {
source = "git@github.com:kabisa/terraform-datadog-generic-monitor.git?ref=0.7.0"
source = "kabisa/generic-monitor/datadog"
version = "1.0.0"

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

# module level vars
env = var.alert_env
env = var.env
service = var.service
notification_channel = var.notification_channel
additional_tags = var.additional_tags
Expand Down
2 changes: 1 addition & 1 deletion custom-metrics-variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ variable "custom_metrics_priority" {

type = number
default = 4
}
}
5 changes: 3 additions & 2 deletions custom-metrics.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ locals {
}

module "custom_metrics" {
source = "git@github.com:kabisa/terraform-datadog-generic-monitor.git?ref=0.7.0"
source = "kabisa/generic-monitor/datadog"
version = "1.0.0"

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

# module level vars
env = var.alert_env
env = var.env
service = var.service
notification_channel = var.notification_channel
additional_tags = var.additional_tags
Expand Down
21 changes: 21 additions & 0 deletions examples/example.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# tflint-ignore: terraform_module_version
module "costs" {
source = "kabisa/costs/datadog"

notification_channel = "@mail@example.com"
env = "prd"
alert_env = "prd"

# Example config, please adjust
filter_str = "*"
apm_hosts_critical = 2
apm_spans_critical = 1000000
apm_spans_warning = 800000
containers_critical = 375
custom_metrics_critical = 10000
hosts_critical = 20
logs_indexed_critical = 150000
logs_ingestion_4h_critical = 208000000
logs_ingestion_critical = 850000000
logs_ingestion_warning = 600000000
}
2 changes: 1 addition & 1 deletion hosts-variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ variable "hosts_priority" {

type = number
default = 4
}
}
5 changes: 3 additions & 2 deletions hosts.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ locals {
}

module "hosts" {
source = "git@github.com:kabisa/terraform-datadog-generic-monitor.git?ref=0.7.0"
source = "kabisa/generic-monitor/datadog"
version = "1.0.0"

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

# module level vars
env = var.alert_env
env = var.env
service = var.service
notification_channel = var.notification_channel
additional_tags = var.additional_tags
Expand Down
2 changes: 1 addition & 1 deletion logs-indexed-variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ variable "logs_indexed_priority" {

type = number
default = 3
}
}
5 changes: 3 additions & 2 deletions logs-indexed.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ locals {
}

module "logs_indexed" {
source = "git@github.com:kabisa/terraform-datadog-generic-monitor.git?ref=0.7.0"
source = "kabisa/generic-monitor/datadog"
version = "1.0.0"

name = "Indexed Logs"
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}"
Expand All @@ -21,7 +22,7 @@ module "logs_indexed" {
note = var.logs_indexed_note

# module level vars
env = var.alert_env
env = var.env
service = var.service
notification_channel = var.notification_channel
additional_tags = var.additional_tags
Expand Down
2 changes: 1 addition & 1 deletion logs-ingestion-4h-variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ variable "logs_ingestion_4h_priority" {

type = number
default = 3
}
}
5 changes: 3 additions & 2 deletions logs-ingestion-4h.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ locals {
}

module "logs_ingestion_4h" {
source = "git@github.com:kabisa/terraform-datadog-generic-monitor.git?ref=0.7.0"
source = "kabisa/generic-monitor/datadog"
version = "1.0.0"

name = "Logs ingestion high"
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}"
Expand All @@ -21,7 +22,7 @@ module "logs_ingestion_4h" {
note = var.logs_ingestion_4h_note

# module level vars
env = var.alert_env
env = var.env
service = var.service
notification_channel = var.notification_channel
additional_tags = var.additional_tags
Expand Down
2 changes: 1 addition & 1 deletion logs-ingestion-variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ variable "logs_ingestion_priority" {

type = number
default = 3
}
}
5 changes: 3 additions & 2 deletions logs-ingestion.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ locals {
}

module "logs_ingestion" {
source = "git@github.com:kabisa/terraform-datadog-generic-monitor.git?ref=0.7.0"
source = "kabisa/generic-monitor/datadog"
version = "1.0.0"

name = "Daily Logs Ingestion"
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}"
Expand All @@ -21,7 +22,7 @@ module "logs_ingestion" {
note = var.logs_ingestion_note

# module level vars
env = var.alert_env
env = var.env
service = var.service
notification_channel = var.notification_channel
additional_tags = var.additional_tags
Expand Down
2 changes: 2 additions & 0 deletions module_description.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This module will set up alerts to make sure you don't suddenly overspend on you datadog bill.
It will also generate a costs dashboard
2 changes: 1 addition & 1 deletion provider.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ terraform {
required_providers {
datadog = {
source = "DataDog/datadog"
version = "~> 3.4"
version = "~> 3.12"
}
}
}
6 changes: 6 additions & 0 deletions renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:base"
]
}
4 changes: 0 additions & 4 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@ variable "env" {
type = string
}

variable "alert_env" {
type = string
}

variable "service" {
type = string
default = "Costs"
Expand Down

0 comments on commit 16a121e

Please sign in to comment.