Skip to content
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

Report total CPU for vSphere virtual machines #26167

Merged
merged 20 commits into from
Jun 14, 2021

Conversation

jsoriano
Copy link
Member

@jsoriano jsoriano commented Jun 7, 2021

What does this PR do?

Report total and free CPU for vSphere virtual machines. It uses the configured CPU reservation for that.

Update govmomi client library.

Why is it important?

This allows to better monitor CPU usage.

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.asciidoc or CHANGELOG-developer.next.asciidoc.

Author's Checklist

  • Confirm the use of entitled memory/cpu from quick stats vs. configured memory/cpu.
    • Using memory and cpu from the config at the end.

How to test this PR locally

Related issues

Use static CPU entitlement to calculate total and free CPU.

Use static memory entitlement instead of configured memory to calculate
total and free memory.
@jsoriano jsoriano added enhancement Team:Integrations Label for the Integrations team labels Jun 7, 2021
@jsoriano jsoriano self-assigned this Jun 7, 2021
@botelastic botelastic bot added needs_team Indicates that the issue/PR needs a Team:* label and removed needs_team Indicates that the issue/PR needs a Team:* label labels Jun 7, 2021
@elasticmachine
Copy link
Collaborator

elasticmachine commented Jun 7, 2021

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: Pull request #26167 updated

  • Start Time: 2021-06-14T14:00:07.561+0000

  • Duration: 76 min 10 sec

  • Commit: 3500a59

Test stats 🧪

Test Results
Failed 0
Passed 8065
Skipped 2360
Total 10425

Trends 🧪

Image of Build Times

Image of Tests

💚 Flaky test report

Tests succeeded.

Expand to view the summary

Test stats 🧪

Test Results
Failed 0
Passed 8065
Skipped 2360
Total 10425

@jsoriano jsoriano added the backport-v7.14.0 Automated backport with mergify label Jun 8, 2021
@jsoriano jsoriano marked this pull request as ready for review June 8, 2021 17:03
@elasticmachine
Copy link
Collaborator

Pinging @elastic/integrations (Team:Integrations)

@jsoriano jsoriano added the review label Jun 8, 2021
@jsoriano jsoriano requested a review from sayden June 10, 2021 13:44
@jsoriano
Copy link
Member Author

@sayden I have reverted the update of the client library, this is not really needed for this change and I would like to understand what is happening with the linting.

I will update it in a separate PR.

@sayden sayden self-requested a review June 14, 2021 14:19
},
}

totalCPU := vm.Summary.Config.CpuReservation
if totalCPU > 0 {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Issue created to be able to test with the simulator for different cases of reported metrics #26287

@jsoriano jsoriano merged commit 6c0f28b into elastic:master Jun 14, 2021
@jsoriano jsoriano deleted the vsphere-vm-cpu-mem-total branch June 14, 2021 15:33
mergify bot pushed a commit that referenced this pull request Jun 14, 2021
Use configured CPU as total, use it to calculate free too.
Total and free resources are only reported if they are configured
with a total greater than zero.

(cherry picked from commit 6c0f28b)
jsoriano added a commit that referenced this pull request Jun 14, 2021
Use configured CPU as total, use it to calculate free too.
Total and free resources are only reported if they are configured
with a total greater than zero.

(cherry picked from commit 6c0f28b)

Co-authored-by: Jaime Soriano Pastor <jaime.soriano@elastic.co>
michalpristas pushed a commit to michalpristas/beats that referenced this pull request Jun 17, 2021
Use configured CPU as total, use it to calculate free too.
Total and free resources are only reported if they are configured
with a total greater than zero.
mdelapenya added a commit to mdelapenya/beats that referenced this pull request Jun 21, 2021
* master: (26 commits)
  Report total and free CPU for vSphere virtual machines (elastic#26167)
  [filebeat] Add preserve_original_event option to o365audit input (elastic#26273)
  Change xml processor names in script processor to match convention (elastic#26263)
  [Oracle] Fixing default values for paths in config template (elastic#26276)
  Add more ECS fields to logs (elastic#25998)
  [Heartbeat] Fix broken invocation of synth package (elastic#26228)
  rename sqs file name (elastic#26227)
  Populate the agent action result if there is no matching action handlers (elastic#26152)
  Add ISO8601 as supported timestamp type (elastic#25564)
  Move Filebeat azure module to GA (elastic#26168)
  Filebeat azure module pipeline fixes and changes (elastic#26148)
  libbeat: monitor version (elastic#26214)
  Add new parser to filestream input: container (elastic#26115)
  [Metricbeat] Add state_statefulset replicas.ready (elastic#26088)
  Disable test processors system test for windows 10 (elastic#26216)
  Fix startup with failing configuration (elastic#26126)
  Remove 32 bits version of Elastic Agent. (elastic#25708)
  Chane fleetmode detection to ony use management.enabled (elastic#26180)
  Make `filestream` input GA (elastic#26127)
  libbeat/idxmgmt/ilm: fix alias creation (elastic#26146)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-v7.14.0 Automated backport with mergify enhancement review Team:Integrations Label for the Integrations team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Metricbeat] Add reservation metrics to VMWare integration
3 participants