GridGain Developers Hub

Monitoring GridGain Clusters with New Relic

Principal Consultant, EMEA

Overview

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.

The Process

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

  1. Log into your New Relic account.

  2. Find your API key:

    account details

    1. Click your username in the bottom left corner of the screen.

    2. Select API keys.

    3. Find the correct license key of type INGEST - LICENSE.

    4. From the license key’s context menu, and select Copy key.

    5. Save the key aside - you will need it later.

Install the OpenTelemetry Java Agent

  1. Get the latest version of the OpenTelemetry Java agent.

  2. 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_ENDPOINT is https://otlp.eu01.nr-data.net:4317 if you are in the US, https://otlp.nr-data.net:4317 otherwise. Check the New Relic documentation for the most up-to-date information.

$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 gridgain-prod.

To identify your GridGain nodes in New Relic, name them. It is recommended to use the consistent ID; for example:

export OTEL_RESOURCE_ATTRIBUTES=service.instance.id=gridgain-prod-node-1

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:

gg dashboard

To import the dashboard and use it for viewing the cluster metrics:

  1. In New Relic, select Dashboard from the menu bar on the left-hand side.

  2. At the top right of the screen, click Import dashboard.

  3. Copy the JSON content from the sample dashboard file and paste it into the dialog.

  4. Click Import dashboard.

Learn More

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.