How percona/grafana-dashboards works
From our analysis of the repository’s file structure and README, it’s clear that this project is centered on providing Grafana dashboards for efficient database monitoring as part of Percona Monitoring and Management (PMM). The repository is not only a collection of JSON dashboard definitions but also incorporates custom Grafana panel plugins, a React/TypeScript–based frontend application (pmm-app) that likely integrates these dashboards into the PMM ecosystem, and several utility scripts (in misc) that assist in converting or cleaning up dashboards for use both inside and outside of PMM. There is also a separate “setup-page” module, which appears to be an independent front-end offering—possibly for AWS integration or deployment guidance.
Main Components
• Dashboard Definitions: The “dashboards” directory contains a large variety of JSON files categorized by database type (MongoDB, MySQL, PostgreSQL), system metrics (OS), query analytics, and even Kubernetes. These definitions are the blueprint for visualizing monitoring data.
• Custom Grafana Panels: The “panels” directory contains several custom Grafana panel plugins (such as the worldmap panel, piechart panel, polystat panel, etc.) with their own assets, source code, and configuration. These extend Grafana’s default capabilities.
• PMM Application (pmm-app): This folder holds the React/TypeScript code for the PMM UI (including components for Query Analytics (pmm-qan) and performance summaries (pmm-pt-summary)). It represents the interactive frontend that orchestrates and displays the dashboards.
• Utility Scripts (misc): Contains Python scripts for dashboard conversion and cleanup. These facilitate reusing dashboards for different environments (e.g., a dedicated Prometheus instance).
• Setup Page: The “setup-page” directory contains its own front-end code and build output, indicating a specialized interface (potentially for AWS setup or deployment instructions).
• CI/CD and Configuration: The presence of configuration files (Makefile, .editorconfig, GitHub workflows, etc.) shows the integration with the development and deployment toolchain.
Relationships and Data Flow
• Data Sources and Backend: Although the backend is not present in this repository, these dashboards and panels are designed to interact with data sources such as Prometheus, InfluxDB, or other monitoring databases. Data flows from these sources into Grafana.
• Dashboard Integration: The JSON files and custom panel plugins feed into Grafana, which uses them to render visualizations. The pmm-app likely integrates with Grafana or acts as a container providing a consolidated user interface over these dashboards.
• Conversion & Reuse: The conversion utilities (misc) demonstrate a bidirectional interaction—it allows converting PMM dashboards for standalone Prometheus setups and vice versa.
• Setup and Deployment: The “setup-page” module may link to deployment pipelines or serve as a guided configuration interface for setting up PMM in a cloud (e.g., AWS) environment.
Architectural Patterns and Technologies
• Modularity: The project is highly modular. Dashboard definitions, custom panels, the main React frontend, and conversion scripts are all in separate cohesive modules.
• Frontend Components: The pmm-app uses a component-based architecture (React components) for different dashboard panels, filters, and other UI elements.
• Plugin System: The panels represent a plugin-based design leveraging Grafana’s plugin capability.
• Scripting and Automation: The Python scripts in misc automate conversions and configurations.
• CI/CD Integrations: GitHub workflows and Makefiles simplify build and deployment processes.