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

metricbeat: fetch offset info from primary partiton instead of replica partition #5918

Closed

Conversation

wangdisdu
Copy link
Contributor

@wangdisdu wangdisdu commented Dec 19, 2017

fetch topic offset info from primary partition, because of the follow reasons:

    1. The offset information of primary partiton is enough for learning about topic offset;
    1. When the replica count of partiton is 0, you can not get anything from replica partiton;
    1. When the replica count of partiton is more than 1, you will generate replica record from replica partiton list;
    1. You do not need to set replica_id parameter in ListOffsets request and just set it -1 appending on the Kafka protocol guide

…a partition

fetch topic offset info from primary partition, because the follow reasons:
- 1. The offset information of primary partiton is enough for learning about topic offset;
- 2. When the replica count of partiton is 0, you can not get anything from replica partiton;
- 3. When the replica count of partiton is more than 1, you will generate replica record from replica partiton list;
- 4. You do not need to set `replica_id` parameter in ListOffsets request and just set it `-1` appending on the [Kafka protocol guide](http://kafka.apache.org/protocol.html#The_Messages_ListOffsets)
@elasticmachine
Copy link
Collaborator

Can one of the admins verify this patch?

@ruflin
Copy link
Contributor

ruflin commented Dec 20, 2017

@wangdisdu Thanks for starting to tackle issues in our Kafka module. It's definitively something that needs improvement. Will make sure I get soonish some time to review but also want to wait on @urso for some feedback.

@ruflin ruflin added the module label Feb 27, 2018
@ruflin ruflin requested a review from urso February 27, 2018 07:10
@ruflin
Copy link
Contributor

ruflin commented Apr 18, 2018

@urso I think this one still needs your comment.

@ruflin ruflin mentioned this pull request May 8, 2018
5 tasks
@urso
Copy link

urso commented May 9, 2018

What's the exact purpose of this PR?

To me it seems this change removes all replica information. Replica details can be nice to have in case replicas are not in sync, but also to learn which brokers are replicas (e.g. depending on required ACK settings, a partition might become unavailable for producing events if too many replicas are unavailable).

One can use processors to drop unwanted events and fields.

@ruflin ruflin added the Team:Integrations Label for the Integrations team label Nov 21, 2018
@urso urso requested review from jsoriano and removed request for urso November 27, 2018 21:17
@jsoriano
Copy link
Member

On #7767 a new field kafka.partition.partition.is_leader is added to indicate if an event belongs to the primary partition or not. This could be used to easily drop events from non-primary replicas if wanted as proposed by @urso. I also think that it can be useful to collect offsets of all replicas in any case.

I am closing this issue by now as is inactive and there seems to be alternatives for the same purpouse as dropping events. Please feel free to reopen if you think otherwise.

@jsoriano jsoriano closed this Nov 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Metricbeat Metricbeat module review Team:Integrations Label for the Integrations team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants