feat: Add ZGC collector support and related tests
Proposed commit message
Checklist
- [ ] My code follows the style guidelines of this project
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] I have made corresponding change to the default configuration files
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] I have added an entry in
CHANGELOG.next.asciidocorCHANGELOG-developer.next.asciidoc.
Disruptive User Impact
Author's Checklist
- [ ]
How to test this PR locally
Related issues
- Closes https://github.com/elastic/beats/issues/45144
This pull request adds support for collecting and mapping ZGC (Z Garbage Collector) metrics from Elasticsearch node stats in Metricbeat, alongside traditional GC collectors. It updates the schema definitions to handle both traditional and ZGC collectors, makes the relevant fields optional, and introduces comprehensive tests for both standard and X-Pack modes to ensure correct mapping for various GC configurations.
Schema and Mapping Enhancements:
- Added support for ZGC collectors (
zgc_cyclesandzgc_pauses) in thejvm.gc.collectorsschema for both standard and X-Pack mappings, and made all collector fields optional to handle nodes with different GC types. - Updated the field definitions in
fields.ymlto document and structure the new ZGC metrics, including count and time spent for both cycles and pauses.
Testing Improvements:
- Added new tests for ZGC and traditional GC mapping in both standard and X-Pack modes, ensuring correct schema application and collector detection for various node configurations (
test_zgc.go,mixed_gc_test.go,xpack_test.go).
Use cases
Screenshots
Logs
❌ Author of the following commits did not sign a Contributor Agreement: 4ecc20ed0340b82114ab5270d91c50c7c98ae99d
Please, read and sign the above mentioned agreement if you want to contribute to this project
This pull request doesn't have a Team:<team> label.