From f42db1ed31e15d60158a2f91de57236676df7e94 Mon Sep 17 00:00:00 2001 From: Stephan Hesselmann Date: Tue, 11 Apr 2023 11:55:28 +0200 Subject: [PATCH] ROX-15136: filter aws metrics by cluster name (#857) --- .../templates/01-operator-03-config-map.yaml | 343 +++++++----------- .../templates/01-operator-04-deployment.yaml | 7 +- .../charts/cloudwatch/values.yaml | 2 +- 3 files changed, 136 insertions(+), 216 deletions(-) diff --git a/dp-terraform/helm/rhacs-terraform/charts/cloudwatch/templates/01-operator-03-config-map.yaml b/dp-terraform/helm/rhacs-terraform/charts/cloudwatch/templates/01-operator-03-config-map.yaml index c6ac2138a4..584874fdcd 100644 --- a/dp-terraform/helm/rhacs-terraform/charts/cloudwatch/templates/01-operator-03-config-map.yaml +++ b/dp-terraform/helm/rhacs-terraform/charts/cloudwatch/templates/01-operator-03-config-map.yaml @@ -4,215 +4,134 @@ metadata: name: cloudwatch-exporter-config namespace: {{ include "cloudwatch.namespace" . }} data: - config.yaml: |- - region: us-east-1 - metrics: - - aws_metric_name: DatabaseConnections - aws_namespace: AWS/RDS - aws_dimensions: - - DBInstanceIdentifier - aws_statistics: - - Average - - Maximum - - Minimum - aws_extended_statistics: - - p90 - - p95 - - p99 - use_get_metric_data: true - - - aws_metric_name: ServerlessDatabaseCapacity - aws_namespace: AWS/RDS - aws_dimensions: - - DBInstanceIdentifier - aws_statistics: - - Average - - Maximum - - Minimum - aws_extended_statistics: - - p90 - - p95 - - p99 - use_get_metric_data: true - - - aws_metric_name: ACUUtilization - aws_namespace: AWS/RDS - aws_dimensions: - - DBInstanceIdentifier - aws_statistics: - - Average - - Maximum - - Minimum - aws_extended_statistics: - - p90 - - p95 - - p99 - use_get_metric_data: true - - - aws_metric_name: FreeableMemory - aws_namespace: AWS/RDS - aws_dimensions: - - DBInstanceIdentifier - aws_statistics: - - Average - - Maximum - - Minimum - aws_extended_statistics: - - p90 - - p95 - - p99 - use_get_metric_data: true - - - aws_metric_name: CPUUtilization - aws_namespace: AWS/RDS - aws_dimensions: - - DBInstanceIdentifier - aws_statistics: - - Average - - Maximum - - Minimum - aws_extended_statistics: - - p90 - - p95 - - p99 - use_get_metric_data: true - - - aws_metric_name: ReadLatency - aws_namespace: AWS/RDS - aws_dimensions: - - DBInstanceIdentifier - aws_statistics: - - Average - - Maximum - - Minimum - aws_extended_statistics: - - p90 - - p95 - - p99 - use_get_metric_data: true - - - aws_metric_name: ReadThroughput - aws_namespace: AWS/RDS - aws_dimensions: - - DBInstanceIdentifier - aws_statistics: - - Average - - Maximum - - Minimum - aws_extended_statistics: - - p90 - - p95 - - p99 - use_get_metric_data: true - - - aws_metric_name: WriteLatency - aws_namespace: AWS/RDS - aws_dimensions: - - DBInstanceIdentifier - aws_statistics: - - Average - - Maximum - - Minimum - aws_extended_statistics: - - p90 - - p95 - - p99 - use_get_metric_data: true - - - aws_metric_name: WriteThroughput - aws_namespace: AWS/RDS - aws_dimensions: - - DBInstanceIdentifier - aws_statistics: - - Average - - Maximum - - Minimum - aws_extended_statistics: - - p90 - - p95 - - p99 - use_get_metric_data: true - - - aws_metric_name: NetworkThroughput - aws_namespace: AWS/RDS - aws_dimensions: - - DBInstanceIdentifier - aws_statistics: - - Average - - Maximum - - Minimum - aws_extended_statistics: - - p90 - - p95 - - p99 - use_get_metric_data: true - - - aws_metric_name: AuroraReplicaLag - aws_namespace: AWS/RDS - aws_dimensions: - - DBInstanceIdentifier - aws_statistics: - - Average - - Maximum - - Minimum - aws_extended_statistics: - - p90 - - p95 - - p99 - use_get_metric_data: true - - - aws_metric_name: MaximumUsedTransactionIDs - aws_namespace: AWS/RDS - aws_dimensions: - - DBInstanceIdentifier - aws_statistics: - - Average - - Maximum - - Minimum - aws_extended_statistics: - - p90 - - p95 - - p99 - use_get_metric_data: true - - - aws_metric_name: TransactionLogsDiskUsage - aws_namespace: AWS/RDS - aws_dimensions: - - DBInstanceIdentifier - aws_statistics: - - Average - - Maximum - - Minimum - aws_extended_statistics: - - p90 - - p95 - - p99 - use_get_metric_data: true - - - aws_metric_name: Deadlocks - aws_namespace: AWS/RDS - aws_dimensions: - - DBInstanceIdentifier - aws_statistics: - - Average - - Maximum - - Minimum - aws_extended_statistics: - - p90 - - p95 - - p99 - use_get_metric_data: true - - - aws_metric_name: BufferCacheHitRatio - aws_namespace: AWS/RDS - aws_dimensions: - - DBInstanceIdentifier - aws_statistics: - - Average - - Maximum - - Minimum - aws_extended_statistics: - - p90 - - p95 - - p99 - use_get_metric_data: true + config.yml: |- + apiVersion: v1alpha1 + discovery: + jobs: + - type: rds + regions: + - us-east-1 + searchTags: + - key: DataplaneClusterName + value: ^{{ .Values.clusterName }}$ + metrics: + - name: DatabaseConnections + statistics: + - Average + - Maximum + - Minimum + - p90 + - p95 + - p99 + - name: ServerlessDatabaseCapacity + statistics: + - Average + - Maximum + - Minimum + - p90 + - p95 + - p99 + - name: ACUUtilization + statistics: + - Average + - Maximum + - Minimum + - p90 + - p95 + - p99 + - name: FreeableMemory + statistics: + - Average + - Maximum + - Minimum + - p90 + - p95 + - p99 + - name: CPUUtilization + statistics: + - Average + - Maximum + - Minimum + - p90 + - p95 + - p99 + - name: ReadLatency + statistics: + - Average + - Maximum + - Minimum + - p90 + - p95 + - p99 + - name: ReadThroughput + statistics: + - Average + - Maximum + - Minimum + - p90 + - p95 + - p99 + - name: WriteLatency + statistics: + - Average + - Maximum + - Minimum + - p90 + - p95 + - p99 + - name: WriteThroughput + statistics: + - Average + - Maximum + - Minimum + - p90 + - p95 + - p99 + - name: NetworkThroughput + statistics: + - Average + - Maximum + - Minimum + - p90 + - p95 + - p99 + - name: AuroraReplicaLag + statistics: + - Average + - Maximum + - Minimum + - p90 + - p95 + - p99 + - name: MaximumUsedTransactionIDs + statistics: + - Average + - Maximum + - Minimum + - p90 + - p95 + - p99 + - name: TransactionLogsDiskUsage + statistics: + - Average + - Maximum + - Minimum + - p90 + - p95 + - p99 + - name: Deadlocks + statistics: + - Average + - Maximum + - Minimum + - p90 + - p95 + - p99 + - name: BufferCacheHitRatio + statistics: + - Average + - Maximum + - Minimum + - p90 + - p95 + - p99 diff --git a/dp-terraform/helm/rhacs-terraform/charts/cloudwatch/templates/01-operator-04-deployment.yaml b/dp-terraform/helm/rhacs-terraform/charts/cloudwatch/templates/01-operator-04-deployment.yaml index 3cddf57868..9f9813e089 100644 --- a/dp-terraform/helm/rhacs-terraform/charts/cloudwatch/templates/01-operator-04-deployment.yaml +++ b/dp-terraform/helm/rhacs-terraform/charts/cloudwatch/templates/01-operator-04-deployment.yaml @@ -29,6 +29,8 @@ spec: runAsNonRoot: true seccompProfile: type: RuntimeDefault + args: + - "--config.file=/tmp/config.yml" env: - name: AWS_ACCESS_KEY_ID valueFrom: @@ -41,12 +43,11 @@ spec: name: rhacs-cloudwatch-exporter key: AWS_SECRET_ACCESS_KEY volumeMounts: - - mountPath: /config/config.yml + - mountPath: /tmp name: config - subPath: config.yaml ports: - name: monitoring - containerPort: 9106 + containerPort: 5000 volumes: - name: config configMap: diff --git a/dp-terraform/helm/rhacs-terraform/charts/cloudwatch/values.yaml b/dp-terraform/helm/rhacs-terraform/charts/cloudwatch/values.yaml index d86a2ccc53..3f6bdda1f0 100644 --- a/dp-terraform/helm/rhacs-terraform/charts/cloudwatch/values.yaml +++ b/dp-terraform/helm/rhacs-terraform/charts/cloudwatch/values.yaml @@ -5,4 +5,4 @@ aws: clusterName: "" environment: "" -image: "quay.io/prometheus/cloudwatch-exporter:v0.15.1" +image: "ghcr.io/nerdswords/yet-another-cloudwatch-exporter:v0.48.0-alpha"