Creating a metrics dashboard plugin
We’re going to create a simple metrics dashboard that is accessible via the menu bar in our local Airflow environment. To easily generate the charts for the dashboard, we’ll be using Chart.js. Chart.js is a simple and flexible charting library written in JavaScript. It provides a set of frequently used chart types, plugins, and customization options and a set of built-in chart types. More information about Chart.js can be found on the documentation page at https://www.chartjs.org/docs/latest/.
Let’s outline the steps to create a custom Airflow UI plugin for a metrics dashboard.
Step 1 – project structure
Airflow plugins are stored in a plugins
directory, which must be added to the Airflow home directory before Airflow starts up. This is because plugins are lazily loaded by default, and any changes to the plugin will require a restart of the Airflow services. Let’s organize the plugins
directory with the...