diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index 6a77d5651dd1..fda2d18d4bdb 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -41,6 +41,11 @@ https://github.com/elastic/beats/compare/v8.8.1\...main[Check the HEAD diff] - Add support for Kibana status metricset in v8 format {pull}40275[40275] - Mark system process metricsets as running if metrics are partially available {pull}40565[40565] - Fixed a bug where `event.duration` could be missing from an event on Windows systems due to low-resolution clock. {pull}44440[44440] +- Add check for http error codes in the Metricbeat's Prometheus query submodule {pull}44493[44493] +- Sanitize error messages in Fetch method of SQL module {pull}44577[44577] +- Add NTP metricset to system module. {pull}44884[44884] +- Add VPN metrics to meraki module {pull}44851[44851] +- Improve error messages in AWS Health {pull}45408[45408] *Osquerybeat* diff --git a/x-pack/metricbeat/module/aws/awshealth/awshealth.go b/x-pack/metricbeat/module/aws/awshealth/awshealth.go index a86ac1b5da4f..4db239505d5c 100644 --- a/x-pack/metricbeat/module/aws/awshealth/awshealth.go +++ b/x-pack/metricbeat/module/aws/awshealth/awshealth.go @@ -6,12 +6,18 @@ package awshealth import ( "context" +<<<<<<< HEAD +======= + "crypto/fips140" + "errors" +>>>>>>> 1637c556c ([AWS Health] Improve error message reporting (#45408)) "fmt" "time" awssdk "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/health" "github.com/aws/aws-sdk-go-v2/service/health/types" + "github.com/aws/smithy-go" "github.com/elastic/beats/v7/libbeat/common/cfgwarn" "github.com/elastic/beats/v7/metricbeat/mb" @@ -117,7 +123,19 @@ func (m *MetricSet) Fetch(ctx context.Context, report mb.ReporterV2) error { return err } +<<<<<<< HEAD awsConfig := m.MetricSet.AwsConfig.Copy() +======= + // Starting from Go 1.24, when FIPS 140-3 mode is active, fips140.Enabled() will return true. + // So, regardless of whether `fips_enabled` is set to true or false, when FIPS 140-3 mode is active, the + // resolver will resolve to the FIPS endpoint. + // See: https://go.dev/doc/security/fips140#fips-140-3-mode + if fips140.Enabled() { + config.AWSConfig.FIPSEnabled = true + } + + awsConfig := m.AwsConfig.Copy() +>>>>>>> 1637c556c ([AWS Health] Improve error message reporting (#45408)) health_client := health.NewFromConfig(awsConfig, func(o *health.Options) { if config.AWSConfig.FIPSEnabled { @@ -191,7 +209,13 @@ func (m *MetricSet) getEventDetails( // Perform actions for the current page currentPage, err := dePage.NextPage(ctx) if err != nil { - m.Logger().Errorf("[AWS Health] DescribeEvents failed with : %w", err) + var opErr *smithy.OperationError + if errors.As(err, &opErr) { + m.Logger().Errorf("[AWS Health] DescribeEvents failed with: Operation=%s, UnderlyingError=%v", + opErr.Operation(), opErr.Err) + } else { + m.Logger().Errorf("[AWS Health] DescribeEvents failed with: %w", err) + } break } deEvents = currentPage.Events @@ -218,7 +242,13 @@ func (m *MetricSet) getEventDetails( Locale: &locale, }) if err != nil { - m.Logger().Errorf("[AWS Health] DescribeEventDetails failed with : %w", err) + var opErr *smithy.OperationError + if errors.As(err, &opErr) { + m.Logger().Errorf("[AWS Health] DescribeEventDetails failed with: Operation=%s, UnderlyingError=%v", + opErr.Operation(), opErr.Err) + } else { + m.Logger().Errorf("[AWS Health] DescribeEventDetails failed with: %w", err) + } break } // Fetch event description for the current page of events