MicroticaMicrotica

Metrics

Monitor Kubernetes and custom AWS service metrics in Microtica, set alarms on thresholds, and learn how each metric is calculated to troubleshoot faster.

Kubernetes metrics

Metrics tell you whether your application is performing as expected or needs your attention.

In Microtica, you can create an alarm to monitor a specific metric and get an email notification when the metric goes outside the range you consider acceptable.

When you receive an email notification about a triggered alarm event for your Kubernetes application, it means one or more of the specified metrics have exceeded their defined thresholds.

To help you troubleshoot, the table below explains how each metric is calculated.

MetricDescription
CPUUtilizationThe percentage of CPU time, which is sum of the time spent on user space by the K8s process and the time spent on kernel by the K8s process over the last 5 minutes.
MemoryUtilizationThe resident memory size in bytes of the K8s process over the last 5 minutes.
HTTPResponseP50Latency50th percentile request-response latency: the median value of the request-response latencies over the last 5 minutes.
HTTPResponseP90Latency90th percentile request-response latency: 90% of the request-response latencies were below this value over the last 5 minutes.
HTTPResponseP99Latency99th percentile request-response latency: 99% of the request-response latencies were below this value over the last 5 minutes.
HTTPRequestsTotal number of HTTP requests over the last 5 minutes.
HTTPClientErrorsTotal number of 4xx HTTP response status codes over the last 5 minutes.
HTTPServerErrorsTotal number of 5xx HTTP response status codes over the last 5 minutes.
CrashesCountTotal number of process exists over the last 5 minutes.

Custom AWS service metrics

You can extend the default metrics for AWS services by creating custom metrics. This gives you detailed monitoring and alerting based on your specific needs. You define custom metrics in AWS CloudFormation templates by outputting parameters in a specific format. This section explains how to create and deploy them.

Prerequisites

  • Basic understanding of AWS CloudFormation syntax and operations.
  • Familiarity with the AWS service metrics you want to monitor.

Custom metric format

To create a custom metric, output parameters from your CloudFormation template in the following format:

Metric format
Name:<Metric display name>|Namespace:<AWS metric namespace>|MetricName:<AWS metric name>|Statistics:<AWS metric statistics>|Unit:<AWS metric unit>|Dimensions:<key>=<value>,<key>=<value>
  • Name - The display name for the metric in the Microtica console.
  • Namespace - The namespace of the AWS service (e.g., AWS/ECS, AWS/EC2).
  • MetricName - The name of the metric within the AWS service.
  • Statistics - The statistic type (e.g., Average, Maximum).
  • Unit - The unit for the metric value (e.g., Percent, Seconds).
  • Dimensions - Key-value pairs that uniquely identify the metric.

Example: monitoring CPU utilization in Amazon ECS

To monitor the average CPU utilization of an ECS service, define the following in your CloudFormation template's Outputs section:

index.json
{
  "Outputs": {
      "MetricCpuUsage": {
          "Value": {
              "Fn::Sub": "Name:CPU|Namespace:AWS/ECS|MetricName:CPUUtilization|Statistics:Average|Unit:Percent|Dimensions:ClusterName=${ECSCluster},ServiceName=${FargateService.Name}"
          },
          "Description": "Custom metric for monitoring CPU utilization."
      }
  }
}

Deployment

To deploy your custom metric, include it in your CloudFormation stack and push the changes in Git. Once deployed, go to the component Monitoring settings section and click the Sync Metrics button. The custom metric is then available in the Microtica console, ready for monitoring and alerting based on your configuration.

On this page