Skip to content

Commit

Permalink
Make dashboard configurations overridable
Browse files Browse the repository at this point in the history
  • Loading branch information
bonclay7 committed Sep 26, 2023
1 parent a05e82b commit 42db731
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 33 deletions.
4 changes: 2 additions & 2 deletions modules/eks-monitoring/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ See examples using this Terraform modules in the **Amazon EKS** section of [this
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_adot_loglevel"></a> [adot\_loglevel](#input\_adot\_loglevel) | Verbosity level for ADOT collector logs. This accepts (detailed\|normal\|basic), see https://aws-otel.github.io/docs/components/misc-exporters for mor infos. | `string` | `"normal"` | no |
| <a name="input_adothealth_monitoring_config"></a> [adothealth\_monitoring\_config](#input\_adothealth\_monitoring\_config) | Config object for ADOT health monitoring | <pre>object({<br> flux_gitrepository_name = string<br> flux_gitrepository_url = string<br> flux_gitrepository_branch = string<br> flux_kustomization_name = string<br> flux_kustomization_path = string<br><br> dashboards = object({<br> grafana_adothealth_dashboard_url = string<br> })<br> })</pre> | `null` | no |
| <a name="input_adothealth_monitoring_config"></a> [adothealth\_monitoring\_config](#input\_adothealth\_monitoring\_config) | Config object for ADOT health monitoring | <pre>object({<br> flux_gitrepository_name = string<br> flux_gitrepository_url = string<br> flux_gitrepository_branch = string<br> flux_kustomization_name = string<br> flux_kustomization_path = string<br><br> dashboards = object({<br> health = string<br> })<br> })</pre> | `null` | no |
| <a name="input_apiserver_monitoring_config"></a> [apiserver\_monitoring\_config](#input\_apiserver\_monitoring\_config) | Config object for API server monitoring | <pre>object({<br> flux_gitrepository_name = string<br> flux_gitrepository_url = string<br> flux_gitrepository_branch = string<br> flux_kustomization_name = string<br> flux_kustomization_path = string<br><br> dashboards = object({<br> basic = string<br> advanced = string<br> troubleshooting = string<br> })<br> })</pre> | `null` | no |
| <a name="input_custom_metrics_config"></a> [custom\_metrics\_config](#input\_custom\_metrics\_config) | Configuration object to enable custom metrics collection | <pre>map(object({<br> enableBasicAuth = bool<br> path = string<br> basicAuthUsername = string<br> basicAuthPassword = string<br> ports = string<br> droppedSeriesPrefixes = string<br> }))</pre> | `null` | no |
| <a name="input_eks_cluster_id"></a> [eks\_cluster\_id](#input\_eks\_cluster\_id) | EKS Cluster Id | `string` | n/a | yes |
Expand Down Expand Up @@ -114,7 +114,7 @@ See examples using this Terraform modules in the **Amazon EKS** section of [this
| <a name="input_istio_config"></a> [istio\_config](#input\_istio\_config) | Configuration object for ISTIO monitoring | <pre>object({<br> enable_alerting_rules = bool<br> enable_recording_rules = bool<br> enable_dashboards = bool<br> scrape_sample_limit = number<br><br> flux_gitrepository_name = string<br> flux_gitrepository_url = string<br> flux_gitrepository_branch = string<br> flux_kustomization_name = string<br> flux_kustomization_path = string<br><br> managed_prometheus_workspace_id = string<br> prometheus_metrics_endpoint = string<br><br> dashboards = object({<br> cp = string<br> mesh = string<br> performance = string<br> service = string<br> })<br> })</pre> | `null` | no |
| <a name="input_java_config"></a> [java\_config](#input\_java\_config) | Configuration object for Java/JMX monitoring | <pre>object({<br> enable_alerting_rules = bool<br> enable_recording_rules = bool<br> enable_dashboards = bool<br> scrape_sample_limit = number<br><br><br> flux_gitrepository_name = string<br> flux_gitrepository_url = string<br> flux_gitrepository_branch = string<br> flux_kustomization_name = string<br> flux_kustomization_path = string<br><br> grafana_dashboard_url = string<br><br> prometheus_metrics_endpoint = string<br> })</pre> | `null` | no |
| <a name="input_ksm_config"></a> [ksm\_config](#input\_ksm\_config) | Kube State metrics configuration | <pre>object({<br> create_namespace = bool<br> k8s_namespace = string<br> helm_chart_name = string<br> helm_chart_version = string<br> helm_release_name = string<br> helm_repo_url = string<br> helm_settings = map(string)<br> helm_values = map(any)<br><br> scrape_interval = string<br> scrape_timeout = string<br> })</pre> | <pre>{<br> "create_namespace": true,<br> "helm_chart_name": "kube-state-metrics",<br> "helm_chart_version": "4.24.0",<br> "helm_release_name": "kube-state-metrics",<br> "helm_repo_url": "https://prometheus-community.github.io/helm-charts",<br> "helm_settings": {},<br> "helm_values": {},<br> "k8s_namespace": "kube-system",<br> "scrape_interval": "60s",<br> "scrape_timeout": "15s"<br>}</pre> | no |
| <a name="input_kubeproxy_monitoring_config"></a> [kubeproxy\_monitoring\_config](#input\_kubeproxy\_monitoring\_config) | Config object for kube-proxy monitoring | <pre>object({<br> flux_gitrepository_name = string<br> flux_gitrepository_url = string<br> flux_gitrepository_branch = string<br> flux_kustomization_name = string<br> flux_kustomization_path = string<br><br> dashboards = object({<br> grafana_kubeproxy_dashboard_url = string<br> })<br> })</pre> | `null` | no |
| <a name="input_kubeproxy_monitoring_config"></a> [kubeproxy\_monitoring\_config](#input\_kubeproxy\_monitoring\_config) | Config object for kube-proxy monitoring | <pre>object({<br> flux_gitrepository_name = string<br> flux_gitrepository_url = string<br> flux_gitrepository_branch = string<br> flux_kustomization_name = string<br> flux_kustomization_path = string<br><br> dashboards = object({<br> default = string<br> })<br> })</pre> | `null` | no |
| <a name="input_logs_config"></a> [logs\_config](#input\_logs\_config) | Configuration object for logs collection | <pre>object({<br> cw_log_retention_days = number<br> })</pre> | <pre>{<br> "cw_log_retention_days": 90<br>}</pre> | no |
| <a name="input_managed_prometheus_workspace_endpoint"></a> [managed\_prometheus\_workspace\_endpoint](#input\_managed\_prometheus\_workspace\_endpoint) | Amazon Managed Prometheus Workspace Endpoint | `string` | `""` | no |
| <a name="input_managed_prometheus_workspace_id"></a> [managed\_prometheus\_workspace\_id](#input\_managed\_prometheus\_workspace\_id) | Amazon Managed Prometheus Workspace ID | `string` | `null` | no |
Expand Down
58 changes: 29 additions & 29 deletions modules/eks-monitoring/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ locals {

scrape_sample_limit = 1000

flux_gitrepository_name = "aws-observability-accelerator"
flux_gitrepository_url = "https://github.com/aws-observability/aws-observability-accelerator"
flux_gitrepository_branch = "v0.2.0"
flux_gitrepository_name = var.flux_gitrepository_name
flux_gitrepository_url = var.flux_gitrepository_url
flux_gitrepository_branch = var.flux_gitrepository_branch
flux_kustomization_name = "grafana-dashboards-java"
flux_kustomization_path = "./artifacts/grafana-operator-manifests/eks/java"

Expand All @@ -60,9 +60,9 @@ locals {

scrape_sample_limit = 1000

flux_gitrepository_name = "aws-observability-accelerator"
flux_gitrepository_url = "https://github.com/aws-observability/aws-observability-accelerator"
flux_gitrepository_branch = "v0.2.0"
flux_gitrepository_name = var.flux_gitrepository_name
flux_gitrepository_url = var.flux_gitrepository_url
flux_gitrepository_branch = var.flux_gitrepository_branch
flux_kustomization_name = "grafana-dashboards-nginx"
flux_kustomization_path = "./artifacts/grafana-operator-manifests/eks/nginx"

Expand All @@ -81,9 +81,9 @@ locals {

scrape_sample_limit = 1000

flux_gitrepository_name = "aws-observability-accelerator"
flux_gitrepository_url = "https://github.com/aws-observability/aws-observability-accelerator"
flux_gitrepository_branch = "v0.2.0"
flux_gitrepository_name = var.flux_gitrepository_name
flux_gitrepository_url = var.flux_gitrepository_url
flux_gitrepository_branch = var.flux_gitrepository_branch
flux_kustomization_name = "grafana-dashboards-istio"
flux_kustomization_path = "./artifacts/grafana-operator-manifests/eks/istio"

Expand All @@ -100,42 +100,42 @@ locals {

apiserver_monitoring_config = {
# can be overriden by providing a config
flux_gitrepository_name = "aws-observability-accelerator"
flux_gitrepository_url = "https://github.com/aws-observability/aws-observability-accelerator"
flux_gitrepository_branch = "v0.2.0"
flux_kustomization_name = "grafana-dashboards-apiserver"
flux_kustomization_path = "./artifacts/grafana-operator-manifests/eks/apiserver"
flux_gitrepository_name = try(var.apiserver_monitoring_config.flux_gitrepository_name, var.flux_gitrepository_name)
flux_gitrepository_url = try(var.apiserver_monitoring_config.flux_gitrepository_url, var.flux_gitrepository_url)
flux_gitrepository_branch = try(var.apiserver_monitoring_config.flux_gitrepository_branch, var.flux_gitrepository_branch)
flux_kustomization_name = try(var.apiserver_monitoring_config.flux_kustomization_name, "grafana-dashboards-apiserver")
flux_kustomization_path = try(var.apiserver_monitoring_config.flux_kustomization_path, "./artifacts/grafana-operator-manifests/eks/apiserver")

dashboards = {
basic = "https://raw.githubusercontent.com/aws-observability/aws-observability-accelerator/v0.2.0/artifacts/grafana-dashboards/eks/apiserver/apiserver-basic.json"
advanced = "https://raw.githubusercontent.com/aws-observability/aws-observability-accelerator/v0.2.0/artifacts/grafana-dashboards/eks/apiserver/apiserver-advanced.json"
troubleshooting = "https://raw.githubusercontent.com/aws-observability/aws-observability-accelerator/v0.2.0/artifacts/grafana-dashboards/eks/apiserver/apiserver-troubleshooting.json"
basic = try(var.apiserver_monitoring_config.dashboards.basic, "https://raw.githubusercontent.com/aws-observability/aws-observability-accelerator/v0.2.0/artifacts/grafana-dashboards/eks/apiserver/apiserver-basic.json")
advanced = try(var.apiserver_monitoring_config.dashboards.advanced, "https://raw.githubusercontent.com/aws-observability/aws-observability-accelerator/v0.2.0/artifacts/grafana-dashboards/eks/apiserver/apiserver-advanced.json")
troubleshooting = try(var.apiserver_monitoring_config.dashboards.troubleshooting, "https://raw.githubusercontent.com/aws-observability/aws-observability-accelerator/v0.2.0/artifacts/grafana-dashboards/eks/apiserver/apiserver-troubleshooting.json")
}
}

adothealth_monitoring_config = {
# can be overriden by providing a config
flux_gitrepository_name = "aws-observability-accelerator"
flux_gitrepository_url = "https://github.com/aws-observability/aws-observability-accelerator"
flux_gitrepository_branch = "v0.2.0"
flux_kustomization_name = "grafana-dashboards-adothealth"
flux_kustomization_path = "./artifacts/grafana-operator-manifests/eks/adot"
flux_gitrepository_name = try(var.adothealth_monitoring_config.flux_gitrepository_name, var.flux_gitrepository_name)
flux_gitrepository_url = try(var.adothealth_monitoring_config.flux_gitrepository_url, var.flux_gitrepository_url)
flux_gitrepository_branch = try(var.adothealth_monitoring_config.flux_gitrepository_branch, var.flux_gitrepository_branch)
flux_kustomization_name = try(var.adothealth_monitoring_config.flux_kustomization_name, "grafana-dashboards-adothealth")
flux_kustomization_path = try(var.adothealth_monitoring_config.flux_kustomization_path, "./artifacts/grafana-operator-manifests/eks/adot")

dashboards = {
health = "https://raw.githubusercontent.com/aws-observability/aws-observability-accelerator/v0.2.0/artifacts/grafana-dashboards/adot/adothealth.json"
health = try(var.adothealth_monitoring_config.dashboards.health, "https://raw.githubusercontent.com/aws-observability/aws-observability-accelerator/v0.2.0/artifacts/grafana-dashboards/adot/adothealth.json")
}
}

kubeproxy_monitoring_config = {
# can be overriden by providing a config
flux_gitrepository_name = "aws-observability-accelerator"
flux_gitrepository_url = "https://github.com/aws-observability/aws-observability-accelerator"
flux_gitrepository_branch = "v0.2.0"
flux_kustomization_name = "grafana-dashboards-kubeproxy"
flux_kustomization_path = "./artifacts/grafana-operator-manifests/eks/kube-proxy"
flux_gitrepository_name = try(var.kubeproxy_monitoring_config.flux_gitrepository_name, var.flux_gitrepository_name)
flux_gitrepository_url = try(var.kubeproxy_monitoring_config.flux_gitrepository_url, var.flux_gitrepository_url)
flux_gitrepository_branch = try(var.kubeproxy_monitoring_config.flux_gitrepository_branch, var.flux_gitrepository_branch)
flux_kustomization_name = try(var.kubeproxy_monitoring_config.flux_kustomization_name, "grafana-dashboards-kubeproxy")
flux_kustomization_path = try(var.kubeproxy_monitoring_config.flux_kustomization_path, "./artifacts/grafana-operator-manifests/eks/kube-proxy")

dashboards = {
default = "https://raw.githubusercontent.com/aws-observability/aws-observability-accelerator/v0.2.0/artifacts/grafana-dashboards/eks/kube-proxy/kube-proxy.json"
default = try(var.kubeproxy_monitoring_config.dashboards.default, "https://raw.githubusercontent.com/aws-observability/aws-observability-accelerator/v0.2.0/artifacts/grafana-dashboards/eks/kube-proxy/kube-proxy.json")
}
}
}
4 changes: 2 additions & 2 deletions modules/eks-monitoring/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ variable "adothealth_monitoring_config" {
flux_kustomization_path = string

dashboards = object({
grafana_adothealth_dashboard_url = string
health = string
})
})

Expand All @@ -550,7 +550,7 @@ variable "kubeproxy_monitoring_config" {
flux_kustomization_path = string

dashboards = object({
grafana_kubeproxy_dashboard_url = string
default = string
})
})

Expand Down

0 comments on commit 42db731

Please sign in to comment.