CloudWatch Cutome metrics does not created

0

Hi, Based on this session I tried to report new metrics using cloudwatch-agent (docker image) and Prometheus in order to set up autoscaling. Well, things seem to work fine but no new matrics are added to cloud watch.

Prometheus cloudwatch logs present logs my custom metric: Log Group: /.../ecs/containerinsights/../prometheus

Example Log: { "ClusterName": "XXXX-Cluster-uM8Ibru82elP", "LaunchType": "FARGATE", "StartedBy": "ecs-svc/XXXX", "TaskDefinitionFamily": "XXXX", "TaskGroup": "service:XXXX", "TaskRevision": "87", "Timestamp": "1642512851574", "Version": "0", "container_name": "XXXX", "exported_job": "LBL1", "instance": "10.0.1.225:3005", "job": "labrain-ecs-mri", "labrain_mri_counter_total": 0, "prom_metric_type": "counter" }

I notice that other insights logs, within different Log Group, has Metric section:

{...... "CloudWatchMetrics": [ { "Namespace": "ECS/ContainerInsights", "Metrics": [ { "Name": "DesiredTaskCount", "Unit": "Count" }, { "Name": "RunningTaskCount", "Unit": "Count" }, { "Name": "PendingTaskCount", "Unit": "Count" }, { "Name": "DeploymentCount", "Unit": "Count" }, { "Name": "TaskSetCount", "Unit": "Count" } ], "Dimensions": [ [ "ServiceName", "ClusterName" ] ] } ] }

I wonder if that is what is missing from my log and if so what did I miss? Thanks in advance.