Monitoring GridGain Clusters with New Relic
Monitoring and alerting are essential parts of any production system. GridGain has its own management and diagnostics tools in Control Center. However, if you want to monitor your entire application portfolio, you need a more generalized solution. One popular option is New Relic, which is an "all-in-one observability platform" that provides "data for engineers to monitor, debug, and improve their entire stack" (quotes are from the New Relic website).
This tutorial shows you how to export GridGain metrics and logs to New Relic.
We’ll use the OpenTelemetry Java agent to extract metrics from GridGain and export them to New Relic. We are assuming a basic GridGain installation on bare metal or on a VM. More sophisticated approaches may be available when deploying to Kubernetes.
The New Relic integration process is as follows:
Find Your New Relic Account Details
Log into your New Relic account.
Find your API key:
Click your username in the bottom left corner of the screen.
Select API keys.
Find the correct license key of type
INGEST - LICENSE.
From the license key’s context menu, and select Copy key.
Save the key aside - you will need it later.
Install the OpenTelemetry Java Agent
Get the latest version of the OpenTelemetry Java agent.
Make sure you install a copy of the agent on each of your GridGain nodes.
Configure GridGain to Use the Agent
Set the necessary server parameters in your JVM_OPTS. For example:
export JVM_OPTS="-Xmx5g -XX:+UseG1GC -DIGNITE_QUIET=false \ -Djava.net.preferIPv4Stack=true \ -javaagent:$AGENT_PATH/opentelemetry-javaagent.jar \ -Dotel.exporter.otlp.endpoint=$NEW_RELIC_ENDPOINT \ -Dotel.exporter.otlp.headers=api-key=$NEW_RELIC_API \ -Dotel.service.name=$SERVICE_NAME \ -Dotel.jmx.config=$NEW_RELIC_CONFIG/gridgain-newrelic.yaml"
$NEW_RELIC_API is the key you have copied from your New Relic account.
$SERVICE_NAME is the name of a cluster or application. This should uniquely identify the entire cluster. An example might be
To identify your GridGain nodes in New Relic, name them. It is recommended to use the consistent ID; for example:
To collect logs in New Relic, set the following:
export OTEL_EXPORTER_OTLP_COMPRESSION=gzip export OTEL_LOGS_EXPORTER=otlp
The sample startup script includes all the above parameters.
The sample configuration file maps many of GridGain’s JMX metrics to New Relic. You can import other metrics to meet your specific requirements.
View Cluster Metrics in the Dashboard
The sample dashboard looks like this:
To import the dashboard and use it for viewing the cluster metrics:
In New Relic, select Dashboard from the menu bar on the left-hand side.
At the top right of the screen, click Import dashboard.
Copy the JSON content from the sample dashboard file and paste it into the dialog.
Click Import dashboard.
Once your metrics and logs have been imported into New Relic, you have many options for analyzing them. Check out the New Relic documentation for details.
GridGain can help you decide on the best metrics to track. Start with the Monitoring Apache Ignite Clusters with GridGain Nebula and Principles of Logging in Apache Ignite lessons at the GridGain University.