Creating a new metric to monitor Pod

For a running application, metrics are the data we can collect and use to analyze its behavior and performance. Metrics can come from the system side, such as the usage of CPU, or be based on the functionality of an application, such as the request frequency of certain functions. There are several metrics for monitoring offered by Heapster (https://github.com/kubernetes/heapster/blob/master/docs/storage-schema.md). We are going to show you how to create a customized panel by yourself. Please take the following steps as a reference:

  1. Go to the dashboard of Pod, and drag the web page to the bottom. There is a button called ADD ROW; click it to add a metric. Then, choose the first category Graph as a new panel for expressing this metric:
Adding a new metric with graph expression
  1. An empty panel block appears. Go ahead and click on it for further configuration. Just choose Edit when the editing block shows up right after you pick the panel:
Starting to edit a panel
  1. First, give your panel a name. For example, CPU Rate. We would like to create one showing the rate of CPU utilization:
Giving the panel a title on the "General" page
  1. Set up the following parameters for specific data querying. Take the following screenshot as reference:
    • FROM: cpu/usage_rate
    • WHERE: type = pod_container
    • AND: namespace_name=$namespace, pod_name=$podname value
    • GROUP BY: tag(container_name)
    • ALIAS BY: $tag_container_name
Parameters of data querying for CPU-rate metric
  1. Does any line of status show up? If not, modifying the configuration in the display page will help you build the best looking graph for you. Make the Null value connected and you will find lines showing out:
Editing the look of your metric. Checking the null value to be "connected" for showing the lines
  1. Here you go! Feel free to close the edit mode. You now have a new metric for every Pod.

Just try to discover more functionality of the Grafana dashboard and the Heapster monitoring tool. You will obtain further details about your system, services, and containers through the information from the monitoring system.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset