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

KAFKA-17516: Synonyms for client metrics configs #17264

Open
wants to merge 8 commits into
base: trunk
Choose a base branch
from

Conversation

AndrewJSchofield
Copy link
Member

This PR brings client metrics configuration resources in line with the other config resources in terms of handling synonyms and defaults. Specifically, configs which are not explicitly set take their hard-coded default values, and these are reported by kafka-configs.sh --describe and Kafka-client-metrics.sh --describe. Previously, they were omitted which means the administrator needed to know the default values.

The ConfigHelper was changed so that the handling of client metrics configuration matches that of group configuration.

Committer Checklist (excluded from commit message)

  • Verify design and implementation
  • Verify test coverage and CI build status
  • Verify documentation (including upgrade notes)

@github-actions github-actions bot added the core Kafka Broker label Sep 24, 2024
Copy link
Collaborator

@apoorvmittal10 apoorvmittal10 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 taking it up, LGTM! Just a minor comment to understand the behaviour.

Comment on lines -985 to -977
val metricResource = new ConfigResource(ConfigResource.Type.CLIENT_METRICS, "none_metric")
val metricResult = client.describeConfigs(Seq(metricResource).asJava).all().get().get(metricResource)
assertEquals(0, metricResult.entries().size())
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why do need to remove this line? Is it because now default configs will always appear for unknown subscription? Will it add confusion when describing? Should we just add a note in describe that if subscription doesn not exist then default values will be displayed, and check for subscriptions list to find which all subscriptions are applied to the cluster.

Copy link
Member Author

Choose a reason for hiding this comment

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

Well, yes, that's what happens. Previously, if you displayed a non-existent resource, it didn't say "This doesn't exist", it just printed an empty list. Now, it prints the defaults. What ideally would happen is that it would say "This resource doesn't exist." but I think that's tricky to achieve. If you have ideas here, let me know. I'd prefer if the resource was flagged as an error in this case but the client metrics config manager in the broker is a tricky beast I think.

Copy link
Member Author

Choose a reason for hiding this comment

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

I've dug more into this. The behaviour is the same for groups and client metrics. If you describe a non-existent configs resource, it returns an empty Properties() (this is in ConfigurationsImage.configProperties(ConfigResource). Then, the defaults are applied to this empty set which makes it look like the config resource exists.

I think it's worth making this work properly such that describing an existing resource works, and a non-existent resource fails neatly.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I agree shall we do it as part of this PR or shall take it separtely? Whatever works with you.

Copy link
Member Author

Choose a reason for hiding this comment

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

Having taken a look at the code in more detail, I would prefer to do it as a follow-on PR. This PR would grow quite a bit doing both things at once.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I expected as well, thanks a lot @AndrewJSchofield for the fix and additional work.

Copy link
Collaborator

@apoorvmittal10 apoorvmittal10 left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for the fix.

@AndrewJSchofield
Copy link
Member Author

@chia7712 I wonder if you'd be able to take a look at this PR since I know you have reviewed PRs in this area before. Thanks.

@chia7712
Copy link
Member

chia7712 commented Nov 8, 2024

@AndrewJSchofield could you please fix the conflicts? I will take a look later

@AndrewJSchofield
Copy link
Member Author

@chia7712 Would you be able to give me a review on this PR please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants