homelab-nomad/core/metrics/metrics.tf

53 lines
975 B
HCL

resource "nomad_job" "exporters" {
hcl2 {
enabled = true
}
jobspec = file("${path.module}/exporters.nomad")
}
resource "nomad_job" "prometheus" {
hcl2 {
enabled = true
}
jobspec = file("${path.module}/prometheus.nomad")
}
resource "nomad_job" "grafana" {
hcl2 {
enabled = true
}
jobspec = templatefile("${path.module}/grafana.nomad", {
module_path = path.module
})
depends_on = [nomad_job.prometheus]
}
# resource "consul_config_entry" "prometheus_intent" {
# name = "prometheus"
# kind = "service-intentions"
#
# config_json = jsonencode({
# Sources = [
# {
# Action = "allow"
# Name = "grafana"
# Precedence = 9
# Type = "consul"
# },
# ]
# })
# }
# resource "consul_config_entry" "envoy_prometheus_bind" {
# name = "global"
# kind = "proxy-defaults"
#
# config_json = jsonencode({
# "envoy_prometheus_bind_addr" = "0.0.0.0:9102"
# })
# }