Metrics in Kubernetes: Difference between revisions
Line 17: | Line 17: | ||
==<span id='Custom_Metric'></span>Custom Metrics== | ==<span id='Custom_Metric'></span>Custom Metrics== | ||
Aside from [[#Resource_Metric|resource metrics]], there are two other types of metrics, both of which are considered [[#Custom_Metric|custom metrics]]: [[#Pod_Metric|pod metrics]] and [[#Object_Metrics|object metrics]]. | Aside from [[#Resource_Metric|resource metrics]], there are two other types of metrics, both of which are considered [[#Custom_Metric|custom metrics]]: [[#Pod_Metric|pod metrics]] and [[#Object_Metrics|object metrics]]. Custom metrics track resources used by Kubernetes objects (pods or otherwise). | ||
===<span id='Pod_Metric'></span>Pod Metrics=== | ===<span id='Pod_Metric'></span>Pod Metrics=== | ||
Pod metrics track resources that describe pods. | Pod metrics track resources that describe pods. |
Revision as of 21:27, 5 October 2020
Internal
Overview
Resource
Metrics
Resource Metrics
A resource metric is a numeric quantity that tracks either the CPU or memory consumed by containers and pods. By default, the only two supported resource metrics are the CPU utilization and the memory consumed by a container. These resources do not change names from cluster to cluster and they should be available as long the Resource Metrics API is available.
Resource Metrics API
metrics.k8s.io TODO:
- https://github.com/kubernetes/community/blob/master/contributors/design-proposals/instrumentation/resource-metrics-api.md
- https://github.com/kubernetes/community/blob/master/contributors/design-proposals/instrumentation/custom-metrics-api.md
Custom Metrics
Aside from resource metrics, there are two other types of metrics, both of which are considered custom metrics: pod metrics and object metrics. Custom metrics track resources used by Kubernetes objects (pods or otherwise).
Pod Metrics
Pod metrics track resources that describe pods.
Object Metrics
Object metrics track resources describe different objects in the same namespace, instead of describing pods.
Custom Metrics API
custom.metrics.k8s.io
Monitoring systems like Prometheus expose application-specific metrics to the Horizontal Pod Autoscaler controller via the Custom Metrics API.
External Metrics
External Metrics API
external.metrics.k8s.io
Kubernetes Metrics Server
Metric Pipeline
Notes
- More details about resource metrics API.
- Metrics: raw values, utilization values.
- Metric server: https://kubernetes.io/docs/tasks/debug-application-cluster/resource-metrics-pipeline/, https://github.com/kubernetes-sigs/metrics-server
- Custom metrics API: https://github.com/kubernetes/community/blob/master/contributors/design-proposals/instrumentation/custom-metrics-api.md
- External metrics API: https://github.com/kubernetes/community/blob/master/contributors/design-proposals/instrumentation/external-metrics-api.md