Grafana

For improving the data visualization capabilities of Decidim, we have a working dashboard that can be imported to Grafana, an open-source observability and monitoring platform that allows users to visualize metrics, logs, and traces in real time from various data sources.

Initial set-up

The steps for having this dashboard are the following. For this tutorial we will use Grafana Cloud

  1. Go to http://grafana.com

    Grafana.com homepage
  2. Click in button "Create account"

  3. Fill the account creation form with your information

    Create an account form
  4. Confirm your email address

    Create an account form - confirm step
  5. Finish the setup account process

    Create an account form - setup step

Methods

Then, you have two options for connecting to any Decidim instance.

  1. CSV (Comma-Separated Values): A simple file format used to store tabular data, such as spreadsheets or databases. Each line in a CSV file represents a row, with values separated by commas or other separators (semi colons in the case of Decidim).

  2. GraphQL: A query language for APIs and a runtime for executing those queries. It allows clients to request only the data they need, reducing over-fetching and improving performance.

For demonstration purposes, we will use the Metadecidim installation.

CSV GraphQL

Using the Open Data features from https://meta.decidim.org/open-data

Using the GraphQL API features from https://meta.decidim.org/api

Only has access to the last 24 hours data

Has real-time access

Has access to all the public data

Has a limit on the number of resources. See Pagination of API responses

So, taking into account the last limitation from the Grafana Infinity GraphQL connector, we recommend using the CSV method if you need to access more than the last 10 or 20 resources.

Examples

As a starting point to check-out the possibilities of this integration, we have provided some examples with the two methods.

Import

For importing any of these methods, follow these instructions:

  1. Go to the "Dashboards" page and in the "New" button click in the "Import" option

    Dashboards page
  2. In the text area, paste the contents of any of the examples provided (see below).

    Import a dashboard page
  3. Click in the "Import" button

    Dashboards page
  4. Then you will see the imported Dashboard. Even though the examples are based on Metadecidim, are a good starting point to understand how to connect any Decidim API with Grafana.

    Dashboard CSV example page
    Dashboard GraphQL API example page

😊⌨️✨Happy hacking!