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

Better error handling when pg_stat_monitor has an unsupported version

Details

    • Improvement
    • Status: Done
    • Medium
    • Resolution: Fixed
    • 2.16.0, 2.17.0
    • 2.19.0
    • None

    Description

      Suggested implementation:

      1. Check if versions is in right format (x.x.x) otherwise return error before split here: https://github.com/percona/pmm-agent/blob/master/agents/postgres/pgstatmonitor/pgstatmonitor.go#L125

       

      User impact: User cannot see QAN data for Postgresql

      STR:

      1. Add PostgreSQL to PMM with specified pg_stat_monitor option
      2. pg_stat_monitor should have unsupported version like 'devel'
      3. Check pmm-agent.log in PMM server
        Actual result:
         panic: runtime error: index out of range [1] with length 1
        goroutine 190 [running]:
        github.com/percona/pmm-agent/agents/postgres/pgstatmonitor.getPGMonitorVersion(0xc0005b2180, 0xc000419380, 0xc0007a76b0, 0xc0007a72af)
        	/tmp/go/src/github.com/percona/pmm-agent/agents/postgres/pgstatmonitor/pgstatmonitor.go:126 +0x345
        github.com/percona/pmm-agent/agents/postgres/pgstatmonitor.(*statMonitorCache).getStatMonitorExtended(0xc0005b4450, 0x166f900, 0xc000418ae0, 0xc0005b2180, 0x1, 0xc000418b10, 0xc000418b40, 0x0, 0x0)
        	/tmp/go/src/github.com/percona/pmm-agent/agents/postgres/pgstatmonitor/stat_monitor_cache.go:86 +0x2da
        github.com/percona/pmm-agent/agents/postgres/pgstatmonitor.(*PGStatMonitorQAN).Run(0xc0007c2f60, 0x166f900, 0xc000418ae0)
        	/tmp/go/src/github.com/percona/pmm-agent/agents/postgres/pgstatmonitor/pgstatmonitor.go:140 +0xf4
        runtime/pprof.Do(0x166f900, 0xc000418ae0, 0xc0005b2300, 0x2, 0x2, 0xc000248b20)
        	/usr/local/go/src/runtime/pprof/runtime.go:40 +0xcc
        created by github.com/percona/pmm-agent/agents/supervisor.(*Supervisor).startBuiltin
        	/tmp/go/src/github.com/percona/pmm-agent/agents/supervisor/supervisor.go:456 +0x694

      Expected result: More useful error message

      Attachments

        Issue Links

          Activity

            People

              jiri.ctvrtka Jiří Čtvrtka
              nailya.kutlubaeva Nailya Kutlubaeva
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Smart Checklist