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

Add/extend support for external Agents

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Done
    • Priority: Medium
    • Resolution: Won't Do
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      External agents are agents which are not run by pmm-agent.

      DoD

      • AddExternalAgent and ChangeExternalAgent APIs in Inventory API
      • AddExternal in Management API
      • /Agents/List and /Agents/Get enpoints should return external agents.
      • Updated prometheus config to monitor external exporter
      • `pmm-admin add external` command
      • `pmm-admin inventory add exporter external` command
      • API tests for all endpoints
      • See Smart Checklist.

      Implementation

      • Inventory API should be extended by 2 Endpoints:
        • AddExternalAgent
          • AddExternalAgent should accept bellowing fields:
            • runs_on_node_id(required)
            • listen_port(required)
            • http_basic_auth_username(optional)
            • http_basic_auth_password(optional)
            • custom_labels(optional)
            • skip_connection_check(optional)
        • ChangeExternalAgent
          • ChangeExternalAgent should let user enable/disable an agent and change custom_labels.
        • /Agents/List and /Agents/Get enpoints should return external agents.
      • Management API should be expanded by new endpoint: AddExternal
        • AddExternal should accept bellowing fields:
          •  one of
            • runs_on_node_id
            • address
          • listen_port (required)
          • http_basic_auth_username(optional)
          • http_basic_auth_password(optional)
          • custom_labels
          • skip_connection_check
        • We require `runs_on_node_id` xor `address` to be non-empty.
          If user provided `runs_on_node_id` we will use it.
          Else if user provided `address` we will create new RemoteNode.
          In other case we should return an error
      • PMM-managed should update prometheus config on adding or changing any info about external agents.
        • Agents address should be extracted from node.
      • Database schema and conditions in code should be checked/changed for as runs_on_node_id IS NOT NULL can also be true for external Agents.
      • `pmm-admin add inventory agent external` command.
        • The command should have following flags
          • --node-id (required)
          • --listen_port ( required)
          • --http_basic_auth_username(optional)
          • --http_basic_auth_password(optional)
          • --custom_labels(optional)
          • --skip_connection_check(optional)
        • The command should send request to Inventory APIs `AddExternalAgent` endpoint.
      • `pmm-admin add external` command.
        • The command should have following flags
          •  one of (required)
            • --node-id
            • --address
          • --listen_port ( required)
          • --http_basic_auth_username(optional)
          • --http_basic_auth_password(optional)
          • --custom_labels(optional)
          • --skip_connection_check(optional)
        • The command should send request to Inventory APIs `AddExternalAgent` endpoint.
        • We require `node-id` xor `address` to be non-empty.
          If both of them are empty or both of them aren't empty we should show an error.

      Discussion

      • Should we check connection to external exporter?

        Smart Checklist

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                Unassigned
                Reporter:
                alexey.palazhchenko Alexey Palazhchenko
                Votes:
                2 Vote for this issue
                Watchers:
                5 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 - 6 hours
                    6h