-
Notifications
You must be signed in to change notification settings - Fork 6.3k
improve(go.d/rabbitmq): add support for old RabbitMQ whoami tags format #21049
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
Conversation
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.
Pull Request Overview
This PR improves RabbitMQ collector compatibility by handling different JSON formats for the tags field in the /whoami API response. Older RabbitMQ versions return tags as a string while newer versions return an array of strings.
- Introduces a custom JSON unmarshaller for
apiWhoamiTagstype - Supports both string and array formats for RabbitMQ tags field
- Adds null handling for the tags field
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <[email protected]>
ralphm
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.
Looks good to me. May be good to add some tests for this.
e5c28c1 to
01da129
Compare
…at (netdata#21049) Co-authored-by: Copilot <[email protected]> (cherry picked from commit 9a87df8)
…at (#21049) Co-authored-by: Copilot <[email protected]> (cherry picked from commit 9a87df8)
Summary
Fixes: #21048
Closes: #21050
Older RabbitMQ versions return the tags field in the
/whoamiresponse as a string, while newer versions return it as an array of strings.This change introduces a custom JSON unmarshaller for apiWhoamiTags, supporting both formats to ensure compatibility with all RabbitMQ versions.
Test Plan
Additional Information
For users: How does this change affect me?