Skip to content

enhancement(buffers, metrics): move data counting to the BufferUsage#23518

Closed
vparfonov wants to merge 5 commits intovectordotdev:masterfrom
vparfonov:issue-21702-improve
Closed

enhancement(buffers, metrics): move data counting to the BufferUsage#23518
vparfonov wants to merge 5 commits intovectordotdev:masterfrom
vparfonov:issue-21702-improve

Conversation

@vparfonov
Copy link
Contributor

@vparfonov vparfonov commented Aug 4, 2025

Summary

This PR refactors the buffer usage metrics system to eliminate the global DashMap (BUFFER_COUNTERS) and centralize the state management logic. The new design localizes all gauge state within the BufferUsage instance and its dedicated reporting task.

The global static DashMap and the associated update_buffer_gauge function have been completely removed.

Change Type

  • Bug fix
  • New feature
  • Non-functional (chore, refactoring, docs)
  • Performance

Is this a breaking change?

  • Yes
  • No

Does this PR include user facing changes?

  • Yes. Please add a changelog fragment based on our guidelines.
  • No. A maintainer will apply the no-changelog label to this PR.

References

@vparfonov vparfonov force-pushed the issue-21702-improve branch from e43bd17 to e3f1991 Compare August 4, 2025 12:00
@vparfonov vparfonov changed the title move data counting to the BufferUsage enhancement(buffer, metrics):move data counting to the BufferUsage Aug 4, 2025
@thomasqueirozb thomasqueirozb changed the title enhancement(buffer, metrics):move data counting to the BufferUsage enhancement(buffer, metrics): move data counting to the BufferUsage Aug 4, 2025
@thomasqueirozb thomasqueirozb changed the title enhancement(buffer, metrics): move data counting to the BufferUsage enhancement(buffers, metrics): move data counting to the BufferUsage Aug 4, 2025
@vparfonov vparfonov force-pushed the issue-21702-improve branch from 1e54d78 to e859526 Compare August 4, 2025 16:31
@vparfonov vparfonov marked this pull request as ready for review August 4, 2025 17:13
@vparfonov vparfonov requested a review from a team as a code owner August 4, 2025 17:13
@pront pront requested a review from bruceg August 4, 2025 17:18
@vparfonov vparfonov force-pushed the issue-21702-improve branch from e859526 to 64a3bbd Compare August 4, 2025 17:24
@vparfonov vparfonov closed this Aug 4, 2025
@vparfonov vparfonov force-pushed the issue-21702-improve branch from 64a3bbd to f64089a Compare August 4, 2025 17:24
@vparfonov vparfonov reopened this Aug 4, 2025
Copy link
Member

@bruceg bruceg left a comment

Choose a reason for hiding this comment

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

I am finding this hard to review at anything more than a surface level because it seems to be changing a lot of aspects in this area at once with little understanding of how it got here. Since this is a very subtle area that has had serious issues in the past (and arguably currently), I would prefer seeing an approach that was much more incremental, where each change preserves the desired behavior while making a single change. That may end up with the same result as what we see here, but it would help understanding how it got to this point by breaking down the steps in separate commits or even separate PRs.

@vparfonov vparfonov marked this pull request as draft August 5, 2025 19:05
@vparfonov vparfonov force-pushed the issue-21702-improve branch 2 times, most recently from 79e4f92 to c5bffca Compare August 6, 2025 14:21
Signed-off-by: Vitalii Parfonov <vparfono@redhat.com>
Signed-off-by: Vitalii Parfonov <vparfono@redhat.com>
Signed-off-by: Vitalii Parfonov <vparfono@redhat.com>
Signed-off-by: Vitalii Parfonov <vparfono@redhat.com>
@vparfonov vparfonov force-pushed the issue-21702-improve branch from c5bffca to c33008b Compare August 6, 2025 14:29
Signed-off-by: Vitalii Parfonov <vparfono@redhat.com>
@vparfonov vparfonov marked this pull request as ready for review August 6, 2025 14:36
@vparfonov vparfonov requested a review from bruceg August 6, 2025 14:37
@vparfonov
Copy link
Contributor Author

@bruceg Please take a look, i try to break down the changes in separate commits

@bruceg
Copy link
Member

bruceg commented Aug 6, 2025

@vparfonov I followed up on the previous work on this area in #23542 and I would appreciate your review on it as well. As mentioned, I tried to work very incrementally to avoid changing anything accidentally, but the result doesn't entirely make sense to me.

@pront
Copy link
Member

pront commented Aug 8, 2025

@vparfonov thank you for your efforts in this area and for contributing to Vector. Much appreciated!

@pront pront added domain: buffers Anything related to Vector's memory/disk buffers domain: metrics Anything related to Vector's metrics events labels Aug 8, 2025
@vparfonov
Copy link
Contributor Author

@vparfonov thank you for your efforts in this area and for contributing to Vector. Much appreciated!

Thank you for your help!

@vparfonov vparfonov reopened this Aug 8, 2025
@vparfonov
Copy link
Contributor Author

Close it in favor of #23561

@vparfonov vparfonov closed this Aug 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

domain: buffers Anything related to Vector's memory/disk buffers domain: metrics Anything related to Vector's metrics events

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants