Redirecting application metrics to external storage

When setting up application monitoring, metrics for storage are sent to a local VictoriaMetrics instance (VMSinlge manifest), which is deployed in the user-monitoring namespace of the client cluster. If necessary, you can redirect application metrics to external storage.

To do this, in VMAgent, replace or add the external storage URL in the spec.remoteWrite section. Please note! External storage must support the Prometheus/VictoriaMetrics Remote Write protocol.

VMAgent Example
apiVersion: operator.victoriametrics.com/v1beta1
kind: VMAgent
metadata:
  labels:
    app: vmagent-user-monitoring # Name cannot be changed
    app.kubernetes.io/component: monitoring
    app.kubernetes.io/name: user-monitoring
  name: user-monitoring
  namespace: user-monitoring
spec:
  externalLabels:
    cluster: client-cluster
  extraArgs: 
    <your parameter values>
  logFormat: <your-parameter-value>
  logLevel: <your-parameter-value>
  nodeScrapeNamespaceSelector:
    matchExpressions:
      - key: shturval.tech/system-namespace
        operator: DoesNotExist
  podScrapeNamespaceSelector:
    matchExpressions:
      - key: shturval.tech/system-namespace
        operator: DoesNotExist
  port: "8429"
  probeNamespaceSelector:
    matchExpressions:
      - key: shturval.tech/system-namespace
        operator: DoesNotExist
  remoteWrite:
    - url: <your-parameter-value> # External VictoriaMetrics storage URL
  replicaCount: <your-parameter-value>
  resources:
    limits:
      cpu: <your-parameter-value>
      memory: <your-parameter-value>
    requests:
      cpu: <your-parameter-value>
      memory: <your-parameter-value>
  scrapeConfigNamespaceSelector:
    matchExpressions:
      - key: shturval.tech/system-namespace
        operator: DoesNotExist
  scrapeInterval: <your-parameter-value>
  securityContext:
    fsGroup: 2000
    runAsGroup: 2000
    runAsNonRoot: true
    runAsUser: 1000
  serviceAccountName: vmagent-user-monitoring
  serviceScrapeNamespaceSelector:
    matchExpressions:
      - key: shturval.tech/system-namespace
        operator: DoesNotExist
  staticScrapeNamespaceSelector:
    matchExpressions:
      - key: shturval.tech/system-namespace
        operator: DoesNotExist
  tolerations:
    - effect: NoSchedule
      key: node-role.kubernetes.io/infra
      operator: Exists
  vmAgentExternalLabelName: ""
ParameterDescriptionData typeExample
extraArgsList of additional launch arguments[]objectenvflag.enable: “true”
envflag.prefix: VM_
promscrape.dropOriginalLabels: “true”
promscrape.maxScrapeSize: “67108864”
promscrape.streamParse: “true”
remoteWrite.tmpDataPath: /tmp
logFormatLog Formatstringdefault
logLevelLog levelstringINFO
replicaCountNumber of replicasinteger1
remoteWriteList of links to remote metrics stores for recording[]objecturl: vmcluster.local:8480/insert/123/prometheus
resourcesResources requests and limits[]objectlimits:
cpu: 10
memory: 10Gi
requests:
cpu: 50m
memory: 50Mi
scrapeIntervalMetric collection frequencyinteger15s