TS_INFO information retrieval command#142721
Conversation
Add METRICS_INFO command to retrieve metrics-related metadata. Part of elastic#139296
Add mata.unit to the k8s-mappings.json Part of elastic#139296
# Conflicts: # x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/EsqlCapabilities.java # x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/parser/EsqlBaseParser.interp # x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/parser/EsqlBaseParser.java
Regenerate ESQL parser to fix conflicts Part of elastic#139296
Change METRICS_INFO to scan documents with unique _tsid to retrieve metrics and dimensions metadata from them. Part of elastic#139296
Improve JavaDoc Part of elastic#139296
Polish code Part of elastic#139296
Polish code Part of elastic#139296
# Conflicts: # x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/EsqlCapabilities.java
Fix a compilation error occurred due to the merge with main. Part of elastic#139296
- Address review comments. - Optimize DistinctByOperator - Optimize collection of metrics and dimensions Part of elastic#139296
Change grouping by adding a concept of MetricSignature and 2 steps of grouping. Part of elastic#139296
Add MetricsInfoOperatorTests Part of elastic#139296
Ban PipelineBreakers before METRICS_INFO. Part of elastic#139296
Make MetricsInfo a PipelineBreaker. Add deduplication of information.
# Conflicts: # x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/EsqlCapabilities.java
Make MetricsInfo a PipelineBreaker. Add deduplication of information.
Change grouping to take into account a data stream name
Fix test
Fix test
Fix test
# Conflicts: # x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/EsqlCapabilities.java
# Conflicts: # x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/EsqlCapabilities.java # x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/parser/EsqlBaseLexer.interp # x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/parser/EsqlBaseLexer.java # x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/plan/PlanWritables.java # x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/planner/LocalExecutionPlanner.java
Add INTERMEDIATE reduction
Hey @leemthompo ! We are not going to add any documentation so far because it's going to be a command for internal use. Kibana is going to use it to build dashboards. |
Not sure if it makes sense to have a release note in that case? |
Yes, I agree. It's generated automatically. I wonder if I can remove it and if I can remove the one that I merged for a similar METRICS_INFO command. |
dnhatn
left a comment
There was a problem hiding this comment.
LGTM. Thanks Dima!
One main concern: from my perspective, the terms TS and Metrics are interchangeable, so TS_INFO and METRICS_INFO also seem interchangeable. Would it make sense to introduce a parameter to METRICS_INFO to distinguish the behavior instead of two commands?
@kkrik-es Are you okay with this?
We do use time series and metrics interchangeably, but this goes to the actual retrieved information: the former retrieves information per time series (tsid), while the latter does so per metric name (field). These two are fairly different - and we could have |
|
I've done some benchmarking using the 240M-high-cardinality dataset. Here are the results: fyi: @kkrik-es , @dnhatn , @felixbarny |
# Conflicts: # x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/EsqlCapabilities.java
# Conflicts: # x-pack/plugin/esql/qa/testFixtures/src/main/java/org/elasticsearch/xpack/esql/generator/EsqlQueryGenerator.java
# Conflicts: # x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/EsqlCapabilities.java
Time series and metric are not interchangeable terms. A metric is defined by the metric name. A time series is defined by the combination of all dimensions and the metric name. See also https://opentelemetry.io/docs/specs/otel/metrics/data-model/#timeseries-model. That's exactly how the two commands differ: |
| private final MetricsInfoOperator.MetricFieldLookup fieldLookup; | ||
| private final int metadataSourceChannel; | ||
| private final int indexChannel; | ||
| /** FINAL-mode field: input channel indices for the 7 output columns. Null in INITIAL mode. */ |
There was a problem hiding this comment.
| /** FINAL-mode field: input channel indices for the 7 output columns. Null in INITIAL mode. */ | |
| /** FINAL-mode field: input channel indices for the 7 output columns. Nulls in INITIAL mode. */ |
There was a problem hiding this comment.
Not really, the filed is an array of primitive types (int[]) so it cannot contain nulls. In this particular case, the null value is assigned to the field and not to the values inside the array.
There was a problem hiding this comment.
Makes sense, thanks for the context @leontyevdv
# Conflicts: # x-pack/plugin/esql/qa/testFixtures/src/main/java/org/elasticsearch/xpack/esql/generator/EsqlQueryGenerator.java
…locations
* upstream/main: (94 commits)
Mute org.elasticsearch.xpack.esql.qa.mixed.EsqlClientYamlIT test {p0=esql/40_tsdb/TS Command grouping on text field} elastic#142544
Mute org.elasticsearch.index.store.StoreDirectoryMetricsIT testDirectoryMetrics elastic#143419
Mute org.elasticsearch.xpack.esql.qa.multi_node.GenerativeIT test elastic#143023
TS_INFO information retrieval command (elastic#142721)
ESQL: External source parallel execution and distribution (elastic#143349)
Mute org.elasticsearch.index.mapper.blockloader.FlattenedFieldRootBlockLoaderTests testBlockLoaderForFieldInObject {preference=Params[syntheticSource=false, preference=DOC_VALUES]} elastic#143414
Mute org.elasticsearch.index.mapper.blockloader.FlattenedFieldRootBlockLoaderTests testBlockLoaderForFieldInObject {preference=Params[syntheticSource=false, preference=NONE]} elastic#143413
Mute org.elasticsearch.index.mapper.blockloader.FlattenedFieldRootBlockLoaderTests testBlockLoaderForFieldInObject {preference=Params[syntheticSource=false, preference=STORED]} elastic#143412
Removing ingest random sampling (elastic#143289)
Mute org.elasticsearch.xpack.esql.qa.single_node.GenerativeIT test elastic#143023
[Transform] Clean up internal tests (elastic#143246)
Skip time series field type merge for non-TS agg queries (elastic#143262)
Enable zero-copy SIMD vector scoring on searchable snapshots (frozen tier) (elastic#141718)
Mute org.elasticsearch.xpack.search.CrossClusterAsyncSearchIT testCancelViaExpirationOnRemoteResultsWithMinimizeRoundtrips elastic#143407
Fix MemorySegmentUtilsTests (elastic#143391)
Unmute testWorkflowsRestrictionAllowsAccess (elastic#143308)
Cancel async query on expiry (elastic#143016)
ESQL: Finish migrating error testing (elastic#143322)
Reduce LuceneOperator.Status memory consumption with large QueryDSL queries (elastic#143175)
ESQL: Generative testing with full text functions (elastic#142961)
...
Add a TS_INFO command - a time-series metadata introspection command built on top of METRICS_INFO (elastic#141667). While METRICS_INFO returns one row per distinct metric across all time series, TS_INFO returns one row per (metric, time-series) combination, providing finer-grained visibility into individual time series. TS_INFO produces the same 6 columns as METRICS_INFO plus an additional dimensions column. --------- Co-authored-by: elasticsearchmachine <infra-root+elasticsearchmachine@elastic.co> Co-authored-by: Liam Thompson <leemthompo@gmail.com>
Adds the TS_INFO command, a time-series metadata introspection command built on top of METRICS_INFO (#141667). While METRICS_INFO returns one row per distinct metric across all time series, TS_INFO returns one row per (metric, time-series) combination, providing finer-grained visibility into individual time series.
TS_INFO produces the same 6 columns as METRICS_INFO plus an additional dimensions column:
TS_INFO expands this to one row per time series, adding the dimensions column:
This PR contains generative tests for both METRICS_INFO and TS_INFO commands.
Closes #139296
Closes #141413