yuntanghsu / grafana_sankey_plugin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Grafana Sankey Plugin

What is Grafana Sankey Panel Plugin?

Grafana Sankey Panel Plugin enables users to create Sankey Diagram panel in Grafana Dashboards. Panels are the building blocks of Grafana. They allow you to visualize data in different ways. For more information about panels, refer to the documentation on Panels. An example of Sankey Panel Plugin:

Sankey Panel Plugin Example

Acknowledgements

The Sankey Plugin is created using the Google Chart.

Data Source

Supported Databases:

  • Clickhouse

Queries Convention

Currently the Sankey Plugin is created for restricted uses, only for visualizing network flows between the source and destination. To correctly loading data for the Sankey Plugin, the query must at least return 3 fields, in arbitrary order.

  • field 1: the metric value field with an alias of bytes
  • field 2: value to group by with name or an alias of source
  • field 3: value to group by with name or an alias of destination
  • field 4+(optional): value to group by with name or an alias of destinationIP

Clickhouse query example:

select SUM(octetDeltaCount) as bytes, sourcePodName as source, destinationPodName as destination, destinationIP
From flows
GROUP BY source, destination, destinationIP

Installation

1. Install the Panel

Installing on a local Grafana:

For local instances, plugins are installed and updated via a simple CLI command. Use the grafana-cli tool to install sankey-panel-plugin from the commandline:

grafana-cli --pluginUrl https://downloads.antrea.io/artifacts/grafana-custom-plugins/theia-grafana-sankey-plugin-1.0.1.zip plugins install theia-grafana-sankey-plugin

The plugin will be installed into your grafana plugins directory; the default is /var/lib/grafana/plugins. More information on the cli tool.

Alternatively, you can manually download the .zip file and unpack it into your grafana plugins directory.

Download

Installing to a Grafana deployed on Kubernetes:

In Grafana deployment manifest, configure the environment variable GF_INSTALL_PLUGINS as below:

env:
- name: GF_INSTALL_PLUGINS
   value: "https://downloads.antrea.io/artifacts/grafana-custom-plugins/theia-grafana-sankey-plugin-1.0.1.zip;theia-grafana-sankey-plugin"

2. Add the Panel to a Dashboard

Installed panels are available immediately in the Dashboards section in your Grafana main menu, and can be added like any other core panel in Grafana. To see a list of installed panels, click the Plugins item in the main menu. Both core panels and installed panels will appear. For more information, visit the docs on Grafana plugin installation.

Customization

This plugin is built with @grafana/create-plugin, which is a CLI that enables efficient development of Grafana plugins. To customize the plugin and do local testings:

  1. Install dependencies

    cd grafana-sankey-plugin
    yarn install
  2. Build plugin in development mode or run in watch mode

    yarn dev

    or

    yarn watch
  3. Build plugin in production mode

    yarn build

Learn more

About

License:Apache License 2.0