- Notifications
You must be signed in to change notification settings - Fork 1.5k
DSMON-1152: Add Kafka actions check #21951
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
base: master
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files🚀 New features to boost your workflow:
|
b931f98 to 3c1a436 Compare There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if msg.error(): | ||
| if msg.error().code() == KafkaException._PARTITION_EOF: | ||
| self.log.debug("Reached end of partition") | ||
| continue | ||
| else: | ||
| raise KafkaException(msg.error()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Handle partition EOF using KafkaError constant
In consume_messages the code checks msg.error().code() == KafkaException._PARTITION_EOF, but KafkaException does not define _PARTITION_EOF (the constant lives on KafkaError). When a consumer hits the end of a partition—an expected condition while tailing topics—this attribute access will raise AttributeError and abort the read_messages action instead of skipping the EOF. Use the KafkaError EOF code (and import it) to avoid crashing on normal partition boundaries.
Useful? React with 👍 / 👎.
| Thanks @piochelepiotr! I created a card for docs editorial review. Let me know if this is on a deadline. |
estherk15 left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the follow up @piochelepiotr. Left some formatting suggestions, let me know if you have any questions on my comments!
Co-authored-by: Esther Kim <esther.kim@datadoghq.com>
Co-authored-by: Esther Kim <esther.kim@datadoghq.com>
Co-authored-by: Esther Kim <esther.kim@datadoghq.com>
Co-authored-by: Esther Kim <esther.kim@datadoghq.com>
Co-authored-by: Esther Kim <esther.kim@datadoghq.com>
Co-authored-by: Esther Kim <esther.kim@datadoghq.com>
Co-authored-by: Esther Kim <esther.kim@datadoghq.com>
Co-authored-by: Esther Kim <esther.kim@datadoghq.com>
Co-authored-by: Esther Kim <esther.kim@datadoghq.com>
Co-authored-by: Esther Kim <esther.kim@datadoghq.com>
Co-authored-by: Esther Kim <esther.kim@datadoghq.com>
Co-authored-by: Esther Kim <esther.kim@datadoghq.com>
Co-authored-by: Esther Kim <esther.kim@datadoghq.com>
Co-authored-by: Esther Kim <esther.kim@datadoghq.com>
Review from estherk15 is dismissed. Related teams and files:
- documentation
- kafka_actions/README.md
What does this PR do?
This PR introduces the
kafka_actionsintegration, which enables one-time administrative and operational actions on Kafka clusters. Note: This integration is exclusively triggered via Remote Configuration and is not meant to run continuously like traditional checks.Supported Actions:
read_messagesproduce_messagecreate_topicupdate_topic_configdelete_topicdelete_consumer_groupupdate_consumer_group_offsetsKey Features:
==,!=,>,<,>=,<=,contains,and,or, nested field accessn_messages_retrieved,max_scanned_messages)Motivation
Operations teams need the ability to perform targeted, one-time Kafka actions for debugging, incident response, and maintenance—without deploying custom scripts or tools. This integration provides a secure, auditable way to:
By integrating these capabilities into the Datadog Agent and triggering them via Remote Configuration, teams can perform Kafka operations instantly from the UI.
Review checklist (to be filled by reviewers)
qa/skip-qalabel if the PR doesn't need to be tested during QA.backport/<branch-name>label to the PR and it will automatically open a backport PR once this one is merged