Class Metrics
java.lang.Object
org.elasticsearch.xpack.esql.telemetry.Metrics
Class encapsulating the metrics collected for ESQL
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionMetrics(EsqlFunctionRegistry functionRegistry, boolean isServerless) Creates a Metrics instance for production use.Metrics(EsqlFunctionRegistry functionRegistry, boolean isSnapshot, boolean isServerless) Creates a Metrics instance with explicit environment flags. -
Method Summary
Modifier and TypeMethodDescriptionvoidfailed(QueryMetric metric) Increments the "failed" counter for a metricvoidinc(FeatureMetric metric) voidincFunctionMetric(Class<?> functionType) voidincSetting(String settingName) voidrecordTook(long tookMillis) stats()voidtotal(QueryMetric metric) Increments the "total" counter for a metric This method should be called only once per query.
-
Field Details
-
QUERIES_PREFIX
- See Also:
-
FEATURES_PREFIX
- See Also:
-
SETTINGS_PREFIX
- See Also:
-
FUNC_PREFIX
- See Also:
-
TOOK_PREFIX
- See Also:
-
-
Constructor Details
-
Metrics
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
Creates a Metrics instance with explicit environment flags. This constructor is primarily for testing purposes.- Parameters:
functionRegistry- the function registryisSnapshot- whether this is a snapshot buildisServerless- whether cross-project search is enabled (serverless mode)
-
-
Method Details
-
total
Increments the "total" counter for a metric This method should be called only once per query. -
failed
Increments the "failed" counter for a metric -
inc
-
incSetting
-
incFunctionMetric
-
recordTook
public void recordTook(long tookMillis) -
stats
-