Metrics redirection

When VM Agent is enabled in a cluster, by default it collects system component metrics and forwards them to the Victoria Metrics cluster hosted in the management cluster. You can configure the redirection of metrics from the client cluster and management cluster to external Victoria Metrics deployed in your infrastructure. To do this you need:

  1. Prepare a manifest of the ShturvalServicePatch (PatchSSC) object for application to the specification (ssc) *Monitoring module control component (shturval-metrics-collector) with the required parameters in customvalues.

You can disable internal monitoring of the Shturval platform and send metrics only to the external Victoria Metrics cluster or configure routing to the internal and external Victoria Metrics clusters:

ShturvalServicePatch example for disabling internal monitoring and redirecting metrics to external Victoria Metrics
apiVersion: ops.shturval.tech/v1beta2
kind: ShturvalServicePatch
metadata:
  name: <resource-name>
spec:
  shturvalServiceConfigName: shturval-metrics-collector
  customvalues:
    external: 
      vm: 
        write: # Configuration for sending metrics to external monitoring service
          url: <your-parameter-value>
        read:  # Settings for reading metrics from external monitoring service
          url: <your-parameter-value>
  
ParameterDescriptionData typeExample
metadata.nameName of the created PatchSSCstringshturval-metrics-external
write.urlVictoria Metrics Insert URLstringhttp://shturval-monitoring-vminsert.victoria-metrics.svc:8480/insert/0/prometheus/
read.urlVictoria Metrics Select URL. Do not specify the read block if you only need to configure the direction of metrics to an external monitoring servicestringhttp://shturval-monitoring-vmselect.victoria-metrics.svc:8481/select/0/prometheus/

Instead of 0 in the examples, you must specify TenantID. In this case, the ability to obtain metrics from an external monitoring service is configured to be able to configure alerting in the “Shturval” platform cluster.

Please note! If you configure metrics redirection without the ability to receive them from external Victoria Metrics, Grafana dashboards will not work correctly.

Example ShturvalServicePatch for sending metrics to external Victoria Metrics without disabling internal monitoring "Shturval"
apiVersion: ops.shturval.tech/v1beta2
kind: ShturvalServicePatch
metadata:
  name: <resource-name>
spec:
  shturvalServiceConfigName: shturval-metrics-collector
  customvalues:
    vmagent: 
      additionalRemoteWrites: 
      - url: <your-parameter-value>
  
ParameterDescriptionData typeExample
metadata.nameName of the created PatchSSCstringshturval-metrics-external
additionalRemoteWrites.urlVictoria Metrics Insert URLstringhttp://shturval-monitoring-vminsert.victoria-metrics.svc:8480/insert/0/prometheus/
  1. In the graphical interface, using manifest import, load the prepared ShturvalServicePatch into the cluster:
  • Click on the manifest import icon located to the left of the user name. Upload the file with the prepared manifest ShturvalServicePatch or drag the manifest into the window that opens. Verify and click Download.
Screenshot

manif

metricspatch1

Once ShturvalServicePatch is downloaded, it will take some time for the changes to take effect.

  1. To ensure that the loaded ShturvalServicePatch is applied to the specification:
  • In the cluster from the Services and repositories section, open the Installed services page.
  • Find Monitoring module control component (shturval-metrics-collector) and go to control.
  • When ShturvalServicePatch is applied, the Service tab status will update to Patched, and the Applied PatchSSC tab will display the loaded ShturvalServicePatch in the list.
Screenshot

collectorpatched

collectorpatched