Skip to content

[Metrics][Discover] Remove redundant where clause from metric grid es|ql queries #243954

@miguel-sanchez-elastic

Description

@miguel-sanchez-elastic

Description

The Metric Grid generates ES|QL queries with a redundant WHERE <field> IS NOT NULL clause when a breakdown is applied. We want to produce cleaner ES|QL requests by ensuring this filter is not present in the final query, as the aggregation handles this implicitly.

Without breakdown With breakdown
Image Image

Acceptance Criteria

  • Given a user writes the following query TS metrics-*, when they breakdown by one dimension using the "Breakdown by dimension" dropdown then:
    • Each generated query for each metric visualization in the grid does not contain WHERE <breakdown_field> IS NOT NULL that we are currently adding when a breakdown has been applied
    • When they open the "View details" flyout to see the ES|QL query, this one does not contain WHERE <breakdown_field> IS NOT NULL that we are currently adding when a breakdown has been applied
    • When they click "Explore in Discover" on any of the metrics, the ES|QL bar does not contain WHERE <breakdown_field> IS NOT NULL that we are currently are adding when a breakdown has been applied
  • Given a user writes the following query TS metrics-* | WHERE field IS NOT NULL, when they breakdown by one dimension using the "Breakdown by dimension" dropdown then each generated query for each metric visualization in the grid contains the WHERE clause from the main ES|QL query but they do not contain the WHERE <breakdown_field> IS NOT NULL that we are currently adding when a breakdown has been applied

Metadata

Metadata

Assignees

Labels

Feature:Metrics in DiscoverTeam:obs-ux-infra_servicesObservability Infrastructure & Services User Experience TeambugFixes for quality problems that affect the customer experience

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions