Apache Geode can collect Statistics about the distributed system and persist it in archive files. The StatisticsToGrafana
tool helps to load the archive files in time-series databases such as InfluxDB used to feed Grafana dashboards.
Use the stack to build comprehensive Grafana dashboards to visualize, analyse and compare statistics data from different cluster members or even different Geode clusters.
Get the source code from github
git clone https://github.com/tzolov/geode-dashboard.git
From within the geode-dashboard/statistics-to-grafana directory run
mvn clean install
Build Grafana dashboard to analyze the statistics files collected on two Geode instances (e.g. members).
Grafana and InfluxDB have to be installed first. Samples below expect InfluxDB on http://localhost:8086
and Grafana on http://localhost:3000
.
If the target InfluxDB database (GeodeArchive
for example) doesn't exist yet create one. You can do it through the influx
command-line tool:
influx> create database GeodeArchive
influx> show databases
or with the help of the --cleanDatabaseOnLoad=true
parameter. Later removes and creates again the time-series database.
Load the server1_StatisticsArchiveFile.gfs
file containing historical statistics for server1
cluster member into influx database GeodeArchive
. Set the measurement archiveMember tag to ‘server1’.
java -jar ./target/statistics-to-grafana-0.0.2-SNAPSHOT.jar \
--influxUrl=http://localhost:8086 \
--influxDatabaseName=GeodeArchive \
--geodeMemberName=server1 \
--archiveFile=server1_StatisticsArchiveFile.gfs
Load the server2_StatisticsArchiveFile.gfs
file containing historical statistics for server2
cluster member in the same influx database GeodeArchive
:
java -jar ./target/statistics-to-grafana-0.0.2-SNAPSHOT.jar \
--influxUrl=http://localhost:8086 \
--influxDatabaseName=GeodeArchive \
--geodeMemberName=server2 \
--archiveFile=server2_StatisticsArchiveFile.gfs
Note that the statistics from both files is loaded in the same database:
GeodeArchive
! ThearchiveMember
meta-tags (server1
andserver2
) is used to distinct both series. Use Grafana Templating to define multi-select query variables for thearchiveMember
meta-atag (e.g.show tag values with key="archiveMember"
). This allow mixing and matching measurments from different archive files.
Complete list of statistics-to-grafana parameters:
Property Name | Default Value | Description |
---|---|---|
influxUrl | http://localhost:8086 | InfulxDB connection URL |
influxUser | admin | InfuxDB connection username |
influxPassword | admin | InfluxDB connection password |
cleanDatabaseOnLoad | false | If set the target TSDB will be (re)created on every statistics load |
influxRetentionPolicy | autogen | InfluxDB retention policy |
archiveFile | None | File path to a single Geode statistics archive file. Note: every Geode instance (e.g. member) generates a statistics file. It is helpful to copy all the statistics files from all members into one directory so that you can easily load the files into InfluxDb. |
influxDatabaseName | GeodeArchive | Database to load the statistics into. Same database can be used to load statistics from multiple archive files. Use the geodeMemerName to distinct the time series |
geodeMemberName | None | Name that uniquely identifies the Geode instance (e.g. member) which produced the statistics being loaded |
allowedStatTypes | None | Comma separated list of Statistic Type Names to import. If empty all statistic is read |
skipZeroValuesTimeSeries | true | When true the time series that contain only zero values will not be imported |