After a self-managed Kubernetes cluster is connected to Application Real-Time Monitoring Service (ARMS) Prometheus, you cannot directly configure Prometheus in the Prometheus console. Instead, you need to use the kubectl command to manage the Prometheus.yaml configuration file, delete metrics, specify the number of agent replicas, and upgrade the Helm version.
Prerequisites
A self-managed Kubernetes cluster is connected to ARMS Prometheus. For more information, see Create a Prometheus instance for a Kubernetes cluster.
Create and modify the promethues.yaml file
Drop Prometheus metrics
If there are custom metrics that you no longer want your Prometheus instance to monitor, you can drop these metrics. Dropped metrics no longer incur charges.
Create a drop-metric.yaml file to specify the metrics that you want to drop. Examples:
apiVersion: v1
kind: ConfigMap
metadata:
name: arms-prom-drop-metric
namespace: arms-prom
labels:
target: arms
type: drop-metric
data:
dropMetric: |
container_memory_rss
container_memory_failures_total
apiserver_request_total
kube_pod_container_status_waiting_reason
container_cpu_load_average_10s
container_memory_max_usage_bytes
dropMetric:
are provided for reference. You can specify the metrics based on your business requirements.
Set the number of Prometheus agent replicas
If Prometheus agent replicas are insufficient, memory overflows and restarts may occur continuously. You can adjust the number of Prometheus agent replicas based on your business requirements.
Run the following command to change the number of agent replicas:
kubectl scale deployment arms-prometheus-ack-arms-prometheus --replicas 3 -n arms-prom
3
in the command is the currently set number of agent replicas. You can change the
number based on your business requirements. We recommend that you set the number equal
to or greater than 3.
Upgrade Helm charts
ARMS Prometheus allows you to upgrade Helm charts. For more information, see Upgrade the Helm version.