From 4a7bff7611f6830cb8b6402d5acf09c1b9fd2683 Mon Sep 17 00:00:00 2001 From: Ian Fijolek Date: Thu, 24 Aug 2023 13:00:36 -0700 Subject: [PATCH] Move metrics out of a module and into core --- .secrets-baseline | 16 ++++---- core/{metrics => }/exporters.nomad | 0 core/{metrics => }/grafana.nomad | 0 core/{metrics => }/grafana/grafana.ini | 0 .../dashboards/default/blocky-query.json | 0 .../dashboards/default/blocky.json | 0 .../dashboards/default/minitor-monitor.json | 0 .../dashboards/default/nomad.json | 0 .../dashboards/default/prometheus.json | 0 .../dashboards/default/traefik.json | 0 .../grafana/provisioning/dashboards/main.yml | 0 .../grafana/provisioning/datasources/loki.yml | 0 .../provisioning/datasources/mysql.yml | 0 .../provisioning/datasources/prometheus.yml | 0 .../grafana/provisioning/notifiers/main.yml | 0 .../grafana/provisioning/notifiers/slack.yml | 0 core/main.tf | 8 ---- core/{metrics => }/metrics.tf | 0 core/metrics/.terraform.lock.hcl | 40 ------------------- core/metrics/vars.tf | 5 --- core/{metrics => }/prometheus.nomad | 0 21 files changed, 8 insertions(+), 61 deletions(-) rename core/{metrics => }/exporters.nomad (100%) rename core/{metrics => }/grafana.nomad (100%) rename core/{metrics => }/grafana/grafana.ini (100%) rename core/{metrics => }/grafana/provisioning/dashboards/default/blocky-query.json (100%) rename core/{metrics => }/grafana/provisioning/dashboards/default/blocky.json (100%) rename core/{metrics => }/grafana/provisioning/dashboards/default/minitor-monitor.json (100%) rename core/{metrics => }/grafana/provisioning/dashboards/default/nomad.json (100%) rename core/{metrics => }/grafana/provisioning/dashboards/default/prometheus.json (100%) rename core/{metrics => }/grafana/provisioning/dashboards/default/traefik.json (100%) rename core/{metrics => }/grafana/provisioning/dashboards/main.yml (100%) rename core/{metrics => }/grafana/provisioning/datasources/loki.yml (100%) rename core/{metrics => }/grafana/provisioning/datasources/mysql.yml (100%) rename core/{metrics => }/grafana/provisioning/datasources/prometheus.yml (100%) rename core/{metrics => }/grafana/provisioning/notifiers/main.yml (100%) rename core/{metrics => }/grafana/provisioning/notifiers/slack.yml (100%) rename core/{metrics => }/metrics.tf (100%) delete mode 100644 core/metrics/.terraform.lock.hcl delete mode 100644 core/metrics/vars.tf rename core/{metrics => }/prometheus.nomad (100%) diff --git a/.secrets-baseline b/.secrets-baseline index 1399974..555a136 100644 --- a/.secrets-baseline +++ b/.secrets-baseline @@ -136,10 +136,10 @@ "is_secret": false } ], - "core/metrics/grafana/grafana.ini": [ + "core/grafana/grafana.ini": [ { "type": "Basic Auth Credentials", - "filename": "core/metrics/grafana/grafana.ini", + "filename": "core/grafana/grafana.ini", "hashed_secret": "e5e9fa1ba31ecd1ae84f75caaa474f3a663f05f4", "is_verified": false, "line_number": 78, @@ -147,7 +147,7 @@ }, { "type": "Secret Keyword", - "filename": "core/metrics/grafana/grafana.ini", + "filename": "core/grafana/grafana.ini", "hashed_secret": "55ebda65c08313526e7ba08ad733e5ebea9900bd", "is_verified": false, "line_number": 109, @@ -155,7 +155,7 @@ }, { "type": "Secret Keyword", - "filename": "core/metrics/grafana/grafana.ini", + "filename": "core/grafana/grafana.ini", "hashed_secret": "d033e22ae348aeb5660fc2140aec35850c4da997", "is_verified": false, "line_number": 151, @@ -163,7 +163,7 @@ }, { "type": "Secret Keyword", - "filename": "core/metrics/grafana/grafana.ini", + "filename": "core/grafana/grafana.ini", "hashed_secret": "10bea62ff1e1a7540dc7a6bc10f5fa992349023f", "is_verified": false, "line_number": 154, @@ -171,7 +171,7 @@ }, { "type": "Secret Keyword", - "filename": "core/metrics/grafana/grafana.ini", + "filename": "core/grafana/grafana.ini", "hashed_secret": "5718bce97710e6be87ea160b36eaefb5032857d3", "is_verified": false, "line_number": 239, @@ -179,7 +179,7 @@ }, { "type": "Secret Keyword", - "filename": "core/metrics/grafana/grafana.ini", + "filename": "core/grafana/grafana.ini", "hashed_secret": "10aed9d7ebef778a9b3033dba3f7813b639e0d50", "is_verified": false, "line_number": 252, @@ -187,5 +187,5 @@ } ] }, - "generated_at": "2023-07-25T23:48:05Z" + "generated_at": "2023-08-24T20:00:24Z" } diff --git a/core/metrics/exporters.nomad b/core/exporters.nomad similarity index 100% rename from core/metrics/exporters.nomad rename to core/exporters.nomad diff --git a/core/metrics/grafana.nomad b/core/grafana.nomad similarity index 100% rename from core/metrics/grafana.nomad rename to core/grafana.nomad diff --git a/core/metrics/grafana/grafana.ini b/core/grafana/grafana.ini similarity index 100% rename from core/metrics/grafana/grafana.ini rename to core/grafana/grafana.ini diff --git a/core/metrics/grafana/provisioning/dashboards/default/blocky-query.json b/core/grafana/provisioning/dashboards/default/blocky-query.json similarity index 100% rename from core/metrics/grafana/provisioning/dashboards/default/blocky-query.json rename to core/grafana/provisioning/dashboards/default/blocky-query.json diff --git a/core/metrics/grafana/provisioning/dashboards/default/blocky.json b/core/grafana/provisioning/dashboards/default/blocky.json similarity index 100% rename from core/metrics/grafana/provisioning/dashboards/default/blocky.json rename to core/grafana/provisioning/dashboards/default/blocky.json diff --git a/core/metrics/grafana/provisioning/dashboards/default/minitor-monitor.json b/core/grafana/provisioning/dashboards/default/minitor-monitor.json similarity index 100% rename from core/metrics/grafana/provisioning/dashboards/default/minitor-monitor.json rename to core/grafana/provisioning/dashboards/default/minitor-monitor.json diff --git a/core/metrics/grafana/provisioning/dashboards/default/nomad.json b/core/grafana/provisioning/dashboards/default/nomad.json similarity index 100% rename from core/metrics/grafana/provisioning/dashboards/default/nomad.json rename to core/grafana/provisioning/dashboards/default/nomad.json diff --git a/core/metrics/grafana/provisioning/dashboards/default/prometheus.json b/core/grafana/provisioning/dashboards/default/prometheus.json similarity index 100% rename from core/metrics/grafana/provisioning/dashboards/default/prometheus.json rename to core/grafana/provisioning/dashboards/default/prometheus.json diff --git a/core/metrics/grafana/provisioning/dashboards/default/traefik.json b/core/grafana/provisioning/dashboards/default/traefik.json similarity index 100% rename from core/metrics/grafana/provisioning/dashboards/default/traefik.json rename to core/grafana/provisioning/dashboards/default/traefik.json diff --git a/core/metrics/grafana/provisioning/dashboards/main.yml b/core/grafana/provisioning/dashboards/main.yml similarity index 100% rename from core/metrics/grafana/provisioning/dashboards/main.yml rename to core/grafana/provisioning/dashboards/main.yml diff --git a/core/metrics/grafana/provisioning/datasources/loki.yml b/core/grafana/provisioning/datasources/loki.yml similarity index 100% rename from core/metrics/grafana/provisioning/datasources/loki.yml rename to core/grafana/provisioning/datasources/loki.yml diff --git a/core/metrics/grafana/provisioning/datasources/mysql.yml b/core/grafana/provisioning/datasources/mysql.yml similarity index 100% rename from core/metrics/grafana/provisioning/datasources/mysql.yml rename to core/grafana/provisioning/datasources/mysql.yml diff --git a/core/metrics/grafana/provisioning/datasources/prometheus.yml b/core/grafana/provisioning/datasources/prometheus.yml similarity index 100% rename from core/metrics/grafana/provisioning/datasources/prometheus.yml rename to core/grafana/provisioning/datasources/prometheus.yml diff --git a/core/metrics/grafana/provisioning/notifiers/main.yml b/core/grafana/provisioning/notifiers/main.yml similarity index 100% rename from core/metrics/grafana/provisioning/notifiers/main.yml rename to core/grafana/provisioning/notifiers/main.yml diff --git a/core/metrics/grafana/provisioning/notifiers/slack.yml b/core/grafana/provisioning/notifiers/slack.yml similarity index 100% rename from core/metrics/grafana/provisioning/notifiers/slack.yml rename to core/grafana/provisioning/notifiers/slack.yml diff --git a/core/main.tf b/core/main.tf index 4001dc8..ace746b 100644 --- a/core/main.tf +++ b/core/main.tf @@ -14,14 +14,6 @@ module "traefik" { base_hostname = var.base_hostname } -module "metrics" { - source = "./metrics" - use_wesher = var.use_wesher - - # Not in this module - # depends_on = [module.databases] -} - resource "nomad_job" "nomad-client-stalker" { # Stalker used to allow using Nomad service registry to identify nomad client hosts jobspec = file("${path.module}/nomad-client-stalker.nomad") diff --git a/core/metrics/metrics.tf b/core/metrics.tf similarity index 100% rename from core/metrics/metrics.tf rename to core/metrics.tf diff --git a/core/metrics/.terraform.lock.hcl b/core/metrics/.terraform.lock.hcl deleted file mode 100644 index b5be304..0000000 --- a/core/metrics/.terraform.lock.hcl +++ /dev/null @@ -1,40 +0,0 @@ -# This file is maintained automatically by "terraform init". -# Manual edits may be lost in future updates. - -provider "registry.terraform.io/hashicorp/consul" { - version = "2.15.0" - hashes = [ - "h1:o+Su3YqeOkHgf86GEArIVDZfaZQphYFjAOwpi/b0bzs=", - "h1:tAb2gwW+oZ8/t2j7lExdqpNrxmaWsHbyA2crFWClPb0=", - "zh:0bd2a9873099d89bd52e9eee623dd20ccb275d1e2f750da229a53a4d5b23450c", - "zh:1c9f87d4d97b2c61d006c0bef159d61d2a661a103025f8276ebbeb000129f931", - "zh:25b73a34115255c464be10a53f2510c4a1db958a71be31974d30654d5472e624", - "zh:32fa31329731db2bf4b7d0f09096416ca146f05b58f4482bbd4ee0f28cefbbcc", - "zh:59136b73d3abe7cc5b06d9e12d123ad21298ca86ed49a4060a3cd7c2a28a74a1", - "zh:a191f3210773ca25c543a92f2d392b85e6a053d596293655b1f25b33eb843b4c", - "zh:b8b6033cf0687eadc1099f11d9fb2ca9429ff40c2d85bd6cb047c0f6bc5d5d8d", - "zh:bb7d67ed28aa9b28fc5154161af003383f940b2beda0d4577857cad700f39cd1", - "zh:be615288f59327b975532a1999deab60a022e6819fe80e5a32526155210ecbba", - "zh:de1e3d5c34eef87eb301e74717754babb6dc8e19e3a964919e1165c5a076a719", - "zh:eb8c61b20d8ce2bfff9f735ca8456a0d6368af13aa1f43866f61c70f88cc491c", - ] -} - -provider "registry.terraform.io/hashicorp/nomad" { - version = "1.4.16" - hashes = [ - "h1:PQxNPNmMVOErxryTWIJwr22k95DTSODmgRylqjc2TjI=", - "h1:tyfjD/maKzb0RxxD9KWgLnkJu9lnYziYsQgGw85Giz8=", - "zh:0d4fbb7030d9caac3b123e60afa44f50c83cc2a983e1866aec7f30414abe7b0e", - "zh:0db080228e07c72d6d8ca8c45249d6f97cd0189fce82a77abbdcd49a52e57572", - "zh:0df88393271078533a217654b96f0672c60eb59570d72e6aefcb839eea87a7a0", - "zh:2883b335bb6044b0db6a00e602d6926c047c7f330294a73a90d089f98b24d084", - "zh:390158d928009a041b3a182bdd82376b50530805ae92be2b84ed7c3b0fa902a0", - "zh:7169b8f8df4b8e9659c49043848fd5f7f8473d0471f67815e8b04980f827f5ef", - "zh:9417ee1383b1edd137024882d7035be4dca51fb4f725ca00ed87729086ec1755", - "zh:a22910b5a29eeab5610350700b4899267c1b09b66cf21f7e4d06afc61d425800", - "zh:a6185c9cd7aa458cd81861058ba568b6411fbac344373a20155e20256f4a7557", - "zh:b6260ca9f034df1b47905b4e2a9c33b67dbf77224a694d5b10fb09ae92ffad4c", - "zh:d87c12a6a7768f2b6c2a59495c7dc00f9ecc52b1b868331d4c284f791e278a1e", - ] -} diff --git a/core/metrics/vars.tf b/core/metrics/vars.tf deleted file mode 100644 index aa5858a..0000000 --- a/core/metrics/vars.tf +++ /dev/null @@ -1,5 +0,0 @@ -variable "use_wesher" { - type = bool - description = "Indicates whether or not services should expose themselves on the wesher network" - default = true -} diff --git a/core/metrics/prometheus.nomad b/core/prometheus.nomad similarity index 100% rename from core/metrics/prometheus.nomad rename to core/prometheus.nomad