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

[IIS] Remove beta warning from application_pool metricset #35480

Merged
merged 14 commits into from May 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Expand Up @@ -188,6 +188,7 @@ automatic splitting at root level, if root level element is an array. {pull}3415
- Collect missing remote_cluster in elasticsearch ccr metricset {pull}34957[34957]
- Add context with timeout in AWS API calls {pull}35425[35425]
- Fix no error logs displayed in CloudWatch EC2, RDS and SQS metadata {issue}34985[34985] {pull}35035[35035]
- Remove Beta warning from IIS application_pool metricset {pull}35480[35480]

*Osquerybeat*

Expand Down
Expand Up @@ -7,9 +7,8 @@
package application_pool

import (
"github.com/pkg/errors"
"fmt"

"github.com/elastic/beats/v7/libbeat/common/cfgwarn"
"github.com/elastic/beats/v7/metricbeat/mb"
"github.com/elastic/elastic-agent-libs/logp"
)
Expand Down Expand Up @@ -40,7 +39,6 @@ type Config struct {
// New creates a new instance of the MetricSet. New is responsible for unpacking
// any MetricSet specific configuration options if there are any.
func New(base mb.BaseMetricSet) (mb.MetricSet, error) {
cfgwarn.Beta("The iis application_pool metricset is beta.")
var config Config
if err := base.Module().UnpackConfig(&config); err != nil {
return nil, err
Expand Down Expand Up @@ -70,12 +68,12 @@ func (m *MetricSet) Fetch(report mb.ReporterV2) error {
if m.reader.executed {
err := m.reader.initAppPools()
if err != nil {
return errors.Wrap(err, "failed retrieving counters")
return fmt.Errorf("failed retrieving counters: %w", err)
}
}
events, err := m.reader.read()
if err != nil {
return errors.Wrap(err, "failed reading counters")
return fmt.Errorf("failed reading counters: %w", err)
}

for _, event := range events {
Expand All @@ -91,7 +89,7 @@ func (m *MetricSet) Fetch(report mb.ReporterV2) error {
func (m *MetricSet) Close() error {
err := m.reader.close()
if err != nil {
return errors.Wrap(err, "failed to close pdh query")
return fmt.Errorf("failed to close pdh query: %w", err)
}
return nil
}