The Kafka data source plugin allows you to visualize streaming Kafka data from within Grafana.
Note: This is a backend plugin, so the Grafana server should've access to the Kafka broker.
Use the grafana-cli tool to install the plugin from the commandline:
grafana-cli plugins install hamedkarbasi93-kafka-datasource
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 latest release .zip file and unpack it into your grafana plugins directory; the default is /var/lib/grafana/plugins
.
Add a data source by filling in the following fields:
Field | Description |
---|---|
Name | A name for this particular AppDynamics data source |
Servers | The URL of the Kafka bootstrap servers separated by comma. E.g. broker1:9092, broker2:9092 |
To query the Kafka topic, you have to config the below items in the query editor.
Field | Description |
---|---|
Topic | Topic Name |
Partition | Partition Number |
Auto offset reset | Starting offset to consume that can be from latest or last 100. |
Timestamp Mode | Timestamp of the message value to visualize; It can be Now or Message Timestamp |
Note: Make sure to enable the
streaming
toggle.
This plugin supports topics publishing very simple JSON formatted messages. Note that only the following structure is supported as of now:
{
"value1": 1.0,
"value2": 2,
"value3": 3.33,
...
}
We plan to support more complex JSON data structures, Protobuf and AVRO in the upcoming releases. Contributions are highly encouraged!
Note: there are build issues with Node v16. Use Node v14. Known working dev environments:
and
A data source backend plugin consists of both frontend and backend components.
Install dependencies
yarn install
Build plugin in development mode or run in watch mode
yarn dev
or
yarn watch
Build plugin in production mode
yarn build
Update Grafana plugin SDK for Go dependency to the latest minor version:
go get -u github.com/grafana/grafana-plugin-sdk-go
go mod tidy
Build backend plugin binaries for Linux:
mage build:backend
Thank you for considering contributing! If you find an issue or have a better way to do something, feel free to open an issue or a PR.
This repository is open-sourced software licensed under the Apache License 2.0.