From a365e151a88a352305308415d33c140bf63203c1 Mon Sep 17 00:00:00 2001 From: Jaime Soriano Pastor Date: Wed, 8 Aug 2018 08:11:55 +0200 Subject: [PATCH] Recover metrics removed by mistake for old apache versions (#7871) Removed by mistake on #6450 --- CHANGELOG.asciidoc | 1 + metricbeat/module/apache/status/data.go | 12 ++++++++---- metricbeat/tests/system/test_apache.py | 4 ++-- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index b0d62731fa07..efb5de1c2af7 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -46,6 +46,7 @@ https://github.com/elastic/beats/compare/v6.4.0...master[Check the HEAD diff] - Fix golang.heap.gc.cpu_fraction type from long to float in Golang module. {pull}7789[7789] - Fixed a panic when the kvm module cannot establish a connection to libvirtd. {issue}7792[7792]. +- Recover metrics for old apache versions removed by mistake on #6450. {pull}7871[7871] - Add missing namespace field in http server metricset {pull}7890[7890] *Packetbeat* diff --git a/metricbeat/module/apache/status/data.go b/metricbeat/module/apache/status/data.go index f20c61d02842..7659d161d2e3 100644 --- a/metricbeat/module/apache/status/data.go +++ b/metricbeat/module/apache/status/data.go @@ -71,10 +71,11 @@ var ( // Schema used till apache 2.4.12 schemaOld = s.Schema{ - "total_accesses": c.Int("Total Accesses"), - "total_kbytes": c.Int("Total kBytes"), - "requests_per_sec": c.Float("ReqPerSec", s.Optional), - "bytes_per_sec": c.Float("BytesPerSec", s.Optional), + "total_accesses": c.Int("Total Accesses"), + "total_kbytes": c.Int("Total kBytes"), + "requests_per_sec": c.Float("ReqPerSec", s.Optional), + "bytes_per_sec": c.Float("BytesPerSec", s.Optional), + "bytes_per_request": c.Float("BytesPerReq", s.Optional), "workers": s.Object{ "busy": c.Int("BusyWorkers"), "idle": c.Int("IdleWorkers"), @@ -82,6 +83,9 @@ var ( "uptime": s.Object{ "uptime": c.Int("Uptime"), }, + "cpu": s.Object{ + "load": c.Float("CPULoad", s.Optional), + }, "connections": s.Object{ "total": c.Int("ConnsTotal", s.Optional), "async": s.Object{ diff --git a/metricbeat/tests/system/test_apache.py b/metricbeat/tests/system/test_apache.py index 41f73c03bd1b..fd1645181201 100644 --- a/metricbeat/tests/system/test_apache.py +++ b/metricbeat/tests/system/test_apache.py @@ -16,8 +16,8 @@ APACHE_OLD_STATUS_FIELDS = [ "hostname", "total_accesses", "total_kbytes", - "requests_per_sec", "bytes_per_sec", - "workers.busy", "workers.idle", "uptime", + "requests_per_sec", "bytes_per_sec", "bytes_per_request", + "workers.busy", "workers.idle", "uptime", "cpu", "connections", "scoreboard" ]