I have created few services in Kubernetes with type: LoadBalancer.

Platform: EKS.

Is there a way to get number of 4xx or 5xx errors from this LoadBalancer? I have tried the following:

Prometheus - Does not seem to be any metric collected for services with HTTP response codes.

AWS Cloudwatch - Does not show data points for the 2xx, 3xx, 4xx or 5xx errors. Shows other metrics like latency, request counts, etc.


in CloudWatch docs ELB metrics show 4xx and 5xx errors:


From EKS environment you could get the ELB id/name (e.g. with kubectl get svc SERVICE_NAME -o yaml), and use that to extract the metrics from CloudWatch. It's a bit of a convoluted process, but logically could work.

Ref: https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-cloudwatch-metrics.html#loadbalancing-metrics-clb

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.