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

Add check when retrieving the worker process id using performance counters #23647

Merged
merged 4 commits into from
Jan 26, 2021

Conversation

narph
Copy link
Contributor

@narph narph commented Jan 25, 2021

What does this PR do?

Adds check when retrieving the worker process id using performance counters

Why is it important?

Exception

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.

Related issues

@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Jan 25, 2021
@narph narph self-assigned this Jan 25, 2021
@elasticmachine
Copy link
Collaborator

elasticmachine commented Jan 25, 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: narph commented: /test

    • Start Time: 2021-01-25T14:07:16.728+0000
  • Duration: 46 min 37 sec

  • Commit: 86e7e9b

Test stats 🧪

Test Results
Failed 0
Passed 8952
Skipped 2223
Total 11175

💚 Flaky test report

Tests succeeded.

Expand to view the summary

Test stats 🧪

Test Results
Failed 0
Passed 8952
Skipped 2223
Total 11175

@narph narph added Team:Platforms Label for the Integrations - Platforms team windows-10 Enable builds in the CI for windows-10 windows-2008 Enable builds in the CI for windows-2008 windows-2012 Enable builds in the CI for windows-2012 windows-2016 Enable builds in the CI for windows-2016 windows-7 Enable builds in the CI for windows-7 windows-7-32 Enable builds in the CI for windows-7 32 bits windows-8 Enable builds in the CI for windows-8 labels Jan 25, 2021
@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Jan 25, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/integrations (Team:Platforms)

@narph
Copy link
Contributor Author

narph commented Jan 25, 2021

/test

Copy link
Contributor

@kaiyan-sheng kaiyan-sheng left a comment

Choose a reason for hiding this comment

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

LGTM, just added one question

@@ -263,7 +263,7 @@ func getw3wpProceses() (map[int]string, error) {
func getProcessIds(counterValues map[string][]pdh.CounterValue) []WorkerProcess {
var workers []WorkerProcess
for key, values := range counterValues {
if strings.Contains(key, "\\ID Process") {
if strings.Contains(key, "\\ID Process") && values[0].Measurement != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

Just curious, do we need to check values length first? like len(values) > 0

Copy link
Contributor Author

Choose a reason for hiding this comment

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

a counter value is added by default in pdh_query_windows.go, if it does not contain the Measurement it will contain more info on the error. This is also picked up later.

@narph narph merged commit 3220d46 into elastic:master Jan 26, 2021
@narph narph deleted the app-fix branch January 26, 2021 09:13
@narph narph added the v7.12.0 label Jan 26, 2021
narph added a commit to narph/beats that referenced this pull request Jan 26, 2021
…nters (elastic#23647)

* fix for test

* add check

* changelog

(cherry picked from commit 3220d46)
@narph narph added the v7.11.0 label Jan 26, 2021
narph added a commit to narph/beats that referenced this pull request Jan 26, 2021
…nters (elastic#23647)

* fix for test

* add check

* changelog

(cherry picked from commit 3220d46)
v1v added a commit to v1v/beats that referenced this pull request Jan 26, 2021
…pack-when-oss-changes

* upstream/master:
  [DOCS] Add setup content to Kubernetes and Cloud Foundry docs (elastic#23580)
  [CI] Mandatory windows support for all the versions (elastic#23615)
  Add check when retrieving the worker process id using performance counters  (elastic#23647)
  Remove 4912 evtx from testing (elastic#23669)
  Add missing SSL settings (elastic#23632)
  Update X-Pack Packetbeat config (elastic#23666)
  Use hostname check from verify.go to handle patterns in TLS certs (elastic#23661)
  Fix: Dissect Cisco ASA 302013 message usernames (elastic#21196)
  Add FAQ entry for MADV settings in older versions (elastic#23429)
  Sync fixes from Integration Package Testing (elastic#23424)
  [Filebeat] Add Cisco ASA message '302023' parsing (elastic#23092)
  [Elastic Log Driver] Change hosts config flag (elastic#23628)
  Audit and Authentication Policy Change Events (elastic#20684)
narph added a commit that referenced this pull request Feb 15, 2021
…nters (#23647) (#23676)

* fix for test

* add check

* changelog

(cherry picked from commit 3220d46)
narph added a commit that referenced this pull request Feb 15, 2021
…ess id using performance counters (#23677)

* Add check when retrieving the worker process id using performance counters  (#23647)

* fix for test

* add check

* changelog

(cherry picked from commit 3220d46)

* fix conf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:Platforms Label for the Integrations - Platforms team v7.11.0 v7.12.0 windows-7-32 Enable builds in the CI for windows-7 32 bits windows-7 Enable builds in the CI for windows-7 windows-8 Enable builds in the CI for windows-8 windows-10 Enable builds in the CI for windows-10 windows-2008 Enable builds in the CI for windows-2008 windows-2012 Enable builds in the CI for windows-2012 windows-2016 Enable builds in the CI for windows-2016
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Metricbeat Module IIS application_pool
3 participants