diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index 4ed2d6a4f88..d3beaf0638f 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -211,6 +211,9 @@ https://github.com/elastic/beats/compare/v8.8.1\...main[Check the HEAD diff] - Use namespace for GetListMetrics when exists in AWS {pull}41022[41022] - Fix http server helper SSL config. {pull}39405[39405] - Fix Kubernetes metadata sometimes not being present after startup {pull}41216[41216] +- Do not report non-existant 0 values for RSS metrics in docker/memory {pull}41449[41449] +- Log Cisco Meraki `getDevicePerformanceScores` errors without stopping metrics collection. {pull}41622[41622] + *Osquerybeat* diff --git a/x-pack/metricbeat/module/meraki/device_health/device_health.go b/x-pack/metricbeat/module/meraki/device_health/device_health.go index 25d41bf43f5..bbe301b3b43 100644 --- a/x-pack/metricbeat/module/meraki/device_health/device_health.go +++ b/x-pack/metricbeat/module/meraki/device_health/device_health.go @@ -98,10 +98,7 @@ func (m *MetricSet) Fetch(reporter mb.ReporterV2) error { return fmt.Errorf("getDeviceStatuses failed; %w", err) } - err = getDevicePerformanceScores(m.client, devices) - if err != nil { - return fmt.Errorf("getDevicePerformanceScores failed; %w", err) - } + getDevicePerformanceScores(m.logger, m.client, devices) err = getDeviceChannelUtilization(m.client, devices, collectionPeriod) if err != nil { diff --git a/x-pack/metricbeat/module/meraki/device_health/devices.go b/x-pack/metricbeat/module/meraki/device_health/devices.go index 2f2591d6783..c76b76def78 100644 --- a/x-pack/metricbeat/module/meraki/device_health/devices.go +++ b/x-pack/metricbeat/module/meraki/device_health/devices.go @@ -6,10 +6,12 @@ package device_health import ( "fmt" + "net/http" "strings" "time" "github.com/elastic/beats/v7/metricbeat/mb" + "github.com/elastic/elastic-agent-libs/logp" "github.com/elastic/elastic-agent-libs/mapstr" meraki "github.com/meraki/dashboard-api-go/v3/sdk" @@ -67,7 +69,7 @@ func getDeviceStatuses(client *meraki.Client, organizationID string, devices map return nil } -func getDevicePerformanceScores(client *meraki.Client, devices map[Serial]*Device) error { +func getDevicePerformanceScores(logger *logp.Logger, client *meraki.Client, devices map[Serial]*Device) { for _, device := range devices { // attempting to get a performance score for a non-MX device returns a 400 if strings.Index(device.details.Model, "MX") != 0 { @@ -76,7 +78,11 @@ func getDevicePerformanceScores(client *meraki.Client, devices map[Serial]*Devic val, res, err := client.Appliance.GetDeviceAppliancePerformance(device.details.Serial) if err != nil { - return fmt.Errorf("GetDeviceAppliancePerformance failed; [%d] %s. %w", res.StatusCode(), res.Body(), err) + if !(res.StatusCode() != http.StatusBadRequest && strings.Contains(string(res.Body()), "Feature not supported")) { + logger.Errorf("GetDeviceAppliancePerformance failed; [%d] %s. %v", res.StatusCode(), res.Body(), err) + } + + continue } // 204 indicates there is no data for the device, it's likely 'offline' or 'dormant' @@ -84,8 +90,6 @@ func getDevicePerformanceScores(client *meraki.Client, devices map[Serial]*Devic device.performanceScore = val } } - - return nil } func getDeviceChannelUtilization(client *meraki.Client, devices map[Serial]*Device, period time.Duration) error {