Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement AWS managed agentless collector for Prometheus metrics #260

Closed
45 changes: 45 additions & 0 deletions modules/eks-monitoring/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -258,3 +258,48 @@ module "external_secrets" {

depends_on = [resource.helm_release.grafana_operator]
}

resource "aws_prometheus_workspace" "this" {

tags = {
bonclay7 marked this conversation as resolved.
Show resolved Hide resolved
AMPAgentlessScraper = ""
}
}


resource "aws_prometheus_scraper" "basic" {
alias = "managed-prometheus-scraper"

source {
eks{
cluster_arn = data.aws_eks_cluster.eks_cluster.arn
subnet_ids = data.aws_eks_cluster.eks_cluster.vpc_config[0].subnet_ids

}

}


scrape_configuration= templatefile("${path.module}/prom_config.yaml",
{ global_scrape_interval = var.prometheus_config.global_scrape_interval,
global_scrape_timeout = var.prometheus_config.global_scrape_timeout,
enableAPIserver = var.enable_apiserver_monitoring,
eks_cluster_id = var.eks_cluster_id,
region = var.managed_prometheus_workspace_region,
accountID = local.context.aws_caller_identity_account_id
})

destination {
amp {
workspace_arn = "arn:aws:aps:${var.managed_prometheus_workspace_region}:${local.context.aws_caller_identity_account_id}:workspace/${var.managed_prometheus_workspace_id}"
}
}

tags = {
bonclay7 marked this conversation as resolved.
Show resolved Hide resolved
CreatedBy = "Terraform"
Owner = "AWS Observability Accelerator"
}

}


Loading
Loading