Interface GsMetricsQueryProvider


public interface GsMetricsQueryProvider
Plugin interface for querying metrics from external backends.

How to use

  1. Implement this interface for your backend (Datadog, Dynatrace, etc.)
  2. Register via META-INF/services/com.gigaspaces.metrics.micrometer.GsMetricsQueryProvider
  3. Drop the JAR into $GS_HOME/lib/optional/metrics
  4. Set metrics.query.provider=<your-name> in metrics.properties (optional if only one provider)
Since:
17.1.4
  • Method Summary

    Modifier and Type
    Method
    Description
    Unique name identifying this provider, e.g.
    boolean
    Returns true if the required configuration (URL, credentials, etc.) is present.
    query(String metricName, java.time.Instant from, java.time.Instant to, String aggregationMode)
    Query metric data points for the given metric name and time range.
    queryLatest(String metricName)
    Returns the last known value for the given metric, regardless of when it was reported.
  • Method Details

    • getName

      String getName()
      Unique name identifying this provider, e.g. "influxdb", "datadog", "dynatrace". Used to select a specific provider via metrics.query.provider property.
    • isConfigured

      boolean isConfigured()
      Returns true if the required configuration (URL, credentials, etc.) is present. Used for auto-detection when no explicit provider is configured.
    • query

      List<MetricDataPoint> query(String metricName, java.time.Instant from, java.time.Instant to, String aggregationMode)
      Query metric data points for the given metric name and time range.
      Parameters:
      metricName - the metric name (e.g. "space_connections_incoming_active")
      from - start of the time range (inclusive)
      to - end of the time range (inclusive)
      aggregationMode - aggregation function to apply per time bucket: "mean", "sum", "max", "min". Null or blank means raw data points with no aggregation.
      Returns:
      list of data points ordered by timestamp, never null
    • queryLatest

      List<MetricDataPoint> queryLatest(String metricName)
      Returns the last known value for the given metric, regardless of when it was reported. Each provider must implement this using their backend's native "last value" API.
      Parameters:
      metricName - the metric name
      Returns:
      single-element list with the last known data point, or empty if no data found