Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix kafka buffer metrics #3805

Merged
merged 1 commit into from
Dec 6, 2023

Conversation

kkondaka
Copy link
Collaborator

@kkondaka kkondaka commented Dec 5, 2023

Description

Fix Kafka Buffer metrics
While reading from Kafka inner buffer doRead API was used. This skips updating the metrics. modified to use read API which calls doRead and also updates metrics.

Issues Resolved

Resolves #[Issue number to be closed when this PR is merged]

Check List

  • [ X] New functionality includes testing.
  • New functionality has a documentation issue. Please link to it in this PR.
    • New functionality has javadoc added
  • [ X] Commits are signed with a real name per the DCO

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: Krishna Kondaka <[email protected]>
@kkondaka kkondaka marked this pull request as ready for review December 5, 2023 00:19
recordsWrittenCounter.increment();
recordsInBuffer.incrementAndGet();
if (!isByteBuffer()) {
recordsWrittenCounter.increment();
Copy link
Contributor

Choose a reason for hiding this comment

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

With protobuf wrapper over byteBuffer can we store numRecords along with byteBuffer? and then increment/decrement these metrics? these are good metrics for customers IMO.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Maybe. I am not sure if it's always possible because it means we have to parse the input, which we do not plan to do afaik.

Copy link
Member

Choose a reason for hiding this comment

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

We should add some metrics for the byte counts.

Also, I think we should move away from this AbstractBuffer. We make our second buffer and it is already producing erroneous results. :)

But, that can come later.

recordsWrittenCounter.increment();
recordsInBuffer.incrementAndGet();
if (!isByteBuffer()) {
recordsWrittenCounter.increment();
Copy link
Member

Choose a reason for hiding this comment

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

We should add some metrics for the byte counts.

Also, I think we should move away from this AbstractBuffer. We make our second buffer and it is already producing erroneous results. :)

But, that can come later.

@kkondaka kkondaka merged commit 824b72b into opensearch-project:main Dec 6, 2023
44 of 50 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants