# create configmap for cwagent config
apiVersion: v1
data:
  # Configuration is in Json format. No matter what configure change you make,
  # please keep the Json blob valid.
  cwagentconfig.json: |
    {
      "agent": {
        "region": "us-west-2"
      },
      "logs": {
        "metrics_collected": {
          "kubernetes": {
            "cluster_name": "do-eks",
            "metrics_collection_interval": 10
          }
        },
        "force_flush_interval": 5
      },
      "metrics": {
        "append_dimensions": {
          "AutoScalingGroupName": "${aws:AutoScalingGroupName}",
          "InstanceId": "${aws:InstanceId}"
        },
        "metrics_collected": {
          "nvidia_gpu": {
            "measurement": [
              "utilization_gpu",
              "utilization_memory",
              "temperature_gpu",
              "power_draw",
              "memory_total",
              "memory_used"
            ],
            "metrics_collection_interval": 10
          }
        }
      }
    }
kind: ConfigMap
metadata:
  name: cwagentconfig
  namespace: amazon-cloudwatch