Skip to content

Commit

Permalink
Merge pull request #62 from ExpediaGroup/feature/added_datadog_annota…
Browse files Browse the repository at this point in the history
…tions

Datadog annotations for sending metrics to Datadog
  • Loading branch information
DhrubajyotiSadhu authored Aug 30, 2024
2 parents 052b134 + 91c2e7a commit 9d8907f
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [5.1.0] - 2024-08-30
### Added
- Added datadog annotations to send metrics from `scheduler-apiary`, `metadata-cleanup`, `path-cleanup` to DD.

## [5.0.5] - 2024-08-21
### Fixed
- Add `copy_tags_to_snapshot` to aws_rds_cluster.
Expand Down
3 changes: 3 additions & 0 deletions k8s-metadata-cleanup.tf
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ resource "kubernetes_deployment_v1" "beekeeper_metadata_cleanup" {
metadata {
labels = local.metadata_cleanup_label_name_instance
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\": [ \"${join("\",\"", var.beekeeper_metadata_cleanup_metrics)}\"] }]"
"prometheus.io/scrape" : var.prometheus_enabled
"prometheus.io/port" : var.k8s_metadata_cleanup_port
"prometheus.io/path" : "/actuator/prometheus"
Expand Down
3 changes: 3 additions & 0 deletions k8s-path-cleanup.tf
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ resource "kubernetes_deployment_v1" "beekeeper_path_cleanup" {
metadata {
labels = local.path_cleanup_label_name_instance
annotations = {
"ad.datadoghq.com/${local.path_cleanup_full_name}.check_names": "[\"openmetrics\"]"
"ad.datadoghq.com/${local.path_cleanup_full_name}.init_configs": "[{}]"
"ad.datadoghq.com/${local.path_cleanup_full_name}.instances": "[{ \"prometheus_url\": \"http://%%host%%:8008/actuator/prometheus\", \"namespace\": \"${local.instance_alias}\", \"metrics\": [ \"${join("\",\"", var.beekeeper_path_cleanup_metrics)}\"] }]"
"prometheus.io/scrape" : var.prometheus_enabled
"prometheus.io/port" : var.k8s_path_cleanup_port
"prometheus.io/path" : "/actuator/prometheus"
Expand Down
3 changes: 3 additions & 0 deletions k8s-scheduler-apiary.tf
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ resource "kubernetes_deployment_v1" "beekeeper_scheduler_apiary" {
metadata {
labels = local.scheduler_apiary_label_name_instance
annotations = {
"ad.datadoghq.com/${local.scheduler_apiary_full_name}.check_names": "[\"openmetrics\"]"
"ad.datadoghq.com/${local.scheduler_apiary_full_name}.init_configs": "[{}]"
"ad.datadoghq.com/${local.scheduler_apiary_full_name}.instances": "[{ \"prometheus_url\": \"http://%%host%%:8080/actuator/prometheus\", \"namespace\": \"${local.instance_alias}\", \"metrics\": [ \"${join("\",\"", var.beekeeper_scheduler_apiary_metrics)}\"] }]"
"prometheus.io/scrape" : var.prometheus_enabled
"prometheus.io/port" : var.k8s_scheduler_apiary_port
"prometheus.io/path" : "/actuator/prometheus"
Expand Down
33 changes: 33 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -570,3 +570,36 @@ variable "db_copy_tags_to_snapshot" {
type = bool
default = true
}

variable "beekeeper_metadata_cleanup_metrics" {
description = "Beekeeper 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*"
]
}

variable "beekeeper_scheduler_apiary_metrics" {
description = "Beekeeper metrics to be sent to Datadog."
type = list(string)
default = [
"path_cleanup_job_seconds_sum*"
]
}

variable "beekeeper_path_cleanup_metrics" {
description = "Beekeeper metrics to be sent to Datadog."
type = list(string)
default = [
"path_cleanup_job_seconds_sum*"
]
}

0 comments on commit 9d8907f

Please sign in to comment.