beats icon indicating copy to clipboard operation
beats copied to clipboard

[Metricbeat][WMI]Add query class and validation

Open herrBez opened this issue 6 months ago • 6 comments

Proposed commit message

Improve the wmi module

Changes

Improvement to the WMI Module including:

Bugfixes

  • Prevent marshaling of CIM object types to avoid runtime panics
  • Fix type conversion for uint64, sint64 and datetime arrays

Enhancements

  • Add support for the parameter wmi.include_query_class parameter
  • Introduce a rudimentary validation for the queries:
    • validate the queried class
    • validate the queried properties
  • Report errors as documents with the error.message field populated (enhance the troubleshooting experience)
  • Cache the schema of the instance classes
  • Add a wmi.max_rows_per_queryparameter to limit the number of results to return
  • Add a wmi.schema_cache_size to limit the number of cached class definition per query
  • Improve the documentation

Checklist

  • [x] My code follows the style guidelines of this project
  • [x] I have commented my code, particularly in hard-to-understand areas
  • [x] I have made corresponding changes to the documentation
  • [x] I have made corresponding change to the default configuration files
  • [x] I have added tests that prove my fix is effective or that my feature works
  • [ ] I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

Disruptive User Impact

N/A given that the feature is not released yet

Author's Checklist

How to test this PR locally

Related issues

Use cases

  • Monitor WMI

Screenshots

image

Logs

herrBez avatar May 30 '25 14:05 herrBez

:robot: GitHub comments

Expand to view the GitHub comments

Just comment with:

  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

github-actions[bot] avatar May 30 '25 14:05 github-actions[bot]

This pull request does not have a backport label. If this is a bug or security fix, could you label this PR @herrBez? 🙏. For such, you'll need to label your PR with:

  • The upcoming major version of the Elastic Stack
  • The upcoming minor version of the Elastic Stack (if you're not pushing a breaking change)

To fixup this pull request, you need to add the backport labels for the needed branches, such as:

  • backport-8./d is the label to automatically backport to the 8./d branch. /d is the digit
  • backport-active-all is the label that automatically backports to all active branches.
  • backport-active-8 is the label that automatically backports to all active minor branches for the 8 major.
  • backport-active-9 is the label that automatically backports to all active minor branches for the 9 major.

mergify[bot] avatar May 30 '25 14:05 mergify[bot]

This pull request is now in conflicts. Could you fix it? 🙏 To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b add_query_class_and_validation upstream/add_query_class_and_validation
git merge upstream/main
git push upstream add_query_class_and_validation

mergify[bot] avatar Jun 24 '25 09:06 mergify[bot]

This pull request is now in conflicts. Could you fix it? 🙏 To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b add_query_class_and_validation upstream/add_query_class_and_validation
git merge upstream/main
git push upstream add_query_class_and_validation

mergify[bot] avatar Jun 24 '25 12:06 mergify[bot]

This pull request is now in conflicts. Could you fix it? 🙏 To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b add_query_class_and_validation upstream/add_query_class_and_validation
git merge upstream/main
git push upstream add_query_class_and_validation

mergify[bot] avatar Jun 24 '25 21:06 mergify[bot]

Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane)

elasticmachine avatar Jun 25 '25 06:06 elasticmachine

Hi there, Do I need a backport-8.19 label to make sure a backport PR is created?

herrBez avatar Jun 25 '25 16:06 herrBez