Enable Apache Ignite metrics


What's inside this article ⌄
  • How to enable Ignite metrics
  • Apache Ignite metrics configuration
  • Ignite monitoring setup
  • Ignite performance metrics enable

There are a lot of pre-configured metrics in Ignite that are disabled by default.


Enabling metrics

If you want to see them, you may pass instance of LogExporterSpi to IgniteConfiguration like this:

public IgniteConfiguration clientIgniteConfiguration() {
    IgniteConfiguration igniteConfiguration = new IgniteConfiguration();

    // Default metrics, that enabled for default
    // To disable them, you need to set this to 0
    igniteConfiguration.setMetricsLogFrequency(120_000);

    // Additional metrics, that disabled for default
    LogExporterSpi logExporter = new LogExporterSpi();
    logExporter.setPeriod(120_000);
    igniteConfiguration.setMetricExporterSpi(logExporter);

    //...
    return igniteConfiguration;
}

You can work with Ignite metrics in some number of ways, not only through the logging system. For example:

  • JMX
  • SQL Views
  • OpenCensus

Please refer to Ignite documentation for details.


Filtering metrics

You can filter metrics that you need. For example, if you need only io.communication and sys metric groups, you need to add this line:

logExporter.setExportFilter(mreg -> {
    return mreg.name().startsWith("io.communication") || mreg.name().startsWith("sys")
});

If you want to see the names of all the groups, you can do this trick:

logExporter.setExportFilter(mreg -> {
    System.out.println("Group Name: " + mreg.name());
    return true;
});