Skip to content

Conversation

@ilyam8
Copy link
Member

@ilyam8 ilyam8 commented Sep 25, 2025

Summary

Fixes: #21048
Closes: #21050

Older RabbitMQ versions return the tags field in the /whoami response 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?

@github-actions github-actions bot added area/collectors Everything related to data collection collectors/go.d area/go labels Sep 25, 2025
@ilyam8 ilyam8 requested a review from Copilot September 25, 2025 12:07
Copy link
Contributor

Copilot AI left a 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 apiWhoamiTags type
  • 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.

ralphm
ralphm previously approved these changes Sep 25, 2025
Copy link
Member

@ralphm ralphm left a 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.

@ilyam8 ilyam8 enabled auto-merge (squash) September 25, 2025 15:59
@stelfrag stelfrag self-requested a review September 25, 2025 16:27
@ilyam8 ilyam8 merged commit 9a87df8 into netdata:master Sep 25, 2025
106 checks passed
@ilyam8 ilyam8 deleted the go.d-rabbitmq-old branch September 25, 2025 18:04
stelfrag pushed a commit to stelfrag/netdata that referenced this pull request Sep 29, 2025
@stelfrag stelfrag mentioned this pull request Sep 29, 2025
Ferroin pushed a commit that referenced this pull request Sep 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/collectors Everything related to data collection area/go collectors/go.d

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: RabbitMQ whoami response may have a single string for tags

3 participants