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

Include the offending topic when metadata request returns unknown or unauthorized #1657

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

gfoltz
Copy link

@gfoltz gfoltz commented Jan 6, 2024

This fixes #957 and #129

A generic KafkaJSProtocolError is thrown when a kafka client tries to use a topic that is unknown to the broker or unauthorized for the client. Including the topic name in these cases is very useful for debugging because it allows the engineer to more rapidly know what needs to change with their cluster.

This PR includes the following:

  1. A new KafkaJSUnknownTopic error which includes a topic property
  2. A new KafkaJSTopicAuthorizationFailed error which includes a `topic property
  3. When logging is enabled, the error.topic value is included in the log context with the log line.

@gfoltz gfoltz force-pushed the gfoltz/unknownUnauthorizedTopicLogging branch 2 times, most recently from 6cdc768 to e32865c Compare January 7, 2024 05:16
@gfoltz gfoltz force-pushed the gfoltz/unknownUnauthorizedTopicLogging branch from e32865c to 07084ef Compare January 7, 2024 05:27
@TiMESPLiNTER
Copy link

Thanks a lot for your work. We're also missing something like this. So we can see what permission is missing for which topic. I really hope this one will make it into a a release asap.

@gfoltz
Copy link
Author

gfoltz commented Feb 16, 2024

@Nevon @tulios Can you approve?

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.

Provide additional metadata in errors
2 participants