Interface GsMetricsQueryProvider
public interface GsMetricsQueryProvider
Plugin interface for querying metrics from external backends.
How to use
- Implement this interface for your backend (Datadog, Dynatrace, etc.)
- Register via
META-INF/services/com.gigaspaces.metrics.micrometer.GsMetricsQueryProvider - Drop the JAR into
$GS_HOME/lib/optional/metrics - Set
metrics.query.provider=<your-name>in metrics.properties (optional if only one provider)
- Since:
- 17.1.4
-
Method Summary
Modifier and TypeMethodDescriptiongetName()Unique name identifying this provider, e.g.booleanReturns true if the required configuration (URL, credentials, etc.) is present.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 viametrics.query.providerproperty. -
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
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
-