From 830b08b1ee6858ffcbb789eaf51ebb80b380f82c Mon Sep 17 00:00:00 2001 From: harnish-elastic Date: Thu, 24 Aug 2023 14:38:36 +0530 Subject: [PATCH 1/5] add metric_type for pool and process data streams --- packages/php_fpm/changelog.yml | 5 +++++ packages/php_fpm/data_stream/pool/fields/fields.yml | 1 + packages/php_fpm/data_stream/process/fields/fields.yml | 2 ++ packages/php_fpm/docs/README.md | 6 +++--- packages/php_fpm/manifest.yml | 2 +- 5 files changed, 12 insertions(+), 4 deletions(-) diff --git a/packages/php_fpm/changelog.yml b/packages/php_fpm/changelog.yml index a0119853313..e1742a4f244 100644 --- a/packages/php_fpm/changelog.yml +++ b/packages/php_fpm/changelog.yml @@ -1,4 +1,9 @@ # newer versions go on top +- version: "0.6.0" + changes: + - description: Add metric_type for pool and process data streams. + type: enhancement + link: https://github.com/elastic/integrations/pull/1 #FIX ME - version: "0.5.0" changes: - description: Rename ownership from obs-service-integrations to obs-infraobs-integrations diff --git a/packages/php_fpm/data_stream/pool/fields/fields.yml b/packages/php_fpm/data_stream/pool/fields/fields.yml index dd415d25df1..1c5a3953e9f 100644 --- a/packages/php_fpm/data_stream/pool/fields/fields.yml +++ b/packages/php_fpm/data_stream/pool/fields/fields.yml @@ -49,6 +49,7 @@ - name: children_reached.max type: long description: Has the maximum number of processes ever been reached? If so the displayed value is 1 otherwise the value is 0. + metric_type: gauge - name: count type: long description: The current total number of processes. diff --git a/packages/php_fpm/data_stream/process/fields/fields.yml b/packages/php_fpm/data_stream/process/fields/fields.yml index ec64f1ebbe3..72f8dceb8ac 100644 --- a/packages/php_fpm/data_stream/process/fields/fields.yml +++ b/packages/php_fpm/data_stream/process/fields/fields.yml @@ -31,6 +31,7 @@ type: long description: The maximum amount of memory consumed by the last request. This will be 0 if the process is not Idle because the calculation is done when the request processing is complete. metric_type: gauge + unit: byte - name: script type: keyword description: The full path of the script executed by the last request. This will be '-' if not applicable (eg. status page requests). @@ -42,6 +43,7 @@ - name: start_time type: long description: The date/time at which the process started. + metric_type: counter - name: state type: keyword description: The state of the process. diff --git a/packages/php_fpm/docs/README.md b/packages/php_fpm/docs/README.md index 98587aaadbc..4fea1dd2287 100644 --- a/packages/php_fpm/docs/README.md +++ b/packages/php_fpm/docs/README.md @@ -145,7 +145,7 @@ An example event for `pool` looks as following: | php_fpm.pool.process_manager.type | The process manager type - static, dynamic or ondemand. | keyword | | | | php_fpm.pool.processes.active.count | The number of processes that are currently processing requests. | long | | gauge | | php_fpm.pool.processes.active.max | The maximum number of concurrently active processes. | long | | gauge | -| php_fpm.pool.processes.children_reached.max | Has the maximum number of processes ever been reached? If so the displayed value is 1 otherwise the value is 0. | long | | | +| php_fpm.pool.processes.children_reached.max | Has the maximum number of processes ever been reached? If so the displayed value is 1 otherwise the value is 0. | long | | gauge | | php_fpm.pool.processes.count | The current total number of processes. | long | | gauge | | php_fpm.pool.processes.idle | The number of processes that are currently idle (waiting for requests). | long | | gauge | | php_fpm.pool.slow_requests | The total number of requests that have hit the configured request_slowlog_timeout. | long | | counter | @@ -270,10 +270,10 @@ An example event for `process` looks as following: | php_fpm.process.request.count | The total number of requests served. | long | | counter | | php_fpm.process.request.duration | The duration in microseconds of the requests. | long | micros | gauge | | php_fpm.process.request.last.cpu.pct | The %cpu of the last request. This will be 0 if the process is not Idle because the calculation is done when the request processing is complete. | long | percent | gauge | -| php_fpm.process.request.last.memory | The maximum amount of memory consumed by the last request. This will be 0 if the process is not Idle because the calculation is done when the request processing is complete. | long | | gauge | +| php_fpm.process.request.last.memory | The maximum amount of memory consumed by the last request. This will be 0 if the process is not Idle because the calculation is done when the request processing is complete. | long | byte | gauge | | php_fpm.process.script | The full path of the script executed by the last request. This will be '-' if not applicable (eg. status page requests). | keyword | | | | php_fpm.process.start_since | The number of seconds since the process started. | long | s | counter | -| php_fpm.process.start_time | The date/time at which the process started. | long | | | +| php_fpm.process.start_time | The date/time at which the process started. | long | | counter | | php_fpm.process.state | The state of the process. | keyword | | | | process.pid | Process id. | long | | | | tags | List of keywords used to tag each event. | keyword | | | diff --git a/packages/php_fpm/manifest.yml b/packages/php_fpm/manifest.yml index 936e8c06636..62e094c009e 100644 --- a/packages/php_fpm/manifest.yml +++ b/packages/php_fpm/manifest.yml @@ -1,7 +1,7 @@ format_version: 2.0.0 name: php_fpm title: PHP-FPM -version: "0.5.0" +version: "0.6.0" description: This Elastic integration collects metrics from PHP-FPM. type: integration categories: From ce0f4fe3a57121b8f10fc37e89c4dcff0a44337c Mon Sep 17 00:00:00 2001 From: harnish-elastic Date: Thu, 24 Aug 2023 14:42:44 +0530 Subject: [PATCH 2/5] update pr link --- packages/php_fpm/changelog.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/php_fpm/changelog.yml b/packages/php_fpm/changelog.yml index e1742a4f244..3f92ea71b51 100644 --- a/packages/php_fpm/changelog.yml +++ b/packages/php_fpm/changelog.yml @@ -3,7 +3,7 @@ changes: - description: Add metric_type for pool and process data streams. type: enhancement - link: https://github.com/elastic/integrations/pull/1 #FIX ME + link: https://github.com/elastic/integrations/pull/7527 - version: "0.5.0" changes: - description: Rename ownership from obs-service-integrations to obs-infraobs-integrations From f9cb0d09e09b5ba9a1ba716a715c89c7efb3463c Mon Sep 17 00:00:00 2001 From: harnish-elastic Date: Mon, 18 Sep 2023 21:26:55 +0530 Subject: [PATCH 3/5] update metric_type for php-fpm --- packages/php_fpm/data_stream/pool/fields/fields.yml | 2 -- packages/php_fpm/data_stream/process/fields/fields.yml | 2 -- packages/php_fpm/docs/README.md | 8 ++++---- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/packages/php_fpm/data_stream/pool/fields/fields.yml b/packages/php_fpm/data_stream/pool/fields/fields.yml index 1c5a3953e9f..fe70e1b1fc6 100644 --- a/packages/php_fpm/data_stream/pool/fields/fields.yml +++ b/packages/php_fpm/data_stream/pool/fields/fields.yml @@ -65,9 +65,7 @@ - name: start_since type: long description: The time in seconds since the process pool was last started. - metric_type: counter unit: s - name: start_time type: long description: The date/time that the process pool was last started. - metric_type: counter diff --git a/packages/php_fpm/data_stream/process/fields/fields.yml b/packages/php_fpm/data_stream/process/fields/fields.yml index 72f8dceb8ac..e0d64db6988 100644 --- a/packages/php_fpm/data_stream/process/fields/fields.yml +++ b/packages/php_fpm/data_stream/process/fields/fields.yml @@ -38,12 +38,10 @@ - name: start_since type: long description: The number of seconds since the process started. - metric_type: counter unit: s - name: start_time type: long description: The date/time at which the process started. - metric_type: counter - name: state type: keyword description: The state of the process. diff --git a/packages/php_fpm/docs/README.md b/packages/php_fpm/docs/README.md index 4fea1dd2287..93302dc1f13 100644 --- a/packages/php_fpm/docs/README.md +++ b/packages/php_fpm/docs/README.md @@ -149,8 +149,8 @@ An example event for `pool` looks as following: | php_fpm.pool.processes.count | The current total number of processes. | long | | gauge | | php_fpm.pool.processes.idle | The number of processes that are currently idle (waiting for requests). | long | | gauge | | php_fpm.pool.slow_requests | The total number of requests that have hit the configured request_slowlog_timeout. | long | | counter | -| php_fpm.pool.start_since | The time in seconds since the process pool was last started. | long | s | counter | -| php_fpm.pool.start_time | The date/time that the process pool was last started. | long | | counter | +| php_fpm.pool.start_since | The time in seconds since the process pool was last started. | long | s | | +| php_fpm.pool.start_time | The date/time that the process pool was last started. | long | | | | tags | List of keywords used to tag each event. | keyword | | | @@ -272,8 +272,8 @@ An example event for `process` looks as following: | php_fpm.process.request.last.cpu.pct | The %cpu of the last request. This will be 0 if the process is not Idle because the calculation is done when the request processing is complete. | long | percent | gauge | | php_fpm.process.request.last.memory | The maximum amount of memory consumed by the last request. This will be 0 if the process is not Idle because the calculation is done when the request processing is complete. | long | byte | gauge | | php_fpm.process.script | The full path of the script executed by the last request. This will be '-' if not applicable (eg. status page requests). | keyword | | | -| php_fpm.process.start_since | The number of seconds since the process started. | long | s | counter | -| php_fpm.process.start_time | The date/time at which the process started. | long | | counter | +| php_fpm.process.start_since | The number of seconds since the process started. | long | s | | +| php_fpm.process.start_time | The date/time at which the process started. | long | | | | php_fpm.process.state | The state of the process. | keyword | | | | process.pid | Process id. | long | | | | tags | List of keywords used to tag each event. | keyword | | | From d36b3190a1aa083d5d270b33e15810d826d1c819 Mon Sep 17 00:00:00 2001 From: harnish-elastic Date: Mon, 18 Sep 2023 21:31:11 +0530 Subject: [PATCH 4/5] resolve merge conflicts --- packages/php_fpm/manifest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/php_fpm/manifest.yml b/packages/php_fpm/manifest.yml index 62e094c009e..b8f1f09d3f0 100644 --- a/packages/php_fpm/manifest.yml +++ b/packages/php_fpm/manifest.yml @@ -1,7 +1,7 @@ format_version: 2.0.0 name: php_fpm title: PHP-FPM -version: "0.6.0" +version: "0.6.1" description: This Elastic integration collects metrics from PHP-FPM. type: integration categories: From 752838930a2b43a5655bd934d4e6f8de9e5396f1 Mon Sep 17 00:00:00 2001 From: harnish-elastic Date: Wed, 20 Sep 2023 11:35:56 +0530 Subject: [PATCH 5/5] address review comments --- packages/php_fpm/data_stream/pool/fields/fields.yml | 1 + packages/php_fpm/data_stream/process/fields/fields.yml | 1 + packages/php_fpm/docs/README.md | 4 ++-- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/php_fpm/data_stream/pool/fields/fields.yml b/packages/php_fpm/data_stream/pool/fields/fields.yml index fe70e1b1fc6..c0956a8ecfd 100644 --- a/packages/php_fpm/data_stream/pool/fields/fields.yml +++ b/packages/php_fpm/data_stream/pool/fields/fields.yml @@ -65,6 +65,7 @@ - name: start_since type: long description: The time in seconds since the process pool was last started. + metric_type: counter unit: s - name: start_time type: long diff --git a/packages/php_fpm/data_stream/process/fields/fields.yml b/packages/php_fpm/data_stream/process/fields/fields.yml index e0d64db6988..2f4b4e981b2 100644 --- a/packages/php_fpm/data_stream/process/fields/fields.yml +++ b/packages/php_fpm/data_stream/process/fields/fields.yml @@ -38,6 +38,7 @@ - name: start_since type: long description: The number of seconds since the process started. + metric_type: counter unit: s - name: start_time type: long diff --git a/packages/php_fpm/docs/README.md b/packages/php_fpm/docs/README.md index 77115fdb55e..9a891af8f14 100644 --- a/packages/php_fpm/docs/README.md +++ b/packages/php_fpm/docs/README.md @@ -247,7 +247,7 @@ An example event for `pool` looks as following: | php_fpm.pool.processes.count | The current total number of processes. | long | | gauge | | php_fpm.pool.processes.idle | The number of processes that are currently idle (waiting for requests). | long | | gauge | | php_fpm.pool.slow_requests | The total number of requests that have hit the configured request_slowlog_timeout. | long | | counter | -| php_fpm.pool.start_since | The time in seconds since the process pool was last started. | long | s | | +| php_fpm.pool.start_since | The time in seconds since the process pool was last started. | long | s | counter | | php_fpm.pool.start_time | The date/time that the process pool was last started. | long | | | | service.address | Address where data about this service was collected from. This should be a URI, network address (ipv4:port or [ipv6]:port) or a resource path (sockets). | keyword | | | | tags | List of keywords used to tag each event. | keyword | | | @@ -375,7 +375,7 @@ An example event for `process` looks as following: | php_fpm.process.request.last.cpu.pct | The %cpu of the last request. This will be 0 if the process is not Idle because the calculation is done when the request processing is complete. | long | percent | gauge | | php_fpm.process.request.last.memory | The maximum amount of memory consumed by the last request. This will be 0 if the process is not Idle because the calculation is done when the request processing is complete. | long | byte | gauge | | php_fpm.process.script | The full path of the script executed by the last request. This will be '-' if not applicable (eg. status page requests). | keyword | | | -| php_fpm.process.start_since | The number of seconds since the process started. | long | s | | +| php_fpm.process.start_since | The number of seconds since the process started. | long | s | counter | | php_fpm.process.start_time | The date/time at which the process started. | long | | | | php_fpm.process.state | The state of the process. | keyword | | | | process.pid | Process id. | long | | |