-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Add validations for duplicate JMX bean entries #11505
Conversation
Codecov Report
Flags with carried forward coverage won't be shown. Click here to find out more. |
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! I tried it out and it caught some errors so can you create a PR to fix them too? Also, it didn't detect duplicate keys, which were present in this file at this commit: https://github.com/DataDog/integrations-core/blob/9975181896f845d3da3dd2595bc01e8daf9d552c/confluent_platform/datadog_checks/confluent_platform/data/metrics.yaml. There is some discussion about how to do that here: https://gist.github.com/pypt/94d747fe5180851196eb since pyyaml does not catch them when loading: yaml/pyyaml#165
@sarah-witt By key I'm guessing you're referring to the beans? If so, I had ask Ofek about it prior about the following:
He told me that these shouldn't be flagged I'd be happy to update the duplicates in our repo! |
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! And ah sorry, that's true we shouldn't check for duplicate beans. What I was trying to say was we want to catch fully duplicate entries ie
bean:'my.bean:type=foo,name=baz'
attribute:
- Count
bean:'my.bean:type=foo,name=baz'
attribute:
- Count
@sarah-witt I added some suggestion from the links you provided, thanks! I tested it against the commit you referenced and seems to be working there. |
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, this looks awesome! I just had a small wording nit
datadog_checks_dev/datadog_checks/dev/tooling/commands/validate/jmx_metrics.py
Outdated
Show resolved
Hide resolved
…e/jmx_metrics.py Small change in error message Co-authored-by: Sarah Witt <[email protected]>
datadog_checks_dev/datadog_checks/dev/tooling/commands/validate/jmx_metrics.py
Outdated
Show resolved
Hide resolved
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.
🎉
What does this PR do?
Add logic to check if any duplicate bean + attribute combination exist in a metrics.yaml
Motivation
To prevent the same data to be collected 2 or more times
Additional Notes
Tested it against the confluence_platform's and hive's metric.yaml and was able to find a couple of duplicate beans. Examples:
Link1 versus Link2
Sample output:
Review checklist (to be filled by reviewers)
changelog/
andintegration/
labels attached