Skip to content

Summary of Improvements on aggregate_metric_double in 9.4#145742

Merged
gmarouli merged 18 commits intoelastic:mainfrom
gmarouli:highlight-amd-improvements
Apr 8, 2026
Merged

Summary of Improvements on aggregate_metric_double in 9.4#145742
gmarouli merged 18 commits intoelastic:mainfrom
gmarouli:highlight-amd-improvements

Conversation

@gmarouli
Copy link
Copy Markdown
Contributor

@gmarouli gmarouli commented Apr 6, 2026

In this PR we update the docs with the improvements we accomplished for the aggregate_metric_double type of fields.

  • Deprecated the default_metric configuration
  • Use the average as a more representative signal compared to max
  • In ES|QL support aggregate_metric_double for non-native operations using the average, such as std_dev.

@gmarouli gmarouli added >breaking release highlight :StorageEngine/Mapping The storage related side of mappings labels Apr 7, 2026
@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

Hi @gmarouli, I've created a changelog YAML for you. Note that since this PR is labelled >breaking and release highlight, you need to update the changelog YAML to fill out the extended information sections.

@gmarouli gmarouli marked this pull request as ready for review April 7, 2026 07:09
@gmarouli gmarouli requested a review from a team as a code owner April 7, 2026 07:09
@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-storage-engine (Team:StorageEngine)

@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

Hi @gmarouli, I've updated the changelog YAML for you. Note that since this PR is labelled >breaking and release highlight, you need to update the changelog YAML to fill out the extended information sections.

@leemthompo
Copy link
Copy Markdown
Member

leemthompo commented Apr 7, 2026

@gmarouli docs eng had to some security work to harden the docs build pipelines, and a side effect is that when working from a fork, we now need your profile to be public to verify elastic org membership and then enable automatic URL previews of updated pages

This is especially useful when we need to check that the applies_to tags render as expected :)

You can do that simply by flipping to public here: https://github.com/orgs/elastic/people?query=gmarouli

The alternative is to build locally: https://www.elastic.co/docs/contribute-docs/locally#install-docs-builder

@gmarouli
Copy link
Copy Markdown
Contributor Author

gmarouli commented Apr 7, 2026

Preview from parameter deprecation:

Screenshot 2026-04-07 at 12 59 29

Preview from updating the usage:

Screenshot 2026-04-07 at 12 59 53

[source]
----
FROM k8s-downsampled
| STATS max = max(network.eth0.tx), std_dev = ROUND(STD_DEV(network.eth0.tx), 7) by pod
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: maybe skip round? It doesn't add much here.

Copy link
Copy Markdown
Member

@leemthompo leemthompo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few writing and syntax things here from me :)

: (Required, string) Default metric sub-field to use for queries, scripts, and aggregations that don’t use a sub-field. Must be a value from the `metrics` array.
`default_metric` {applies_to}`stack: deprecated 9.4` {applies_to}`serverless: deprecated`
: :::{admonition} Deprecated in 9.4
The average value will be used as the default metric value, calculated using the `sum` and `value_count`, unless there is only a single sub-field, in which case it will use that metric.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally we'd have a link to the detailed release note here

the structure of the deprecations page is deterministic, so could link to https://www.elastic.co/docs/release-notes/elasticsearch/deprecations initially and then update to a more targeted link once 9.4 is released or else just wait until release day to merge this update with the full link (https://www.elastic.co/docs/release-notes/elasticsearch/deprecations#elasticsearch-9.4.0-deprecations)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then we need a deprecation changelog as well, right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated the changelog of the PR that deprecated the default_metric to be a deprecation. This also helped narrow down the scope of the 145742.yaml which I think reads better now. WDYT?

Copy link
Copy Markdown
Member

@kkrik-es kkrik-es left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stamping to get you going, please apply Liam's corrections too.

@gmarouli
Copy link
Copy Markdown
Contributor Author

gmarouli commented Apr 8, 2026

Screenshot 2026-04-08 at 10 25 11

@gmarouli gmarouli added auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) and removed auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) labels Apr 8, 2026
@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

Hi @gmarouli, I've updated the changelog YAML for you. Note that since this PR is labelled >breaking and release highlight, you need to update the changelog YAML to fill out the extended information sections.

@gmarouli gmarouli added auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) >enhancement and removed >breaking labels Apr 8, 2026
@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

Hi @gmarouli, I've updated the changelog YAML for you. Note that since this PR is labelled release highlight, you need to update the changelog YAML to fill out the extended information sections.

@leemthompo
Copy link
Copy Markdown
Member

Some wording could be clarified IMO this sentence is a bit long:

- The average value is used as the default metric value, calculated using the `sum` and `value_count`, unless there is only a single sub-field, in which case it uses that metric.
+ The default metric value depends on the number of sub-fields:
+ 
+ - When there are multiple sub-fields, the default is the average, calculated from `sum` and `value_count`.
+ - When there is only a single sub-field, that sub-field's value is used directly.

I'd recommend commenting out the link to the deprecations page because it isn't live yet, by putting the link on its own line (outside of parentheses) and prepending % for a comment (note the space after %)

Copy link
Copy Markdown
Member

@leemthompo leemthompo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for iterating, looks good to me with the latest diff suggestion I made :)

Co-authored-by: Liam Thompson <leemthompo@gmail.com>
@gmarouli gmarouli removed the auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) label Apr 8, 2026
@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

Hi @gmarouli, I've updated the changelog YAML for you. Note that since this PR is labelled release highlight, you need to update the changelog YAML to fill out the extended information sections.

@gmarouli
Copy link
Copy Markdown
Contributor Author

gmarouli commented Apr 8, 2026

Thank you both for the good feedback!

@gmarouli gmarouli added auto-backport Automatically create backport pull requests when merged auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) and removed auto-backport Automatically create backport pull requests when merged labels Apr 8, 2026
@gmarouli gmarouli merged commit 9180b2a into elastic:main Apr 8, 2026
11 of 12 checks passed
@gmarouli gmarouli deleted the highlight-amd-improvements branch April 8, 2026 09:10
mromaios pushed a commit to mromaios/elasticsearch that referenced this pull request Apr 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) >enhancement release highlight :StorageEngine/Mapping The storage related side of mappings Team:StorageEngine v9.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants