java.lang.Object
org.elasticsearch.xpack.esql.telemetry.Metrics

public class Metrics extends Object
Class encapsulating the metrics collected for ESQL
  • Field Details

  • Constructor Details

    • Metrics

      public Metrics(EsqlFunctionRegistry functionRegistry, boolean isServerless)
      Creates a Metrics instance for production use. Settings metrics are filtered based on the current build type (snapshot vs release) and deployment mode (serverless vs stateful).
    • Metrics

      public Metrics(EsqlFunctionRegistry functionRegistry, boolean isSnapshot, boolean isServerless)
      Creates a Metrics instance with explicit environment flags. This constructor is primarily for testing purposes.
      Parameters:
      functionRegistry - the function registry
      isSnapshot - whether this is a snapshot build
      isServerless - whether cross-project search is enabled (serverless mode)
  • Method Details

    • total

      public void total(QueryMetric metric)
      Increments the "total" counter for a metric This method should be called only once per query.
    • failed

      public void failed(QueryMetric metric)
      Increments the "failed" counter for a metric
    • inc

      public void inc(FeatureMetric metric)
    • incSetting

      public void incSetting(String settingName)
    • incFunctionMetric

      public void incFunctionMetric(Class<?> functionType)
    • recordTook

      public void recordTook(long tookMillis)
    • stats

      public Counters stats()