Skip to main content
Version: 3.0.0

Configuring Metrics

Metric management is performed through the Ignite CLI tool.

Listing Metric Sources

You can list all available metric sources for a node or for the entire cluster.

node metric source list
cluster metric source list

Listing Metrics

You can list all metrics for a node.

note

To see the list of metrics, you need to enable the relevant metric sources - see Enabling Metric Sources.

node metric list

The above command returns the list of all currently available metrics organized with their exporters.

Enabling Metric Sources

Metric collection might affect the performance of an application. Therefore, by default, all metric sources are disabled.

Metric sources can be enabled:

  • On per-node basis - you can specify the node to interact with by using the -u parameter to specify node URL or -n parameter to specify node name.
  • For the entire cluster.

For example:

node metric source enable -n=defaultNode jvm
cluster metric source enable jvm

Disabling Metric Sources

Metric sources can be disabled:

  • On per-node basis - you can specify the node to interact with by using the -u parameter to specify node URL or -n parameter to specify node name.
  • For the entire cluster.

For example:

node metric source disable -n=defaultNode jvm
cluster metric source disable jvm

Configuring Metrics Exporters

To access the collected metrics with external tools, you need to configure metrics exporters.

JMX

The JMX exporter provides information about Ignite nodes in JMX(Java Management Extensions) format. When the exporter is enabled, the node exposes the metrics to monitoring tools.

You can enable the JMX exporter in the following way:

cluster config update ignite.metrics.exporters.myJmxExporter.exporterName=jmx

After you do, JMX monitoring tools will be able to collect enabled metrics from the specified nodes:

JMX Metrics

You can also open internal JDK modules required for JMX, enable the remote JMX agent, configure the connection port, authentication, and SSL. Add the following JVM options to your Ignite node configuration:

--add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED

-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=<PORT_NUMBER>
-Dcom.sun.management.jmxremote.authenticate=true|false
-Dcom.sun.management.jmxremote.ssl=true|false

Log Exporter

Log exporter writes metrics data to the application log, so they can be consumed by log collectors or inspected manually. To configure it, use the following parameters:

NameDescriptionDefault value
periodMillisExport interval for the metrics, in milliseconds.30000
oneLinePerMetricSourceDefine whether to print all metrics from one metric source on a single log line.true
enabledMetricsList of enabled metric sources. If this list is non-empty, only the listed metric sources will be printed, all others will be skipped. A wildcard can be used to match a prefix (for example, jvm.*). By default, the metrics of some background activities are printed."metastorage", "placement-driver", "resource.vacuum"

To add log exporter to cluster exporters list, run the following command and define all the metrics to print in enabledMetrics list:

cluster config update ignite.metrics.exporters.logPush '{"exporterName":"logPush","periodMillis":30000,"oneLinePerMetricSource":true,"enabledMetrics":[]}'

Updated exporters configuration should look like this:

exporters=[
{
enabledMetrics=[]
exporterName=logPush
name=logPush
oneLinePerMetricSource=true
periodMillis=30000
}
]

OpenTelemetry

The OpenTelemetry exporter connects to an OpenTelemetry service that is provided in configuration and sends cluster information to it. Each node sends metrics independently, and requires access to the specified endpoint.

The example below shows the basic OpenTelemetry configuration. As OpenTelemetry services require different URL formats and may require headers, this example may not work for your environment.

cluster config update ignite.metrics.exporters.test: {exporterName:otlp, endpoint:"http://localhost:9090/api/v1/otlp/v1/metrics", protocol:"http/protobuf"}

OpenTelemetry exporter created by this command will look like this:

{
compression=gzip
endpoint="http://localhost:9090/api/v1/otlp/v1/metrics"
exporterName=otlp
headers=[]
name=test
periodMillis=30000
protocol="http/protobuf"
ssl {
ciphers=""
clientAuth=none
enabled=false
keyStore {
password="********"
path=""
type=PKCS12
}
trustStore {
password="********"
path=""
type=PKCS12
}
}
},

Below are the descriptions of configuration parameters:

NameDescriptionDefault value
compressionHow the payload is compressed. Possible values: none, gzip.gzip
endpointThe OpenTelemetry endpoint. Each node resolves the endpoint individually.
exporterNameExporter name. Must be otlp to use OpenTelemetry.
headersRequest headers, if any.
nameUser-defined exporter name, used to refer to it in Ignite.
periodMillisExport interval for the metrics, in milliseconds.30000
protocolThe protocol that is used to send OpenTelemetry data. Possible values: grpc, http/protobuf.grpc
ssl.ciphersList of ciphers to enable, comma-separated. Empty for automatic cipher selection.
ssl.clientAuthWhether the SSL client authentication is enabled and whether it is mandatory.
ssl.enabledDefines if SSL is enabled.false
ssl.keyStore.passwordSSL keystore password.
ssl.keyStore.pathPath to the SSL keystore.
ssl.keyStore.typeKeystore type.PKCS12
ssl.trustStore.passwordTruststore password.
ssl.trustStore.pathPath to the truststore.
ssl.trustStore.typeTruststore type.PKCS12

Connection to Grafana

When connecting to Grafana Cloud, you need to use the protobuf protocol and pass the authorization header in the configuration:

cluster config update ignite.metrics.exporters.test: {exporterName:otlp, endpoint:"https://otlp-gateway-prod-eu-west-2.grafana.net/otlp", protocol:"http/protobuf", headers {Authorization.header="Basic myBasicAuthKey"}}

Connection to Prometheus

When connecting to Prometheus, you need to use the protobuf protocol and send metrics to the /api/v1/otlp/v1/metrics after the OTLP metrics receiver is enabled as described in Prometheus documentation:

cluster config update ignite.metrics.exporters.test: {exporterName:otlp, endpoint:"http://localhost:9090/api/v1/otlp/v1/metrics", protocol:"http/protobuf"}