Skip to content

Enabled lifetime window for batch's byte size metric#18911

Merged
andsel merged 3 commits intoelastic:mainfrom
andsel:feature/lifetime_window_for_batch_metrics
Apr 1, 2026
Merged

Enabled lifetime window for batch's byte size metric#18911
andsel merged 3 commits intoelastic:mainfrom
andsel:feature/lifetime_window_for_batch_metrics

Conversation

@andsel
Copy link
Copy Markdown
Contributor

@andsel andsel commented Mar 27, 2026

Release notes

For batch size byte size metrics also the lifetime window was added.

What does this PR do?

In BatchStructureMetric adds the lifetime retention policy.
In stats.rb API presentation layer add lifetime window only for batch's byte size metric.

Why is it important/What is the impact to the user?

LEt the user to know the p50 p90 and max for the whole life execution time.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • [ ] I have made corresponding changes to the documentation
  • [ ] I have made corresponding change to the default configuration files (and/or docker env variables)
  • I have added tests that prove my fix is effective or that my feature works

Author's Checklist

  • [ ]

How to test this PR locally

Related issues

Use cases

Screenshots

Logs

@andsel andsel self-assigned this Mar 27, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🤖 GitHub comments

Just comment with:

  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)
  • run exhaustive tests : Run the exhaustive tests Buildkite pipeline.

@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Mar 27, 2026

This pull request does not have a backport label. Could you fix it @andsel? 🙏
To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-8./d is the label to automatically backport to the 8./d branch. /d is the digit.
  • If no backport is necessary, please add the backport-skip label

@andsel andsel marked this pull request as ready for review March 30, 2026 14:03
@andsel andsel force-pushed the feature/lifetime_window_for_batch_metrics branch from 9fde998 to 6aded95 Compare March 30, 2026 15:38
andsel added a commit to andsel/logstash that referenced this pull request Mar 31, 2026
Copy link
Copy Markdown
Contributor

@estolfo estolfo left a comment

Choose a reason for hiding this comment

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

The code looks good, with just one minor test description update.

I did some local testing. This is the byte size metric document without these changes (main):

"byte_size" : {
          "current" : 8375,
          "average" : {
            "lifetime" : 8375,
            "last_1_minute" : 8375,
            "last_5_minutes" : 8375
          },
          "p50" : {
            "last_1_minute" : 8375,
            "last_5_minutes" : 8375
          },
          "p90" : {
            "last_1_minute" : 8375,
            "last_5_minutes" : 8375
          },
          "max" : {
            "last_1_minute" : 8375,
            "last_5_minutes" : 8375
          }

and this is the document with these changes:

"byte_size" : {
          "current" : 8375,
          "average" : {
            "lifetime" : 8375,
            "last_1_minute" : 8375,
            "last_5_minutes" : 8375
          },
          "p50" : {
            "last_1_minute" : 8375,
            "last_5_minutes" : 8375,
            "lifetime" : 8375
          },
          "p90" : {
            "last_1_minute" : 8375,
            "last_5_minutes" : 8375,
            "lifetime" : 8375
          },
          "max" : {
            "last_1_minute" : 8375,
            "last_5_minutes" : 8375,
            "lifetime" : 8375
          }

@elasticmachine
Copy link
Copy Markdown

💚 Build Succeeded

History

cc @andsel

@andsel andsel merged commit f54cb2c into elastic:main Apr 1, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expose lifetime timeframe for batch's byte_size metric for p50, p90 and max

3 participants