Grafana

Last modified by Peter Wurbs on 2025/05/07 11:36

Grafana Icon Logo PNG vector in SVG, PDF, AI, CDR format

Content

Introduction

Grafana is an open-source platform for monitoring and visualizing time-series data from sources like Prometheus, Loki, Databases etc. It allows users to create interactive dashboards and alerts to track system performance and trends in real time.

Vendor Page

There is good documentation to start using Grafana:

Grafana Documentation

Grafana Tutorials

There is a great possibility to play with Grafana using the Grafana Playground

Accessing Grafana

  • Grafana as part of the DevOps-as-a-Service toolchain can be accessed by either
  • Preconditions in DevOps portal to access Grafana:
    • A Grafana license must be assigned to the user
    • Grafana must be added to the tool list of the project
  • If you are not already logged in to another tool in the toolchain, then you have to login using your configured SSO credentials.
  • When you see this message after entering your credentials, then you don't have a Grafana license assigned in the DevOps portal:
    1744266590219-161.png

Users, Projects and Roles

  • Projects, users and their roles in projects are managed in the DevOps portal, the corresponding functions in Grafana are disabled (UI and API)

⚠ Note
Projects in DevOps portal are mapped to Grafana Organizations. These are not related to the organizations in the portal. 

  • When there is a new project in the portal having Grafana as a configured tool, then there is a new Grafana Organization. Users assigned to a project in the portal are then assigned to a Grafana Organization applying the configured roles.
    • Role mapping: 
      Project Role in DevOps PortalGrafana Organization RolePermissions in Grafana
      AdminAdminHas full permissions within the Grafana org, e.g. can setup datasources, manage folders, teams and service accounts
      MasterEditorCan create/edit dashboards and alerts and use the Explore function
      Developer
      ViewerViewerCan view dashboards and alerts

      A detailed description of the Grafana role model can be found here.

  • There is an additional permission management possible on folder level. A folder contains a set of dashboards. A project admin can create folders and manage specific permissions for this folder using Grafana. See this link for further information. Folder permissions management is out of scope of the user management in the DevOps portal.
  • A project admin is entitled to create and manage "Service Accounts" in Grafana and grant permissions in the specific organization. A Service Account belongs to an Organization and not to an user. Service Accounts can be used for systems which want to work wit the Grafana API for any automation purposes. See this link for further information. Service Account management is done directly in Grafana and is out of scope of the user management in the DevOps portal. This function is comparable with the Technical Users feature in the DevOps portal.
  • If you are assigned to more than one project in the DevOps portal, having Grafana configured as tool, then you can switch between Organizations in Grafana. Go to the top left corner, click on the Org list and select any other Grafana Organization (project), you want to switch to.
    1744272203893-682.png

⚠ Note
When you work in Grafana, always make sure that you chose the intended Organization.

Main Functions

Datasources

  • Before you can setup dashboards and alerts, you have to setup datasources. Grafana itself is only a visualization tool, for data gathered via datasources.
  • Datasources are created/managed per Grafana Organization.
  • The Admin role is required to setup and manage datasources.

⚠ Note
When a datasource is available in an Organization, every user assigned to this Organization (Project) with Admin or Edit role can access/explore the data provided by this datasource. 

  • Most common datasources are available for
    • Prometheus to visualize metrics
    • Loki to search and visualize logs
    • MySQL, PostgreSQL to access and visualize database data
    • ...
  • Many possible datasource types are preinstalled as built-in plugins and can be used
  • Datasource are set up via Menu panel → Connections → Datasources
    1744273328067-517.png
  • Detailed information can be found via this link.

Explore

  • Based on set up datasources, users owning the Edit or Admin role can explore provided data using the "Explore" function. 
  • "Explore" can be used for:
    • Check provided data, contained labels
    • Search for specific data
    • Quickly execute queries and generate visualization panels
    • Generate queries later to be used in dashboards
  • "Explore" function can be found in the Menu panel
  • Detailed information can be found via this link

Dashboards

  • Dashboards are the way to visualize metrics, logs and other data.
  • Dashboards are a collection of "Panels". Each panel is of a specific type (stat, time series, table, log...). Many Panel Plugins are preinstalled and can be used.
  • Data is displayed based on queries which are the main part of a panel configuration.
  • Dashboards can be created and edited by users owning the Editor or Admin role
  • "Dashboard" function can be found in the Menu panel
  • There is a good guideline about the first steps.
  • Detailed information can be found via this link.

Alerts

  • Based on the data gathered via datasources, alerts can be defined.
  • In contrast to the classic alerting, the new Grafana Unified Alerting is set up mostly independent of specific dashboards.
  • Alerting configuration is split into
    • Alert rules
    • Contact points
    • Notification policies
  • How it works
    • Grafana alerting periodically queries data sources and evaluates the condition defined in the alert rule
    • If the condition is breached, an alert instance fires
    • Firing instances are routed to notification policies based on matching labels
    • Notifications are sent out to the contact points specified in the notification policy
    • 1744277362911-905.png
  • Many contact point types like E-Mail, Teams, Slack, Pushover etc. are available and can be configured.
  • "Alerting" function can be in the Menu panel
  • Detailed information can be found via this link.

Metrics of DevOps-as-a-Service Toolchain

  • As part of the Grafana deployment, preconfigured and standardized dashboards are provided to show relevant data about the DevOps-as-a-Service toolchain
  • These dashboards are located in the MainOrg.
  • To access them:
    • Switch to the MainOrg in the Org list on the top left corner.
    • Click on Dashboards in the left Menu pane
    • Click on folder "DevOps-as-a-Service Metrics"
    • Choose the dashboard you want to see (dashboards are provided little by little):
    • 1744278056971-203.png
    • Alternatively, you can use the link in the "Useful Links" panel of the Grafana Home page.
      1744285635938-113.png

 ⚠ Note
Every user assigned a Grafana license in the DevOps portal is able to access them, independent of any project assignment.