Using the Operator

The Grafana operator installs CRDs to manage different kinds of Grafana configuration in your app’s own Phalanx config. The most useful are probably the GrafanaDashboard and GrafanaAlertRuleGroup CRDs. Unfortunately, the specs for these are really nasty. They are almost impossible to create by hand, and even hard to edit by hand.

The recommended process for creating one of these is to:

  1. Create it manually in the Grafana UI.

  2. Export it as JSON through the Grafana UI and save the JSON.

  3. Delete it through the Grafna UI.

  4. Use the exported JSON to create the resource in your app’s Phalanx config using the exported JSON.

Once you have created a dashboard or alert through one of these CRDs, any changes you make to it through the Grafana UI will be revered to the version specified in the Phalanx config. For simple changes, you can edit the resource in the Phalanx config directly. For more complex changes, you can:

  1. Make a copy of the thing manually in the Grafana UI.

  2. Make your changes to the copy.

  3. Export the copy as JSON and save the JSON.

  4. Replace the JSON in the Phalanx config with the new JSON.

  5. Delete the copy in the Grafana UI.