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 metricbeat iis module #15059

Merged
merged 45 commits into from
Feb 28, 2020
Merged

Add metricbeat iis module #15059

merged 45 commits into from
Feb 28, 2020

Conversation

narph
Copy link
Contributor

@narph narph commented Dec 11, 2019

Related issue #13072

Reusing the pdh query (in perfmon) to retrieve the iis specific counters.
Initial implementation contains 2 metricsets:

  • webserver - includes aggregated metrics over the entire IIS web server (light metricset based on the perfmon metricset)
  • website - includes metrics from each website running
  • application_pool - includes metrics for each application pool
- module: iis
  metricsets:
    - webserver
    - website
    - application_pool
  enabled: true
  period: 10s

 # filter on application pool names
 # application_pool.name: []

@narph narph added [zube]: In Progress Team:Integrations Label for the Integrations team labels Dec 11, 2019
@narph narph self-assigned this Dec 11, 2019
metricbeat/module/iis/performanceCounters.go Outdated Show resolved Hide resolved
metricbeat/module/iis/performanceCounters.go Outdated Show resolved Hide resolved
metricbeat/module/iis/performanceCounters.go Outdated Show resolved Hide resolved
metricbeat/module/iis/performanceCounters.go Outdated Show resolved Hide resolved
@narph narph requested a review from jsoriano February 19, 2020 16:11
@narph
Copy link
Contributor Author

narph commented Feb 19, 2020

@jsoriano , I have touched on all the feedback, let me know if I miss anything

Copy link
Member

@jsoriano jsoriano left a comment

Choose a reason for hiding this comment

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

Thanks! Some more comments on the latest changes.

metricbeat/helper/windows/pdh/pdh_windows.go Outdated Show resolved Hide resolved
@@ -215,7 +215,7 @@ func getApplicationPools(names []string) ([]ApplicationPool, error) {
return filtered, nil
}

// getw3wpProceses func retrieves the running w3wp process ids
// getw3wpProceses func retrieves the running w3wp process ids. A worker process is a windows process (w3wp.exe) which runs Web applications, and is responsible for handling requests sent to a Web Server for a specific application pool.
Copy link
Member

Choose a reason for hiding this comment

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

Nit. Very long line.

metricbeat/module/iis/application_pool/_meta/data.json Outdated Show resolved Hide resolved
func init() {
mb.Registry.MustAddMetricSet("windows", "perfmon", New)
mb.Registry.MustAddMetricSet("windows", metricsetName, New)
Copy link
Member

Choose a reason for hiding this comment

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

I am thinking now that as these metricsets don't need a host because they only query perfmon, we could add this:

Suggested change
mb.Registry.MustAddMetricSet("windows", metricsetName, New)
mb.Registry.MustAddMetricSet("windows", metricsetName, New,
mb.WithHostParser(parse.EmptyHostParser),
)

if err != nil {
return nil, err
}
}
Copy link
Member

Choose a reason for hiding this comment

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

Oh ok, I would prefer if we can make it more explicit, like with an additional internal flag in the metricset.

Could it happen that we create another metricset based on perfmon where the instance label is also mandatory?

