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

pmm-admin purge causes client to panic

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.15.0
    • Component/s: PMM Client
    • Labels:
      None

      Description

      pmm-admin purge sends DELETE request to Prometheus, which isn't implemented in Prometheus 2.x.

       

      > DELETE /prometheus/api/v1/series?match[]={job="linux",instance="XXX"} HTTP/1.1
      > Host: 127.0.0.1
      > User-Agent: Go-http-client/1.1
      > Accept-Encoding: gzip
      {{> }}
      {{> }}
      2018/08/21 13:57:45 response:
      < HTTP/1.1 500 Internal Server Error
      < Access-Control-Allow-Headers: Accept, Authorization, Content-Type, Origin
      < Access-Control-Allow-Methods: GET, OPTIONS
      < Access-Control-Allow-Origin: *
      < Access-Control-Expose-Headers: Date
      < Connection: keep-alive
      < Content-Type: application/json
      < Date: Tue, 21 Aug 2018 11:57:45 GMT
      < Server: nginx
      {{< }}
      < {"status":"error","errorType":"internal","error":"not implemented"}
      panic: interface conversion: interface {} is nil, not map[string]interface {}goroutine 1 [running]:
      github.com/percona/pmm-client/pmm.(*Admin).PurgeMetrics(0xbe4e60, 0x7ffc6713756e, 0xd, 0xc4201735b8, 0xc42013db68, 0x7ff262)
      /tmp/go/src/github.com/percona/pmm-client/pmm/main.go:427 +0x5a4
      main.glob..func39(0xbde460, 0xc42017a340, 0x1, 0x2)
      /tmp/go/src/github.com/percona/pmm-client/pmm-admin.go:1179 +0xd1
      github.com/percona/pmm-client/vendor/github.com/spf13/cobra.(*Command).execute(0xbde460, 0xc42017a300, 0x2, 0x2, 0xbde460, 0xc42017a300)
      /tmp/go/src/github.com/percona/pmm-client/vendor/github.com/spf13/cobra/command.go:654 +0x2a2
      github.com/percona/pmm-client/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0xbdeb20, 0xc42013ddd0, 0x49b302, 0x0)
      /tmp/go/src/github.com/percona/pmm-client/vendor/github.com/spf13/cobra/command.go:729 +0x2d4
      github.com/percona/pmm-client/vendor/github.com/spf13/cobra.(*Command).Execute(0xbdeb20, 0xc0263c, 0x92bf0f)
      /tmp/go/src/github.com/percona/pmm-client/vendor/github.com/spf13/cobra/command.go:688 +0x2b
      main.main()
      /tmp/go/src/github.com/percona/pmm-client/pmm-admin.go:1398 +0x18dc

       

       

       

      The  API in  Prom2 - https://prometheus.io/docs/prometheus/latest/querying/api/#delete-series 

      Additionally, it's better to call  https://prometheus.io/docs/prometheus/latest/querying/api/#clean-tombstones after  a Prevoiuous call 

       

      TODO: 

      1) Implement both   Prom1 and Prom2   DELETE  requests   (be ready to get errors on them )

      2) If  `tsdb` request is OK - then  also  Do  Clean Tombstones  request to free space 

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                iwo.panowicz Iwo Panowicz
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 1 hour Original Estimate - 1 hour
                  1h
                  Remaining:
                  Time Spent - 2 days, 4 hours, 40 minutes Remaining Estimate - 1 hour
                  1h
                  Logged:
                  Time Spent - 2 days, 4 hours, 40 minutes Remaining Estimate - 1 hour
                  2d 4h 40m