How percona/pmm works
Major components
• PMM Server: The heart of the system. It provides the web interface (dashboards, administration), aggregates metrics, manages alerts, and communicates with agents. In the file tree you see directories like “admin”, “api”, “managed”, and “vmproxy” that indicate components for administration, API endpoints, and proxying.
• PMM Client / Agent: The code in directories “agent” and “qan-api2” include functionalities for metric collection, log analysis, query reporting, and interacting with various exporters. The agents are deployed on monitored database hosts to collect performance data and send it to the server.
• Exporters and Integration Modules: Inside the “agent” directory and in subfolders (such as “agents”, “runner”, and “queryparser”), there are specialized modules that interface with MySQL, MongoDB, PostgreSQL, etc. They translate database-specific metrics into a common format.
• Data Stores and Time-Series Databases: Although not directly visible as a specific directory in code, the architecture relies on external time-series databases (like Prometheus and/or VictoriaMetrics) to store collected metrics. The readme and documentation images show integration with Grafana and Prometheus.
• Web UI / Dashboard: The PMM Server provides a dashboard (as shown in the readme login screenshot) that offers in-depth performance visualization. This layer ties to the API components (files under “api” directory) that support both REST and gRPC interfaces.
Breakdown architectural interactions
• Agents on monitored nodes (PMM Client) collect metrics and perform local analysis. They communicate via gRPC or REST to push data to the PMM Server.
• The PMM Server (including “admin”, “api”, “managed” services) receives metric data and aggregates it. The server then pushes data to and queries time-series storage as needed.
• The system supports external integrations like Grafana for dashboards, Alertmanager for notifications, and possibly additional integration to cloud services.
• The “qan-api2” component indicates a specialized analytics layer that handles advanced query analytics and reporting.
• VMProxy, managed modules, and update modules indicate additional microservices that assist in proxying client connections, managing configuration, performing upgrades, and handling high-availability requirements.
Architectural patterns and design principles
• Microservices: The use of several distinct directories (admin, agent, api, managed, qan-api2, vmproxy) shows a modular, service-oriented approach where each component has a specialized responsibility.
• Client/Server separation: The PMM server offers a centralized control and visualization layer while agents deployed in individual instances handle collection and real-time monitoring.
• Use of both REST and gRPC: The presence of protobuf definitions and .pb.go files across api and agent directories illustrate that multiple communication protocols are used for inter-service communication.
• Containerization and orchestration: The numerous Dockerfiles, docker-compose files, and build scripts indicate deployment and orchestration best practices. (This helps to ensure that each service can be deployed independently.)
Additional notes
• Annotations or notes on each connection if any specific protocol or technology (e.g., Prometheus for time-series data, gRPC for low-latency inter-service communication) is used.