From f744a9553ed4d9e130748fd4ff10dcb4e3716b01 Mon Sep 17 00:00:00 2001 From: Richard Tief <56597015+richardtief@users.noreply.github.com> Date: Fri, 18 Oct 2024 13:50:08 +0200 Subject: [PATCH] docs(plutono): How to create dashboards (#449) * docs(plutono): How to create dashboards * docs(plutono): formatting * docs(plutono): short links Co-authored-by: Tommy Sauer * docs(plutono): link var Co-authored-by: Tommy Sauer * docs(plutono): improved wording Co-authored-by: Tommy Sauer * docs(plutono): wording --------- Co-authored-by: Tommy Sauer --- plutono/README.md | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/plutono/README.md b/plutono/README.md index 51f0082a..4438a569 100644 --- a/plutono/README.md +++ b/plutono/README.md @@ -23,6 +23,8 @@ The plugin works by factory default with anonymous access enabled. If you use th Dashboards are selected from `ConfigMaps` across namespaces. The plugin searches for `ConfigMaps` with the label `plutono-dashboard: "true"` and imports them into Plutono. The `ConfigMap` must contain a key like `my-dashboard.json` with the dashboard JSON content. [Example](https://github.com/cloudoperators/greenhouse-extensions/blob/main/plutono/README.md#example-dashboard-config) +A guide on how to create dashboards can be found [here](#dashboard). + **Step 2: Add your datasources** Data sources are selected from `Secrets` across namespaces. The plugin searches for `Secrets` with the label `plutono-dashboard: "true"` and imports them into Plutono. The `Secrets` should contain valid datasource configuration YAML. [Example](https://github.com/cloudoperators/greenhouse-extensions/blob/main/plutono/README.md#example-datasource-config) @@ -332,12 +334,39 @@ dashboards: datasource: - name: DS_PROMETHEUS value: Prometheus - - name: DS_LOKI - value: Loki local-dashboard: url: https://raw.githubusercontent.com/user/repository/master/dashboards/dashboard.json ``` +## Create a dashboard {#dashboard} + +1. Click **Dashboards** in the main menu. +2. Click **New** and select **New Dashboard**. +3. Click **Add new empty panel**. +4. **Important:** Add a datasource variable as they are provisioned in the cluster. + - Go to **Dashboard settings**. + - Click **Variables**. + - Click **Add variable**. + - General: Configure the variable with a proper **Name** as **Type** `Datasource`. + - Data source options: Select the data source **Type** e.g. `Prometheus`. + - Click **Update**. + - Go back. + +5. Develop your panels. + - On the **Edit panel** view, choose your desired **Visualization**. + - Select the datasource variable you just created. + - Write or construct a query in the query language of your data source. + - Move and resize the panels as needed. +6. Optionally add a **tag** to the dashboard to make grouping easier. + - Go to **Dashboard settings**. + - In the **General** section, add a **Tag**. +7. Click **Save**. Note that the dashboard is saved in the browser's local storage. +8. Export the dashboard. + - Go to **Dashboard settings**. + - Click **JSON Model**. + - Copy the JSON model. + - Go to your Github repository and create a new JSON file in the `dashboards` directory. + ## BASE64 dashboards Dashboards could be stored on a server that does not return JSON directly and instead of it returns a Base64 encoded file (e.g. Gerrit)