Monitoring and Logging

A CloudWatch Logs metric filter counts errors by service using a service dimension. Operations also needs a fleet-wide metric that publishes zero during minutes when logs arrive but no errors match; which change preserves the service metrics and meets this requirement?

Show the answer

Correct answerB. Add a dimensionless error-count filter with a default value of 0.

AWhy not this: Publishing zero for every event does not count errors and still produces dimensioned rather than fleet-wide metrics.

BWhy this is right: A dimensionless filter supports a zero default while leaving the existing per-service error metrics unchanged.

CWhy not this: Metric streams deliver metric updates; they do not aggregate series or fill missing values.

DWhy not this: CloudWatch Logs does not allow a default value for a metric filter that specifies dimensions.

A separate dimensionless filter can count errors and publish a default of zero when logs arrive without matching events. Metric filters with dimensions cannot have a default value, so the existing filter cannot provide that behavior.