XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Done
    • Priority: Medium
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 2.0.0-pre-0405
    • Component/s: PMM Agent
    • Labels:
      None

      Description

      JFYI

      https://confluence.percona.com/display/PMM/pmm-agent

      User Stories

      As a PMM User, I want to pmm-admin list command so that I can get all services and agents running on the current node (without set node_id explicitly).

      As a PMM User, I want to pmm-admin status command so that I can get information about the agent is being run on the same with pmm-admin node.

      As a PMM User, I want to pmm-admin add ... command so that I can add service/agent/etc. to the current node (without set node_id and/or pmm_agent_id explicitly).

      UseCases

      Get pmm-agent status and logs from pmm-admin (pmm-admin status)

      Actor: PMM User

      Precondition: User enters ssh terminal on the server where `pmm-agent` is running

      Main Success Scenario:

      1. The user enters pmm-admin status command.
      2. pmm-admin calls pmm-agent local API.
      3. pmm-agent give information (described below) about itself to pmm-admin.
      4. pmm-admin prints that information to the user.

      Extensions:

      E1: Provide an addional flag to get agents logs

      1. The user provides an additional flag to pmm-admin to get agents logs
      2. pmm-admin set this flag when calls pmm-agent local API.
      3. pmm-agent adds agent logs in response

      Add new service/agent/etc. on the node where pmm-agent is running (pmm-admin add service ...)

      Actor: PMM User

      Precondition: User enters ssh terminal on the server where pmm-agent is running and where he wants to add new agent/service/etc.

      Main Success Scenario:

      1. The user enters pmm-admin add ... command.
      2. pmm-admin calls pmm-agent local API.
      3. pmm-agent give information (described below) about itself to pmm-admin.
      4. pmm-admin uses node_id and pmm_agent_id to call pmm-managed Management/Inventory API

      List add services and agents on the node where pmm-agent is running (pmm-admin list)

      Actor: PMM User

      Precondition: User enters ssh terminal on the server where pmm-agent is running.

      Main Success Scenario:

      1. The user enters pmm-admin list command.
      2. pmm-admin calls pmm-agent local api to get node_id and pmm_agent_id
      3. pmm-agent give information (described below) about itself to pmm-admin
      4. pmm-admin uses that information to call Inventory API and get information about services and agents running on current node.
      5. pmm-admin prints that information to the user.

      Technical Requirements

      • gRPC should listen on: 127.0.0.1:7776
      • API should listen on: 127.0.0.1:7777
      • Address SHOULD NOT be configurable
      • Port SHOULD be configurable
      • DefaultServeMux MUST be used for HTTP handlers
      • expvar endpoint SHOULD be exposed on /debug/vars URI
      • net/http/pprof SHOULD be exposed on /debug/pprof URI
      • PMM Server Info SHOULD be exposed on /local/Status URI
      • runs_on_node_id SHOULD be added to AgentConnectMetadata Response.
      • Get server_info.version from initial server response metadata.

      Parameters should be accepted by local API Endpoint request

      • get_logs - Boolean flag. If true, we should add agents logs to response.

      Data should be exposed by local API Endpoint response

      • agent_id
      • runs_on_node_id
      • server_info
        • url (string)
        • insecure_tls (bool)
        • last_ping_time (timestamp)
        • latency (duration)
        • version (string)
      • agents_info
        • pmm_agent (repeated)
          • agent_id
          • agent_type
          • status
          • logs (repeated string)

       

        Smart Checklist

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  alexey.palazhchenko Alexey Palazhchenko
                  Reporter:
                  alexey.palazhchenko Alexey Palazhchenko
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:

                    Time Tracking

                    Estimated:
                    Original Estimate - Not Specified
                    Not Specified
                    Remaining:
                    Remaining Estimate - Not Specified
                    Not Specified
                    Logged:
                    Time Spent - 1 week, 1 hour, 45 minutes
                    1w 1h 45m