diff --git a/metricbeat/module/php_fpm/pool/_meta/data.json b/metricbeat/module/php_fpm/pool/_meta/data.json index 224fb65ce9eb..dfb676ec1bfb 100644 --- a/metricbeat/module/php_fpm/pool/_meta/data.json +++ b/metricbeat/module/php_fpm/pool/_meta/data.json @@ -15,7 +15,7 @@ "php_fpm": { "pool": { "connections": { - "accepted": 5, + "accepted": 10, "listen_queue_len": 0, "max_listen_queue": 0, "queued": 0 @@ -30,7 +30,7 @@ "total": 2 }, "slow_requests": 0, - "start_since": 57, + "start_since": 491, "start_time": 1548678234 } }, diff --git a/metricbeat/module/php_fpm/process/_meta/data.json b/metricbeat/module/php_fpm/process/_meta/data.json index 02de4e5167ee..e4c85a196eed 100644 --- a/metricbeat/module/php_fpm/process/_meta/data.json +++ b/metricbeat/module/php_fpm/process/_meta/data.json @@ -9,6 +9,16 @@ "duration": 115000, "module": "php_fpm" }, + "http": { + "request": { + "method": "GET" + }, + "response": { + "body": { + "bytes": 0 + } + } + }, "metricset": { "name": "process" }, @@ -17,23 +27,27 @@ "name": "www" }, "process": { - "content_length": 0, "last_request_cpu": 0, "last_request_memory": 0, - "pid": 27, - "request_duration": 133, - "request_method": "GET", - "request_uri": "/status?full=\u0026json=", - "requests": 4, + "request_duration": 231, + "requests": 6, "script": "-", - "start_since": 59, + "start_since": 492, "start_time": 1548678234, - "state": "Running", - "user": "-" + "state": "Running" } }, + "process": { + "pid": 27 + }, "service": { "address": "127.0.0.1:81", "type": "php_fpm" + }, + "url": { + "original": "/status?full=\u0026json=" + }, + "user": { + "name": "-" } } \ No newline at end of file diff --git a/metricbeat/module/php_fpm/process/data.go b/metricbeat/module/php_fpm/process/data.go index 4082180b7102..13a537ccb2f6 100644 --- a/metricbeat/module/php_fpm/process/data.go +++ b/metricbeat/module/php_fpm/process/data.go @@ -55,22 +55,40 @@ func eventsMapping(r mb.ReporterV2, content []byte) { } //remapping process details to match the naming format for _, process := range status.Processes { - proc := common.MapStr{ - "pid": process.PID, - "state": process.State, - "start_time": process.StartTime, - "start_since": process.StartSince, - "requests": process.Requests, - "request_duration": process.RequestDuration, - "request_method": process.RequestMethod, - "request_uri": process.RequestURI, - "content_length": process.ContentLength, - "user": process.User, - "script": process.Script, - "last_request_cpu": process.LastRequestCPU, - "last_request_memory": process.LastRequestMemory, + event := mb.Event{ + RootFields: common.MapStr{ + "http": common.MapStr{ + "request": common.MapStr{ + "method": process.RequestMethod, + }, + "response": common.MapStr{ + "body": common.MapStr{ + "bytes": process.ContentLength, + }, + }, + }, + "user": common.MapStr{ + "name": process.User, + }, + "process": common.MapStr{ + "pid": process.PID, + }, + "url": common.MapStr{ + "original": process.RequestURI, + }, + }, + MetricSetFields: common.MapStr{ + "state": process.State, + "start_time": process.StartTime, + "start_since": process.StartSince, + "requests": process.Requests, + "request_duration": process.RequestDuration, + "script": process.Script, + "last_request_cpu": process.LastRequestCPU, + "last_request_memory": process.LastRequestMemory, + }, } - event := mb.Event{MetricSetFields: proc} + event.ModuleFields = common.MapStr{} event.ModuleFields.Put("pool.name", status.Name) r.Event(event)