if err != nil {
return nil, errors.Wrap(err, "failed formatting counter values")
}
var events []mb.Event
// GroupAllCountersTo config option will only apply to the webserver metricset, where counters for all instances are aggregated
if metricsetName != metricset && re.config.GroupAllCountersTo != "" {
Copy link
Member

Choose a reason for hiding this comment

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

Similarly here, I would prefer to don't depend on the metricset name for certain features, I would prefer this to be more explicit.
Also this generic metricset shouldn't have something specific for the webserver metricset (or any other metricset) if possible.

metricbeat/module/windows/perfmon/perfmon.go Outdated Show resolved Hide resolved
assert.NotNil(t, reader.Query.Handle)
assert.NotNil(t, reader.Query.Counters)
assert.Zero(t, len(reader.Query.Counters))
defer reader.close()
Copy link
Member

Choose a reason for hiding this comment

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

This comment is unaddressed (not so important in any case).

@narph narph requested a review from jsoriano February 21, 2020 12:02
Copy link
Member

@jsoriano jsoriano left a comment

Choose a reason for hiding this comment

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

Thanks! It LGTM, the only thing, that we could move process.pid to the root level to follow ECS, but if it is complicated to do it now with the perfmon metricset we can leave it for a future change.

metricbeat/module/iis/application_pool/_meta/data.json Outdated Show resolved Hide resolved
Copy link
Contributor

@sorantis sorantis left a comment

Choose a reason for hiding this comment

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

Looks good. Suggested more metrics for the module.

measurement_label: total_connection_attempts
query: '\Web Service(*)\Total Connection Attempts (all instances)'
- instance_label: 'name'
measurement_label: total_get_requests
Copy link
Contributor

Choose a reason for hiding this comment

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

@narph I can see total_get_requests, total_post_requests, total_delete_requests.
Can we also pull total_put_requests, total_head_requests, total_trace_requests, total_options_requests

Copy link
Contributor

Choose a reason for hiding this comment

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

\Web Service(*)\Total PUT Requests
\Web Service(*)\PUT Requests/sec

\Web Service(*)\Total Head Requests
\Web Service(*)\Head Requests/sec

\Web Service(*)\Options Requests/sec
\Web Service(*)\Total Options Requests

\Web Service(*)\Other Request Methods/sec
\Web Service(*)\Total Other Request Methods

\Web Service(*)\Total Trace Requests
\Web Service(*)\Trace Requests/sec

\Web Service(*)\Total Unlock Requests
\Web Service(*)\Unlock Requests/sec

query: '\Web Service(_Total)\Bytes Received/sec'
- instance_label: ''
measurement_label: network.current_connections
query: 'Web Service(_Total)\Current Connections'
Copy link
Contributor

Choose a reason for hiding this comment

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

Would be great to also have
Web Service(*)Current Anonymous Users
Web Service(*)Current NonAnonymous Users
Web Service(*)Total Anonymous Users
Web Service(*)Anonymous Users/sec
Web Service(*)Total NonAnonymous Users

query: '\Web Service(_Total)\Delete Requests/sec'
- instance_label: ''
measurement_label: network.service_uptime
query: '\Web Service(_Total)\Service Uptime'
Copy link
Contributor

Choose a reason for hiding this comment

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

We can also add error counters:
Web Service(*)Total Not Found Errors
Web Service(*)Not Found Errors/sec
Web Service(*)Total Locked Errors
Web Service(*)Locked Errors/sec

metricbeat/module/iis/webserver/manifest.yml Show resolved Hide resolved
metricbeat/module/iis/webserver/manifest.yml Show resolved Hide resolved
@narph narph merged commit 8be4589 into elastic:master Feb 28, 2020
@narph narph deleted the iis-module branch February 28, 2020 15:55
@narph narph added the needs_backport PR is waiting to be backported to other branches. label Feb 28, 2020
narph added a commit to narph/beats that referenced this pull request Feb 28, 2020
* created iis module

* work in progress

* iis changes

* add iis module

* light

* work on build

* work on build

* build

* fmt update

* temp

* work on website

* temp

* temp

* manifest changes

* temp

* temp

* work on wp

* adding application pool metricset

* wmi option

* test

* work on apppool

* work on app pool

* work on website metricset

* work on tests

* Work on website

* work on website

* work on website

* perfmon fix

* work on websie

* update config

* feedback

* work on feedback

* temp

* ecs

* temp

* add counters

(cherry picked from commit 8be4589)
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.

Missing changelog here?

narph added a commit that referenced this pull request Mar 2, 2020
* Add metricbeat iis module (#15059)

* created iis module

* work in progress

* iis changes

* add iis module

* light

* work on build

* work on build

* build

* fmt update

* temp

* work on website

* temp

* temp

* manifest changes

* temp

* temp

* work on wp

* adding application pool metricset

* wmi option

* test

* work on apppool

* work on app pool

* work on website metricset

* work on tests

* Work on website

* work on website

* work on website

* perfmon fix

* work on websie

* update config

* feedback

* work on feedback

* temp

* ecs

* temp

* add counters

(cherry picked from commit 8be4589)

* fix file
@narph narph added test-plan Add this PR to be manual test plan v7.7.0 and removed needs_backport PR is waiting to be backported to other branches. labels Mar 27, 2020
@andresrc andresrc added the test-plan-added This PR has been added to the test plan label Mar 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:Integrations Label for the Integrations team Team:Platforms Label for the Integrations - Platforms team test-plan Add this PR to be manual test plan test-plan-added This PR has been added to the test plan v7.7.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants