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
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
}