K8s Basic Monitoring Metrics Collection
K8s Custom Service Metrics Collection
K8s Custom Service Metrics Collection (YAML Import)
1. In the Kubernetes Basic Monitoring Metrics on the right, click Create to enter the configuration process.
2. Select the cluster to collect. If metric collection is disabled for the selected cluster, hover the mouse over the red text. As instructed, enable metric collection, then just select the cluster.
3. After entering the configuration page, configure metrics collection. Here, two setting methods are provided: Quick configuration and importing Custom YAML.
Quick Configuration:
By default, some commonly used K8s basic monitoring metrics are selected. Click Edit to adjust.
Three basic metrics are provided: container usage monitoring, K8s resource status monitoring, and host monitoring.
Custom YAML: Support quickly enabling Kubernetes basic monitoring components through YAML templates to collect key metric data at the cluster, node, and container layers. Three independently controlled collection component switches are provided, each corresponding to a YAML deployment template. Based on actual business scenarios, you can perform YAML adjustments.
kube-state-metrics: Collect running status information of Kubernetes resource objects such as Deployment, Pod, and Node.
node-exporter: Collect system resource indicators at the node level.
cAdvisor: Collect container runtime metrics to monitor Pod and container resource usage.
4. Once configured, click Submit. After completion, you can start collecting.
1. In the Kubernetes Custom Service Metrics on the right, click Create to enter the configuration process.
2. Select the cluster to collect. If metric collection is disabled for the selected cluster, hover the mouse over the red text. As instructed, enable metric collection, then just select the cluster.
3. Proceed to the configuration page and configure metrics collection.
For partial content of the collection configuration, see the table below.
|
Configuration Name | The name of the metric collection configuration. |
Workload Details | The target K8s objects for metric collection, supporting multiple selections. Namespace: Select a namespace to collect. Pod Label: Select target Pods by Label, support key/value configuration, multiple rules follow AND relationship. Port: Metric collection port. Metric Address (Path): Path for metric collection. |
Data Processing | Process collected metric data with rules, where the logic is consistent with Prometheus' relabel rules. Supports configuring multiple data processing rules, executed in pipeline order by rule serial number. Supported rule operations: Label replacement, drop Label, retain Label, lowercase, uppercase, drop metric (full/regular expression matching), retain metric (full/regular expression matching), hash modulo, Label map. |
Custom Label | In addition to the original metric content, container or Kubernetes-related metadata (such as the container ID that generates the log) will also be reported to CLS, facilitating user viewing and tracing the source of metrics or searching based on container identifiers and features (such as container name, labels). You can choose whether to report this metadata as needed, upload it selectively, or submit custom metadata. |
For partial content of other configuration, see the table below.
|
Communication protocol | The protocol used for metric collection supports HTTP or HTTPS, defaulting to HTTP. |
Collection frequency | Metric collection interval, default 60s. |
Collection timeout | Metric collection request timeout, default 30s. |
Reserve the source tag | Whether to reserve the original metric Label, off by default. |
4. Once configured, click Submit. After completion, you can start collecting.
1. In the Kubernetes Custom Service Metrics on the right, click Import via YAML to enter the configuration process.
2. Select the cluster to collect. If metric collection is disabled for the selected cluster, hover the mouse over the red text. As instructed, enable metric collection, then just select the cluster.
3. Proceed to the configuration page and configure metrics collection.
Supports four YAML types:
ServiceMonitor(Prometheus-Operator)
PodMonitor(Prometheus-Operator)
ScrapeConfig(Prometheus-Operator)
ScrapeConfig (Prometheus native)
Based on the selected type, enter configuration details in the YAML box just.
4. Once configured, click Submit. After completion, you can start collecting.