You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

IDIEP-114
Author
Sponsor
Created
Status
DRAFT


Motivation

It is useful for user to work with own metrics, not only with provided by Ignite. Current public metrics API doesn't expose any method to add or delete additional metrics. We should allow user to register custom metrics.

Description

The most important reason to provide custom is probably the convenience of collecting of desired metrics using one platform, the same client, through the same API. This feature can simplify user application.

Examples of custom metric usages

  • Aggregations, filtrations of the provided metrics.
  • Some useful metrics may not be provided yet.
  • Metrics for routing.
  • Various metrics of business processes or related to user application.
  • Security-related metrics.

Examples of databases with custom metrics

Oracle DBPostgresOracle CoherenceMS SQL ServerIBM DB2

Implementation proposal

General approach

  • Custom Metrics are based on the New Metric System.
  • A custom metric name always begins with the prefix "custom.".
  • GridMetricManager handles the custom metrics.

  • We should provide an API with at least simple ready-to-use metrics like LongMetric, DoubleMetric and a generic Metric.
  • To manage custom metrics, introduce and require a permission.
  • Add examples of effecient metrics implementations like LongAdder to the documentation.

API

   1. New metrics facade to Ignite:

package org.apache.ignite;

public interface Ignite {
   public IgniteMetrics metrics();

}

   2. New interface IgniteMetrics

package org.apache.ignite;

public interface IgniteMetrics {
<T extends Metric> T metric(T metric);

@Nullable <T extends Metric> T metric(String name);

void removeMetric(String name);

ReadOnlyMetricRegistry registry(String name);

LongMetric longMetric(String name, LongSupplier valueSupplier, @Nullable String description);

LongSupplier longMetric(String name, @Nullable String description);

DoubleMetric doubleMetric(String name, DoubleSupplier valueSupplier, @Nullable String description);

DoubleSupplier doubleMetric(String name, @Nullable String description);

BooleanMetric booleanMetric(String name, BooleanSupplier valueSupplier, @Nullable String description);

BooleanSupplier booleanMetric(String name, @Nullable String description);

<T> ObjectMetric<T> objectMetric(String name, Class<T> valueType, Supplier<T> valueSupplier, @Nullable String description);

<T> Supplier<T> objectMetric(String name, Class<T> valueType, @Nullable String description);
}

Risks and Assumptions

  • User should take in account that metrics can affect the performance. 
  • Ignite doesn't store custom metrics. At least at the first phase. After node restart, the metrics require registration anew.

Phases

  1. Implementation of the described API.
  2. Add to the custom metric API extended metric like Histogram, HitRate or LongAdder. Allow to configure metrics like Histogram or HitRate.
  3. Storing custom metrics with their configurations.

Discussion Links

Tickets


  • No labels