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

pmm-admin summary doesn't include client exporter and some other logs

Details

    Description

      User story:

      • As a PMM user, I need to have logs of pmm-agent and all exporters and other components managed by pmm-agent in Zip file we generate by pmm-admin summary command so that file has much more information and simplifies support cases investigations.  

       

      UI(CLI):

      #pmm-admin summary

       

      Will include pmm-agent.log file inside

       

      Acceptance criteria:

      • recent logs of all exporters included in "summary zip" together with pmm-agent, vmagent, and other possible components managed by pmm-agent 
      • logs from all binaries managed by pmm-agent  included into one file in zip archive returned by 'pmm-admin summary'  

       

      Original report:

      The pmm-admin summary outputs for the client don't contain output logs for pmm-agent itself:

      shell> ls -1
      list.txt
      pmm-admin-version.txt
      pmm-agent-config.yaml
      pmm-agent-version.txt
      status.json 

       

      An output like the following should be included:

      journalctl -u pmm-agent
      

       

      Tested with:

      shell> pmm-admin --version
      ProjectName: pmm-admin
      Version: 2.4.0
      PMMVersion: 2.4.0
      Timestamp: 2020-03-18 12:47:10 (UTC)
      FullCommit: bebe0b245b660eb6328f5a8ddb5b8805ca234dac 

       

      Suggested implementation:
      Ring buffer implementation example in go: https://github.com/smallnest/ringbuffer

      Logrus hook: https://github.com/sirupsen/logrus

       

      1. Add endpoint "/logs.zip" in pmm-agent to get logs.
        1. Response should be a zip file
      2. pmm-agent endpoint should also add logs from all running binaries.
        1. Keep them in one file.
      3. Store all logrus logs related to pmm-agent in ring buffer.
      4. Add request to get logs from pmm-agent endpoint in summary command in pmm-admin.
      5. Move all log files from logs.zip into logs directory in pmm-admin-summary.zip.
        1. Use the same approach like we use here https://github.com/percona/pmm-managed/blob/0e1553888d785269ea7eca0c3daa7a6f78eef9a2/services/supervisord/logs.go#L314

      How to test:

      • Run pmm-agent
      • Add mysql and mongodb service
      • Run pmm-admin summary command
      • Check that ~/pmm-agent/ folder in logs ZIP file contains logs of pmm-agent
      • Check that ~/pmm-agent/ folder in logs ZIP file contains following logs:
        • mysqld_exporter logs
        • mongodb_exporter logs
        • qan agent logs
        • pmm-agent log
          **

      Attachments

        Issue Links

          Activity

            People

              yaroslav.podorvanov Yaroslav Podorvanov (Inactive)
              agustin.gallego Agustín Gallego
              Votes:
              1 Vote for this issue
              Watchers:
              13 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 3 days, 6 hours
                  3d 6h

                  Smart Checklist