Tuesday, 14 May 2024

Introduction to Grafana

 



What is Grafana?

  • Web application for:
    • analytics
    • interactive visualization  - often a component in monitoring stacks in combination with:
      • time series databases:
        • InfluxDB
        • Prometheus
        • Graphite
      • monitoring platforms:
        • Sensu
        • Icinga
        • Checkmk
        • Zabbix
        • Netdata
        • PRTG
      • SIEMs (Security Information and Event Management - collects logs and events, normalizing this data for further analysis that can manifest as visualizations, alerts, searches, reports, and more.):
        • Elasticsearch
        • Splunk
      • other data sources.
  • Produces charts, graphs, and alerts for the web when connected to supported data sources
  • Multi-platform
    • Microsoft Windows
    • Linux
    • macOS
  • Licenses:
    • open source
    • licensed Grafana Enterprise
      • additional capabilities
      • sold as a self-hosted installation or through an account on the Grafana Labs cloud service
  • Expandable through a plug-in system
  • Complex monitoring dashboards can be built via interactive query builders

How to start with Grafana Web Application?


Grafana web app shows a list of:
  • Connections
  • Dashboards
    • for data visualization
    • can be grouped into folders
  • Playlists
    • groups of dashboards that are displayed in a sequence
    • they can be used to cycle dashboards on TVs without user control 
  • Snapshots
    • interactive, publicly available, point-in-time representations of dashboards
  • Library panels
    • Reusable panels that can be added to multiple dashboards


Grafana Connections 


Data sources grouped by types:

  • Time series databases
    • Prometheus - Open source time series database & alerting
    • Graphite - Open source time series database
    • InfluxDB - Open source time series database
    • OpenTSDB - Open source time series database
  • Logging & document databases
    • Loki - Like Prometheus but for logs. OSS logging solution from Grafana Labs
    • Elasticsearch - Open source logging & analytics database
  • Distributed tracing
    • Jaeger - Open source, end-to-end distributed tracing
    • ore
    • AWS Application Signals - Data source for AWS Application Signals
    • Tempo - High volume, minimal dependency trace storage. OSS tracing solution from Grafana Labs.
    • Zipkin - Placeholder for the distributed tracing system.
  • Profiling
    • Grafana Pyroscope - Data source for Grafana Pyroscope, horizontally-scalable, highly-available, multi-tenant continuous profiling aggregation system.
    • Parca - Continuous profiling for analysis of CPU and memory usage, down to the line number and throughout time. Saving infrastructure cost, improving performance, and increasing reliability.
  • SQL
    • MySQL - Data source for MySQL databases
    • Microsoft SQL Server - Data source for Microsoft SQL Server compatible databases
    • PostgreSQL - Data source for PostgreSQL and compatible databases
  • Cloud
    • Azure Monitor - Data source for Microsoft Azure Monitor & Application Insights
    • CloudWatch - Data source for Amazon AWS monitoring service
    • Google Cloud Monitoring - Data source for Google's monitoring service (formerly named Stackdriver)
    • Grafana Cloud - Hosted Graphite, Prometheus, and Loki
  • Enterprise plugins
    • Adobe Analytics - Adobe Analytics datasource
    • AppDynamics - AppDynamics integration and data source
    • Atlassian Statuspage - Atlassian Statuspage datasource
    • Aurora - Aurora data source
    • Azure CosmosDB - Azure CosmosDB datasource
    • Azure Devops - Azure Devops datasource
    • Catchpoint - Catchpoint datasource
    • Cloudflare - Cloudflare datasource
    • CockroachDB - CockroachDB datasource
    • DataDog - DataDog integration and data source
    • Drone - Drone datasource
    • Dynatrace - Visualize and explore Dynatrace data
    • GitLab - GitLab integration and datasource
    • Honeycomb - Honeycomb integration and datasource
    • Jira - Jira integration and datasource
    • MongoDB - MongoDB integration and data source
    • Netlify - Netlify datasource
    • New Relic - New Relic integration and data source
    • Oracle - Visualize and explore Oracle SQL
    • PagerDuty - PagerDuty datasource
    • SAP HANA® - SAP HANA® integration and data source
    • Salesforce - Salesforce integration and datasource
    • ServiceNow - ServiceNow integration and data source
    • Snowflake - Snowflake integration and data source
    • Splunk - Visualize and explore Splunk logs
    • Splunk Infrastructure Monitoring - SignalFx integration and datasource
    • SumoLogic - SumoLogic integration and datasource
    • Wavefront - Wavefront integration and data source
    • Zendesk - Zendesk datasource
  • Others
    • Alertmanager - Add external Alertmanagers (supports Prometheus and Mimir implementations) so you can use the Grafana Alerting UI to manage silences, contact points, and notification policies.
    • GitHub - The GitHub data source plugin for Grafana lets you to query the GitHub API in Grafana so you can visualize your GitHub repositories and projects.
    • TestData - Generates test data in different forms

Grafana Dashboards





How to create a new Dashboard?

We can add a visualisation by selecting a data source and then querying and visualising data with charts, stats and tables or by creating lists, markdowns and other widgets.


There is also a drop-down menu in the context of the dashboard, with the same content:


Adding a visualization actually adds a new panel:


We can toggle a Table view and see data points as rows in a table instead of the graph:


In the right-hand side panel we can choose Visualisation type:

For example, Bar chart would look like this:


Suggestions tab show thumbnails for various visualisations:


Related panels can be grouped into rows.


How to use Amazon CloudWatch as Grafana data source?


Grafana admin can create a new Amazon CloudWatch data source by specifying the following:


Make sure that IAM user that Grafana will be using to authenticate to AWS has a proper access policy attached as per Amazon CloudWatch data source | Grafana documentation.


How to migrate a dashboard from one to another instance of Grafana?

Click on Share icon which is to the right of the dashboard name:


Click on Export tab and tick Export for sharing externally checkbox:


Save the file. In another Grafana instance, click the Import button:


And then upload the exported JSON file:


Make sure you select the correct data source (which needs to be set up in the same way as corresponding data source in the origin Grafana instance):



Click Import and dashboard will appear, with all the panels within.


---

No comments: