From 550a6667fa09850a1b380fff0eaba4b000f8f6c3 Mon Sep 17 00:00:00 2001 From: Mayur Kale Date: Wed, 10 Apr 2019 20:54:09 -0700 Subject: [PATCH 1/3] Add default metrics supported by OpenCensus system metrics package --- metrics/SystemMetrics.md | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 metrics/SystemMetrics.md diff --git a/metrics/SystemMetrics.md b/metrics/SystemMetrics.md new file mode 100644 index 0000000..9f7d138 --- /dev/null +++ b/metrics/SystemMetrics.md @@ -0,0 +1,35 @@ +# System Metrics +This document serves to document the "look and feel" of the OpenCensus API for auto-collection of system metrics such as processes, memory & CPU usage, disks, etc. + +## Supported platforms +TODO: Add list of supported platforms. + +## Common metrics collection +These are some default metrics supported by OpenCensus system metrics package/contrib. This is to ensure consistency across language implementations, as far as practical. + +| Metric Name | Unit | Type | Description | Labels | +|-------------------------------------------|-------|----------------------------|-----------------------------------------------------------------------------------------------|-----------------| +| system/cpu_seconds/total | s | Int64 Cumulative | Total kernel/system user CPU in seconds. | Hostname, Mode | +| system/processes/created | 1 | Int64 Cumulative | Total number of times a process was created. | Hostname | +| system/processes/running | 1 | Int64 Gauge | Total number of running processes. | Hostname | +| system/disk/total | By | Int64 Gauge | The total available system disk space in bytes. | Hostname, Volume | +| system/disk/used | By | Int64 Gauge | The total used system disk space in bytes. | Hostname, Volume | +| process/heap/total | By | Int64 Gauge | The process's total allocated heap size in bytes. | Hostname | +| process/heap/used | By | Int64 Gauge | The process's total used heap size in bytes. | Hostname | +| process/memory/rss | By | Int64 Gauge | Resident memory size in bytes. | Hostname | +| process/file_descriptor/max | 1 | Int64 Gauge | The maximum limit of file descriptor count. | Hostname | +| process/file_descriptor/open | 1 | Int64 Gauge | The number of open file descriptor count. | Hostname | +| process/start_time | s | Int64 Cumulative | The start time of the process since unix epoch in seconds. | Hostname | +| process/cpu/usage | s | Int64 Cumulative | The total user and system CPU time spent in seconds. | Hostname | + +### Labels +The label keys associated with the above metrics. + +| Label Key | Description | +|--------------------|----------------------------------------------------------------------------------------------------------| +| Mode | The amount of time spent by the CPU in state (i.e. `user, nice, system, idle, iowait`). | +| Volume | The path the fs is mounted on (i.e. `/, /data`) | +| Hostname | The hostname of the host (i.e. `opencensus-test`). | + +## Language specific metrics collection +TODO: Add language-specific documentation for the list of supported metrics collection (e.g. garbage collection, threads, classloaders, etc.). From bc68109db8223c334f010d6506623a0a9b65adb0 Mon Sep 17 00:00:00 2001 From: Mayur Kale Date: Fri, 12 Apr 2019 21:32:46 -0700 Subject: [PATCH 2/3] Add memory metrics --- metrics/SystemMetrics.md | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/metrics/SystemMetrics.md b/metrics/SystemMetrics.md index 9f7d138..e672a98 100644 --- a/metrics/SystemMetrics.md +++ b/metrics/SystemMetrics.md @@ -7,27 +7,30 @@ TODO: Add list of supported platforms. ## Common metrics collection These are some default metrics supported by OpenCensus system metrics package/contrib. This is to ensure consistency across language implementations, as far as practical. -| Metric Name | Unit | Type | Description | Labels | -|-------------------------------------------|-------|----------------------------|-----------------------------------------------------------------------------------------------|-----------------| -| system/cpu_seconds/total | s | Int64 Cumulative | Total kernel/system user CPU in seconds. | Hostname, Mode | -| system/processes/created | 1 | Int64 Cumulative | Total number of times a process was created. | Hostname | -| system/processes/running | 1 | Int64 Gauge | Total number of running processes. | Hostname | -| system/disk/total | By | Int64 Gauge | The total available system disk space in bytes. | Hostname, Volume | -| system/disk/used | By | Int64 Gauge | The total used system disk space in bytes. | Hostname, Volume | -| process/heap/total | By | Int64 Gauge | The process's total allocated heap size in bytes. | Hostname | -| process/heap/used | By | Int64 Gauge | The process's total used heap size in bytes. | Hostname | -| process/memory/rss | By | Int64 Gauge | Resident memory size in bytes. | Hostname | -| process/file_descriptor/max | 1 | Int64 Gauge | The maximum limit of file descriptor count. | Hostname | -| process/file_descriptor/open | 1 | Int64 Gauge | The number of open file descriptor count. | Hostname | -| process/start_time | s | Int64 Cumulative | The start time of the process since unix epoch in seconds. | Hostname | -| process/cpu/usage | s | Int64 Cumulative | The total user and system CPU time spent in seconds. | Hostname | +| Metric Name | Unit | Type | Description | Labels | +|-------------------------------------------|-------|----------------------------|--------------------------------------------------------------------|-------------------------| +| system/cpu_seconds/total | s | Int64 Cumulative | Total kernel/system user CPU in seconds. | Hostname, Mode | +| system/processes/created | 1 | Int64 Cumulative | Total number of times a process was created. | Hostname | +| system/processes/running | 1 | Int64 Gauge | Total number of running processes. | Hostname | +| system/processes/blocked | 1 | Int64 Gauge | Total number of blocked processes. | Hostname | +| system/memory/total | By | Int64 Gauge | Total system memory capacity in bytes. | Hostname | +| system/memory/free | By | Int64 Gauge | Total free system memory in bytes. | Hostname | +| system/memory/used | By | Int64 Gauge | Total used system memory in bytes. | Hostname | +| system/disk/total | By | Int64 Gauge | The total available system disk space in bytes. | Hostname, Volume | +| system/disk/used | By | Int64 Gauge | The total used system disk space in bytes. | Hostname, Volume | +| process/memory/rss | By | Int64 Gauge | Resident memory size in bytes. | Hostname | +| process/file_descriptor/max | 1 | Int64 Gauge | The maximum limit of file descriptor count. | Hostname | +| process/file_descriptor/open | 1 | Int64 Gauge | The number of open file descriptor count. | Hostname | +| process/heap/total | By | Int64 Gauge | The process's total allocated heap size in bytes. | Hostname | +| process/heap/used | By | Int64 Gauge | The process's total used heap size in bytes. | Hostname | +| process/cpu/usage | s | Int64 Cumulative | The total user and system CPU time spent in seconds. | Hostname | ### Labels The label keys associated with the above metrics. | Label Key | Description | |--------------------|----------------------------------------------------------------------------------------------------------| -| Mode | The amount of time spent by the CPU in state (i.e. `user, nice, system, idle, iowait`). | +| Mode | The amount of time spent by the CPU in state (i.e. `user, nice, system, idle, iowait, stolen`). | | Volume | The path the fs is mounted on (i.e. `/, /data`) | | Hostname | The hostname of the host (i.e. `opencensus-test`). | From 8696358276ebd3d02f74f79f0c32c1ddb385875f Mon Sep 17 00:00:00 2001 From: Mayur Kale Date: Mon, 6 May 2019 12:33:27 -0700 Subject: [PATCH 3/3] Fix review comment: Combine common metrics and add labels --- metrics/SystemMetrics.md | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/metrics/SystemMetrics.md b/metrics/SystemMetrics.md index e672a98..5c032ed 100644 --- a/metrics/SystemMetrics.md +++ b/metrics/SystemMetrics.md @@ -9,28 +9,24 @@ These are some default metrics supported by OpenCensus system metrics package/co | Metric Name | Unit | Type | Description | Labels | |-------------------------------------------|-------|----------------------------|--------------------------------------------------------------------|-------------------------| -| system/cpu_seconds/total | s | Int64 Cumulative | Total kernel/system user CPU in seconds. | Hostname, Mode | -| system/processes/created | 1 | Int64 Cumulative | Total number of times a process was created. | Hostname | -| system/processes/running | 1 | Int64 Gauge | Total number of running processes. | Hostname | -| system/processes/blocked | 1 | Int64 Gauge | Total number of blocked processes. | Hostname | -| system/memory/total | By | Int64 Gauge | Total system memory capacity in bytes. | Hostname | -| system/memory/free | By | Int64 Gauge | Total free system memory in bytes. | Hostname | -| system/memory/used | By | Int64 Gauge | Total used system memory in bytes. | Hostname | -| system/disk/total | By | Int64 Gauge | The total available system disk space in bytes. | Hostname, Volume | -| system/disk/used | By | Int64 Gauge | The total used system disk space in bytes. | Hostname, Volume | -| process/memory/rss | By | Int64 Gauge | Resident memory size in bytes. | Hostname | -| process/file_descriptor/max | 1 | Int64 Gauge | The maximum limit of file descriptor count. | Hostname | -| process/file_descriptor/open | 1 | Int64 Gauge | The number of open file descriptor count. | Hostname | -| process/heap/total | By | Int64 Gauge | The process's total allocated heap size in bytes. | Hostname | -| process/heap/used | By | Int64 Gauge | The process's total used heap size in bytes. | Hostname | -| process/cpu/usage | s | Int64 Cumulative | The total user and system CPU time spent in seconds. | Hostname | +| system/cpu_seconds | s | Int64 Cumulative | System CPU in seconds. | Hostname, Mode | +| system/processes | 1 | Int64 Cumulative | System processes count. | Hostname, State | +| system/memory | By | Int64 Gauge | System memory capacity in bytes. | Hostname, Category | +| system/disk | By | Int64 Gauge | System disk space in bytes. | Hostname, Volume, Category | +| process/memory/rss | By | Int64 Gauge | Resident memory size in bytes. | Hostname | +| process/file_descriptor | 1 | Int64 Gauge | The number of file descriptor count. | Hostname, fds_type | +| process/heap | By | Int64 Gauge | The process's heap size in bytes. | Hostname, Category | +| process/cpu/usage | s | Int64 Cumulative | The total user and system CPU time spent in seconds. | Hostname | ### Labels The label keys associated with the above metrics. | Label Key | Description | |--------------------|----------------------------------------------------------------------------------------------------------| -| Mode | The amount of time spent by the CPU in state (i.e. `user, nice, system, idle, iowait, stolen`). | +| Mode | The amount of time spent by the CPU in state (i.e. `total, user, nice, system, idle, iowait, stolen`). | +| State | The process state (i.e. `created, running, blocked, stopped etc`). | +| Category | The memory/disk category (i.e. `total, free, used etc`). | +| fds_type | The file descriptors type (i.e. `open, max`). | | Volume | The path the fs is mounted on (i.e. `/, /data`) | | Hostname | The hostname of the host (i.e. `opencensus-test`). |