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

Can't add or remove external metric with special characters in name

    Details

    • Type: Bug
    • Status: Done
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: 1.4.0
    • Fix Version/s: 1.4.1
    • Component/s: None
    • Labels:
      None

      Description

      It's possible to add external metrics with name like 10.10.11.50:9187, but it's not possible to remove it:

      nailya.kutlubaeva@bm-dell06-qanqa03:~/download$ sudo pmm-admin remove external:metrics 10.10.11.50:9187 
      Error removing external metrics: status code 404 (text/plain; charset=utf-8)
      Please check versions of your PMM Server and PMM Client

      Another examples of problem with adding metrics:

      sudo pmm-admin add external:metrics ::: :::
      External metrics added.
      nailya.kutlubaeva@bm-dell06-qanqa03:~/download$ sudo pmm-admin add external:metrics ::: (_)
      -bash: syntax error near unexpected token `(' 
      nailya.kutlubaeva@bm-dell06-qanqa03:~/download$ sudo pmm-admin add external:metrics (_) 
      -bash: syntax error near unexpected token `('
      sudo pmm-admin remove external:metrics :::
      Error removing external metrics: scrape config with job name "::" not found

      Prometheus scrape job name itself doesn't have any limits: https://prometheus.io/docs/operating/configuration/#<job_name> But in our case, it should be URL-safe because we use it in the URL path in our REST API, and ":" is not the URL-safe symbol. I added validation, so now job name should match regular expression

      ^[A-Za-z][A-Za-z0-9_-]*${code}
      
      The second block of examples actually contains errors from the bash shell, see 

      -bash:

       at the begining. To try to use that funny symbols, one has to quote them:
      

      sudo pmm-admin add external:metrics ':::' '(_)'

       or 

      sudo pmm-admin add external:metrics '::: (_)'

      
      

      depending on intensions.

        Smart Checklist

          Attachments

            Activity

              People

              • Assignee:
                nailya.kutlubaeva Nailya Kutlubaeva
                Reporter:
                nailya.kutlubaeva Nailya Kutlubaeva
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: