Monitoring module control component (Victoria Metrics Agent)
The monitoring module management component (Victoria Metrics Agent) (shturval-metrics-collector) provides local collection of metrics for services running in the cluster.
Integration with Prometheus Operator
The transition from Prometheus to VM Agent is carried out without additional settings. Victoria Metrics Operator supports import of CRD (Custom Resource Definitions) from Prometheus Operator:
- PodMonitor;
- ServiceMonitor;
- Probe;
- AlertmanagerConfig.
If custom Prometheus Operator resources are created in the cluster, Victoria Metrics Operator will apply their configuration.
Monitoring module component in Shturval platform
By default, the module component is installed in the client and management clusters in an enabled state. To view the settings in the cluster graphical interface, in the side menu, open the Services and repositories section and go to the Installed services page, find Monitoring module. Monitoring module control component and click Manage.
If there is no module component in the cluster, open the Services and Repositories section in the side menu and go to the Available Charts page. On the shturval tab, select the shturval-metrics-collector chart and click Install.
Select the required version of the chart, as well as the namespace victoria-metrics. After selecting the chart version, Available configuration parameters for the service (values) will be displayed on the right side of the screen. Enter the required parameters as customvalues in the Service Specification block.
Please note! For monitoring to work correctly, the following must work in the client cluster:
- in the client cluster Monitoring module. CRD Control component CR of the monitoring module (
shturval-metrics-collector-crds). - in the management cluster Monitoring module. Monitoring module control component (
shturval-metrics-collector) and Monitoring module. CRD Monitoring module CR control component (shturval-metrics-collector-crds).
When the Monitoring Module is enabled and running in the cluster. The management component of the monitoring module, VM Agent collects and forwards metrics to the management cluster. Alerting in client clusters works according to the configured rules of the management cluster. If you need local alerting in a client cluster, follow the steps in the instructions Configure local alerting in a cluster.
###VM Agent configuration
Basic VM Agent setup:
- defines collection tasks (
scrape jobs) with different frequencies (scrapeInterval), timeouts (scrapetimeout).
Customvalues example
vmagent:
enabled: true
spec:
scrapeInterval: <your-parameter-value>
vmScrape:
kind: VMNodeScrape
spec:
scrapeTimeout: <your-parameter-value>
| Parameter | Description | Data type | Default |
|---|---|---|---|
scrapeInterval | Frequency of metrics collection | string | 20s |
scrapeTimeout | Timeout after which metrics collection will end | string | 5s |
- uses flexible settings for metrics and label changes. For example, selecting the necessary namespaces or excluding unnecessary targets. Basic monitoring is configured using labels; if necessary, assign a label to the service so that it is included in the list of objects for monitoring.
Customvalues example
vmagent:
spec:
selectAllByDefault: false
nodeScrapeNamespaceSelector: # Selector for namespaces to scrape metrics from
matchLabels:
shturval.tech/system-namespace: ''
nodeScrapeSelector: {} # Selector for cluster nodes to scrape metrics from
podScrapeNamespaceSelector: # Selector for namespaces to scrape pod metrics from
matchLabels:
shturval.tech/system-namespace: ''
podScrapeSelector: {} # Selector for pods to scrape metrics from
probeNamespaceSelector:
matchLabels:
shturval.tech/system-namespace: ''
probeSelector: {}
serviceScrapeNamespaceSelector: # Selector for namespaces to scrape service metrics from
matchLabels:
shturval.tech/system-namespace: ''
serviceScrapeSelector: {} # Selector for services to scrape metrics from
staticScrapeNamespaceSelector: # Selector for namespaces to scrape static metrics from
matchLabels:
shturval.tech/system-namespace: ''
staticScrapeSelector: {} ## Selector for static objects to scrape metrics from
- tasks of computing resources (CPU and RAM) for VM Agent, Victoria Metrics Operator and auxiliary services (node-exporter, kube-state-metrics) (
resources.requestsandresources.limits).
Customvalues example with parameters of computing resources for VM Agent
vmagent:
enabled: true
resources:
limits:
cpu: <your-parameter-value>
memory: <your-parameter-value>
requests:
cpu: <your-parameter-value>
memory: <your-parameter-value>
| Parameter | Description | Data type | Example |
|---|---|---|---|
limits.cpu | CPU limits for VM Agent | string | 1 |
limits.memory | Memory limits for VM Agent | string | 1Gi |
requests.cpu | CPU request for VM Agent | string | 50m |
requests.memory | Memory request for VM Agent | string | 50Mi |