From 47d307ff2520505fae532956529747c86bd77139 Mon Sep 17 00:00:00 2001 From: Dhrubajyoti Sadhu Date: Fri, 30 Aug 2024 14:34:00 +0100 Subject: [PATCH] feat: Added datadog annotations for sending metrics to DD --- k8s-metadata-cleanup.tf | 2 +- variables.tf | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/k8s-metadata-cleanup.tf b/k8s-metadata-cleanup.tf index b00e98f..b54c378 100644 --- a/k8s-metadata-cleanup.tf +++ b/k8s-metadata-cleanup.tf @@ -40,7 +40,7 @@ resource "kubernetes_deployment_v1" "beekeeper_metadata_cleanup" { annotations = { "ad.datadoghq.com/${local.metadata_cleanup_full_name}.check_names": "[\"openmetrics\"]" "ad.datadoghq.com/${local.metadata_cleanup_full_name}.init_configs": "[{}]" - "ad.datadoghq.com/${local.metadata_cleanup_full_name}.instances": "[{ \"prometheus_url\": \"http://%%host%%:9008/actuator/prometheus\", \"namespace\": \"${local.instance_alias}\", \"metrics\": [\"s3_bytes_deleted_bytes_total*\", \"hive_table_metadata_deleted_total*\",\"hive_partition_metadata_deleted_total*\",\"s3_paths_deleted_seconds_sum*\", \"s3_paths_deleted_seconds_count*\", \"metadata_cleanup_job_seconds_sum*\", \"hive_table_deleted_seconds_count*\", \"disk_*\", \"jvm*\", \"hikaricp*\"] }]" + "ad.datadoghq.com/${local.metadata_cleanup_full_name}.instances": "[{ \"prometheus_url\": \"http://%%host%%:9008/actuator/prometheus\", \"namespace\": \"${local.instance_alias}\", \"metrics\": [ \"${join("\",\"", var.beekeeper_metrics)}\" ]}]" "prometheus.io/scrape" : var.prometheus_enabled "prometheus.io/port" : var.k8s_metadata_cleanup_port "prometheus.io/path" : "/actuator/prometheus" diff --git a/variables.tf b/variables.tf index 65996e9..f837ac3 100644 --- a/variables.tf +++ b/variables.tf @@ -570,3 +570,20 @@ variable "db_copy_tags_to_snapshot" { type = bool default = true } + +variable "beekeeper_metrics" { + description = "WaggleDance metrics to be sent to Datadog." + type = list(string) + default = [ + "s3_bytes_deleted_bytes_total*", + "hive_table_metadata_deleted_total*", + "hive_partition_metadata_deleted_total*", + "s3_paths_deleted_seconds_sum*", + "s3_paths_deleted_seconds_count*", + "metadata_cleanup_job_seconds_sum*", + "hive_table_deleted_seconds_count*", + "disk_*", + "jvm*", + "hikaricp*" + ] +}