@@ -763,6 +763,41 @@ agent:
763763 otelConfig : # optional YAML config that can be provided to combine with the build-default-otel-config output
764764 prometheus :
765765 config :
766+ # # EMF (Embedded Metric Format) processor for the Prometheus pipeline.
767+ # # When the Target Allocator is enabled (agent.prometheus.targetAllocator.enabled=true),
768+ # # the CloudWatch Agent converts scraped Prometheus metrics into CloudWatch metrics via
769+ # # EMF using these metric_declarations. WITHOUT metric_declarations the scraped values
770+ # # are written to CloudWatch Logs but carry no `_aws.CloudWatchMetrics` block, so NO
771+ # # CloudWatch metrics are produced. These declarations wire the awsemf path for the
772+ # # Prometheus pipeline. This block is only rendered into the agent config when the Target
773+ # # Allocator is enabled, so default behavior for non-Prometheus users is unchanged.
774+ # # Override `emfProcessor.metricDeclarations` to scrape additional jobs/metrics, and
775+ # # `emfProcessor.metricNamespace` to change the destination CloudWatch namespace.
776+ emfProcessor :
777+ metricNamespace : ContainerInsights/Prometheus
778+ metricDeclarations :
779+ # node-exporter (PodMonitor "node-exporter") — host CPU/memory/disk/network
780+ - source_labels : ["job"]
781+ label_matcher : " .*node-exporter.*"
782+ dimensions :
783+ - ["ClusterName"]
784+ - ["ClusterName", "Namespace"]
785+ metric_selectors :
786+ - " ^node_cpu_seconds_total$"
787+ - " ^node_memory_MemAvailable_bytes$"
788+ - " ^node_memory_MemTotal_bytes$"
789+ - " ^node_filesystem_avail_bytes$"
790+ - " ^node_filesystem_size_bytes$"
791+ - " ^node_network_receive_bytes_total$"
792+ - " ^node_network_transmit_bytes_total$"
793+ # nginx (ServiceMonitor "nginx") — application request/connection metrics
794+ - source_labels : ["job"]
795+ label_matcher : " .*nginx.*"
796+ dimensions :
797+ - ["ClusterName"]
798+ - ["ClusterName", "Namespace"]
799+ metric_selectors :
800+ - " ^nginx_.*$"
766801 targetAllocator :
767802 enabled : false
768803 image :
0 commit comments