Uploaded image for project: 'Percona Monitoring and Management'
  1. Percona Monitoring and Management
  2. PMM-9542

Provide ability to change startup parameters of Victoriametrics

Details

    • Improvement
    • Status: Done
    • Medium
    • Resolution: Done
    • 2.26.0, 2.23.0
    • 2.27.0
    • None
    • None
    • 1
    • Yes
    • Yes
    • Yes
    • [obsolete] C/S Core

    Description

      User story:
      As an SRE or other PMM user, I need to modify some defaults in the PMM components configuration so that PMM behaves differently. There is already a way to go this for Grafana (-e GF_ .. ) but no way for Victoria Metrics.

      However, this will require me to follow the PMM components configuration standard and may cause problems with starting PMM if some of the flags are deprecated in the version used in PMM.
      There are NO expectations PMM will handle such cases of depreciation of its components.
      PMM is handling only PMM settings API.

      UI/UX:
      docker run ... -e VM_...... = X

      Acceptance criteria

      • User able to start PMM and add or replace default flags of PMM configuration.
      • The available list of flags is here but to use them, you need to prepend the VM_ prefix like in the example below (how to test section)

      Out of scope:

      • Handling flag deprecations of VM by PMM

      Suggested implementation:
      TBD

      How to test:
      TBD

      Details:

      As of now, pmm-managed handles startup configuration of Victoriametrics:

       

      # cat /etc/supervisord.d/victoriametrics.ini 
      ; Managed by pmm-managed. DO NOT EDIT.[program:victoriametrics]
      priority = 7
      command =
      	/usr/sbin/victoriametrics
      		--promscrape.config=/etc/victoriametrics-promscrape.yml
      		--retentionPeriod=30d
      		--storageDataPath=/srv/victoriametrics/data
      		--httpListenAddr=127.0.0.1:9090
      		--search.disableCache=true
      		--search.maxQueryLen=1MB
      		--search.latencyOffset=5s
      		--search.maxUniqueTimeseries=60000000
      		--search.maxQueueDuration=30s
      		--search.logSlowQueryDuration=30s
      		--search.maxQueryDuration=60s
      		--promscrape.streamParse=true
      		--prometheusDataPath=/srv/prometheus/data
      		--http.pathPrefix=/prometheus

      There are cases when we need to tune memory usage for this daemon by adding --memory.allowedPercent=<number>. This can be done on-the-fly by adding the configuration on /etc/supervisord.d/victoriametrics.ini  and let the daemon use the new configuration with:

      supervisorctl reread
      supervisorctl update

      However, when PMM server container is restarted, this configuration is lost once again.

      How to test

      1. Start the feature build with some extra parameters like enabling http user and password
      Example. Create a bash script with this content, give it run permissions and run it to start PMM server

      #!/bin/bash
      
      IMAGE="${1:-perconalab/pmm-server-fb:PR-2374-31b821c}"
      docker create -v /srv --name pmm-data ${IMAGE} /bin/true
      docker run -d \
          -p 80:80 \
          -p 443:443 \
          --volumes-from pmm-data \
          --name pmm-server \
          -e PERCONA_TEST_DBAAS=1 \
          -e PERCONA_TEST_VERSION_SERVICE_URL=https://check-dev.percona.com/versions/v1 \
          -e VM_httpAuth_username=admin \
          -e VM_httpAuth_password=admin \
          ${IMAGE}
       

      2. Log in into PMM as usual.

      3. Browse to http://localhost/prometheus and it should ask for user and password

      Attachments

        Activity

          People

            rasika.chivate Rasika Chivate
            jaime.sicam@percona.com Jaime Sicam
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Smart Checklist