From 889318f71698368f6e9dbad94e70b30cc68e9530 Mon Sep 17 00:00:00 2001 From: JENNIFER WORTHINGTON <37708067+jenworthington@users.noreply.github.com> Date: Tue, 5 Mar 2019 17:35:40 -0800 Subject: [PATCH 01/10] Update metrics-information.md doc updates --- metrics-information.md | 396 ++++++++++++++++++----------------------- 1 file changed, 171 insertions(+), 225 deletions(-) diff --git a/metrics-information.md b/metrics-information.md index b4b6070..bce0fa9 100644 --- a/metrics-information.md +++ b/metrics-information.md @@ -1,249 +1,198 @@ -# Aggregator Metrics - - |Metric Name |Metric Type |Metric Format |Metric Description | -| --- | --- | --- | --- | -| kube.container.cpu.limit | float | millicpu | Container's cpu limit | -| kube.container.cpu.request| float| millicpu| Container's cpu request | -| kube.container.memory.limit | float | megabyte | Container's memory limit | -| kube.container.memory.request | float | megabyte | Container's memory request | -| kube.pod.cpu.limit | float | millicpu | Pod's cpu limit | -| kube.pod.cpu.request | float | millicpu | Pod's cpu request | -| kube.pod.memory.limit | float | megabyte | Pod's memory limit | -| kube.pod.memory.request | float | megabyte | Pod's memory request | -| kube.namespace.cpu.limit | float | millicpu | Namespace's cpu limit | -| kube.namespace.cpu.request | float | millicpu | Namespace's cpu request | -| kube.namespace.memory.limit | float | megabyte | Namespace's memory limit | -| kube.namespace.memory.request | float | megabyte | Namespace's memory request | -| kube.cluster.cpu.limit | float | millicpu | Cluster's cpu limit | -| kube.cluster.cpu.request | float | millicpu | Cluster's cpu request | -| kube.cluster.memory.limit | float | megabyte | Cluster's memory limit | -| kube.cluster.memory.request | float | megabyte | Cluster's memory request | -| kube.node.cpu.capacity| float | millicpu | Node's cpu capacity | -| kube.node.cpu.allocatable | float | millicpu | Node's cpu allocatable | -| kube.node.memory.capacity | float | megabyte | Node's memory capacity | -| kube.node.memory.allocatable | float | megabyte |Node's memory allocatable | -| kube.node.cpu.reservation | float | millicpu | Node's cpu reservation | -| kube.node.cpu.utilization | float | millicpu | Node's cpu utilization | -| kube.node.memory.reservation | float | megabyte | Node's memory reservation | -| kube.node.memory.utilization | float | megabyte | Node's memory utilization | -| kube.namespace.cpu.usage | float | millicpu | Namespace's cpu usage | -| kube.namespace.memory.usage | float | megabyte | Namespace's memory usage | -| kube.cluster.cpu.usage | float | millicpu | Cluster's cpu usage | -| kube.cluster.memory.usage | float | bytes | Cluster's memory usage| -| kube.node.runtime | | | | - +# Metrics Information +## The foillowing table describes common terminology used in this topic. - # Summary Metrics - - | Jargon | Definition | +| Terminology | Definition | | --- | --- | | Node | A single machine in a kubernetes cluster | -| imagefs | Stats about the underlying filesystem where container images are stored. Usage here refers -to the total number of bytes occupied by images on the filesystem. | +| imagefs | Stats for the underlying filesystem where container images are stored. Usage here refers to the total number of bytes occupied by images on the filesystem. | | fs | Stats pertaining to total usage of filesystem resources on the rootfs used by node k8s components. | -| sys-container | Stats of system daemons tracked as raw containers. | -| runtime | Stats about the underlying container runtime. | -| volume | Stats pertaining to volume usage of filesystem resources. | +| sys-container | Stats for system daemons tracked as raw containers. | +| runtime | Stats for the underlying container runtime. | +| volume | Stats for volume usage of filesystem resources. | | ephemeral-storage | Reports the total filesystem usage for the containers and emptyDir-backed volumes in the measured Pod. | | rootfs | Stats pertaining to container rootfs usage of filesystem resources. | Reference: https://github.com/kubernetes/kubernetes/blob/master/pkg/kubelet/apis/stats/v1alpha1/types.go - # Summary Metrics +## Aggregator Metrics - | Metric Name | Metric Type | Metric Format | Metric Description| +| Metric Name | Metric Type | Metric Format | Metric Description | +| --- | --- | --- | --- | +| kube.container.cpu.limit | float | millicpu | The container's CPU limit. | +| kube.container.cpu.request| float| millicpu| Container's CPU request. | +| kube.container.memory.limit | float | megabyte | The container's memory limit. | +| kube.container.memory.request | float | megabyte | The container's memory request. | +| kube.pod.cpu.limit | float | millicpu | The pod's CPU limit. | +| kube.pod.cpu.request | float | millicpu | The pod's CPU request. | +| kube.pod.memory.limit | float | megabyte | The pod's memory limit. | +| kube.pod.memory.request | float | megabyte | The pod's memory request. | +| kube.namespace.cpu.limit | float | millicpu | The namespace's CPU limit. | +| kube.namespace.cpu.request | float | millicpu | The namespace's CPU request. | +| kube.namespace.memory.limit | float | megabyte | The namespace's memory limit. | +| kube.namespace.memory.request | float | megabyte | The namespace's memory request. | +| kube.cluster.cpu.limit | float | millicpu | The cluster's CPU limit. | +| kube.cluster.cpu.request | float | millicpu | The cluster's CPU request. | +| kube.cluster.memory.limit | float | megabyte | The cluster's memory limit. | +| kube.cluster.memory.request | float | megabyte | The cluster's memory request. | +| kube.node.cpu.capacity| float | millicpu | The node's CPU capacity. | +| kube.node.cpu.allocatable | float | millicpu | The node's CPU allocatable. | +| kube.node.memory.capacity | float | megabyte | The node's memory capacity. | +| kube.node.memory.allocatable | float | megabyte | The node's allocatable memory. | +| kube.node.cpu.reservation | float | millicpu | The node's CPU reservation. | +| kube.node.cpu.utilization | float | millicpu | The node's CPU utilization. | +| kube.node.memory.reservation | float | megabyte | The node's memory reservation. | +| kube.node.memory.utilization | float | megabyte | The node's memory utilization. | +| kube.namespace.cpu.usage | float | millicpu | The namespace's CPU usage. | +| kube.namespace.memory.usage | float | megabyte | The namespace's memory usage. | +| kube.cluster.cpu.usage | float | millicpu | The cluster's CPU usage. | +| kube.cluster.memory.usage | float | bytes | The luster's memory usage. | +| kube.node.runtime | | | | + +## Summary Metrics + +| Metric Name | Metric Type | Metric Format | Metric Description | | --- | --- | --- | --- | -| kube.node.uptime | float | seconds | Node's uptime | +| kube.node.uptime | float | seconds | The node uptime. | | kube.node.cpu.usage_rate | float | millicpu | Total CPU usage (sum of all cores) averaged over the sample window. | | kube.node.cpu.usage | float | nanocpu | Total CPU usage (sum of all cores) averaged over the sample window. | -| kube.node.memory.available_bytes | float | bytes | Node's available memory for use in bytes. | -| kube.node.memory.usage_bytes | float | bytes | Node's memory in use in bytes. | +| kube.node.memory.available_bytes | float | bytes | The node available memory for use in bytes. | +| kube.node.memory.usage_bytes | float | bytes | The node memory in use in bytes. | | kube.node.memory.rss_bytes | float | bytes | The amount of anonymous and swap cache memory in bytes in the node. | -| kube.node.memory.page_faults | integer | | Cumulative number of minor page faults in the node. | -| kube.node.memory.major_page_faults | integer | | Cumulative number of major page faults in the node. | -| kube.node.network.rx_bytes | float | bytes | Cumulative count of bytes received in the node. | -| kube.node.network.rx_errors | integer | | Cumulative count of receive errors encountered in the node. | -| kube.node.network.tx_bytes | float | bytes | Cumulative count of bytes transmitted in the node. | -| kube.node.network.tx_errors | integer | | Cumulative count of transmit errors encountered in the node. | - | Metric | Metric Type | Metric Format | Metric Descrioption | -| --- | --- | --- | --- | -| kube.node.fs.available_bytes | float | bytes | Represents the storage space -available, in bytes, for the filesystem on the node. | -| kube.node.fs.capacity_bytes | float | bytes | Represents the total capacity, -in bytes, of the filesystems underlying storage on the node. | -| kube.node.fs.used_bytes | float | bytes | Represents the bytes used for a specific -task on the filesystem on the node. | -| kube.node.fs.inodes_free | integer | | InodesFree represents the free inodes in the filesystem on the node. | -| kube.node.fs.inodes | integer | | Inodes represents the total inodes in the filesystem on the node. | -| kube.node.fs.inodes_used | integer | | Represents the inodes used by the filesystem on the node. | -| kube.node.imagefs.available_bytes | float | bytes | Represents the storage space available, in -bytes, for the filesystem on the node. | -| kube.node.imagefs.capacity_bytes | float | bytes | Represents the total capacity, in bytes, of -the filesystems underlying storage on the node. | -| kube.node.imagefs.used_bytes | float | bytes | Represents the bytes used for a specific task -on the filesystem on the node. | -| kube.node.imagefs.inodes_free | integer | | InodesFree represents the free inodes in the filesystem on the node. -| kube.node.imagefs.inodes | integer | | Inodes represents the free inodes in the filesystem on the node. | -| kube.node.imagefs.inodes_used | integer | | Inodes represents the free inodes in the filesystem on the node. | -| kube.node.runtime.imagefs.maxpid | integer | | The max PID of OS | -| kube.node.runtime.imagefs.curproc | integer | | The number of running process in the OS | -| kube.sys-container.uptime | float | seconds | Sys container's uptime | -| kube.sys-container.cpu.usage_rate | float | millicpu | Total CPU usage (sum of all cores) averaged over the -sample window for sys-container. | -| kube.sys-container.cpu.usage | float | millicpu | Total CPU usage rate (sum of all cores) averaged over the -sample window for sys-container. | -| kube.sys-container.memory.available_bytes | float | bytes | Represents the storage space -available, in bytes, for the filesystem for sys-container. | -| kube.sys-container.memory.usage_bytes |float |bytes |Node's memory in use in bytes for sys-container. | -| kube.sys-container.memory.rss_bytes | float | bytes | The amount of anonymous and swap cache memory. -in bytes, for sys-container. | -| kube.sys-container.memory.rss_bytes | float | bytes | The amount of anonymous and swap cache memory, -in bytes, for sys-container. -| kube.sys-container.memory.page_faults | integer | | Cumulative number of minor page faults for sys-container. | -| kube.sys-container.memory.major_page_faults | integer | | Cumulative number of major page faults for sys-container. | -| kube.pod.uptime |float |seconds |Pod's uptime. | -| kube.pod.cpu.usage_rate | float | millicpu | Total CPU usage (sum of all cores) averaged over the sample window -for the pod. | -| kube.pod.cpu.usage | float | nanocpu | Total CPU usage rate (sum of all cores) averaged over the sample window -for the pod. | -| kube.pod.memory.available_bytes | float | bytes | Represents the storage space -available, in bytes, for the filesystem for the pod. | -| kube.pod.memory.usage_bytes | float | bytes | Represents the bytes used for a specific -task on the filesystem for the pod. | -| kube.pod.memory.rss_bytes | float | bytes | The amount of anonymous and swap cache memory. in bytes, for the pod. | -| kube.pod.memory.page_faults | integer | | Cumulative number of minor page faults for the pod. | -| kube.pod.memory.major_page_faults | integer | | Cumulative number of minor page faults for the pod. | -| kube.pod.network.rx_bytes | float | bytes | Cumulative count of bytes received for the pod. | -| kube.pod.network.rx_errors | integer | | Cumulative count of receive errors encountered for the pod. | -| kube.pod.network.tx_bytes | float | bytes | Cumulative count of bytes transmitted for the pod. | -| kube.pod.network.tx_errors | integer | | Cumulative count of transmit errors encountered for the pod. | -| kube.pod.ephemeral-storage.available_bytes | float | bytes | Node's available memory for use in bytes for -the pod's ephemeral storage. | -| kube.pod.ephemeral-storage.capacity_bytes | float | bytes | Represents the total capacity, -in bytes, of the filesystems underlying storage for the pod's ephemeral storage. | -| kube.pod.ephemeral-storage.used_bytes | float | bytes | Represents the bytes used for a specific -task on the filesystem for the pod's ephemeral storage. | -| kube.pod.ephemeral-storage.inodes_free |integer | |InodesFree represents the free inodes in the filesystem -for the pod's ephemeral storage. | -| kube.pod.ephemeral-storage.inodes | integer | | Represents the inodes in the filesystem for -the pod's ephemeral storage. | -| kube.pod.ephemeral-storage.inodes_used | integer | | Represents the used inodes in the filesystem -for the pod's ephemeral storage. | -| kube.pod.volume.available_bytes | float | bytes | Represents the storage space available, -In bytes, for the filesystem for the pod's volume. | -| kube.pod.volume.capacity_bytes | float | bytes | Represents the total capacity, in bytes, of -the filesystems underlying storage for the pod's volume. | -| kube.pod.volume.used_bytes | float | bytes | UsedBytes represents the bytes used for a specific task on the -filesystem for the pod's volume. | -| kube.pod.volume.inodes_free | integer | | InodesFree represents the free inodes in the filesystem for the pod's volume. | -| kube.pod.volume.inodes | integer | | Represents the inodes in the filesystem for the pod's volume. | -| kube.pod.volume.inodes_used | integer | | Represents the used inodes in the filesystem for the pod's volume. | -| kube.container.uptime | float | seconds | Container's uptime | -| kube.container.cpu.usage_rate | float | millicpu | Total CPU usage rate (sum of all cores) averaged over the sample -window for the container. | +| kube.node.memory.page_faults | integer | | The cumulative number of minor page faults in the node. | +| kube.node.memory.major_page_faults | integer | | The cumulative number of major page faults in the node. | +| kube.node.network.rx_bytes | float | bytes | The cumulative count of bytes received in the node. | +| kube.node.network.rx_errors | integer | | The cumulative count of receive errors encountered in the node. | +| kube.node.network.tx_bytes | float | bytes | The cumulative count of bytes transmitted in the node. | +| kube.node.network.tx_errors | integer | | The cumulative count of transmit errors encountered in the node. | +| kube.node.fs.available_bytes | float | bytes | The storage space available, in bytes, for the filesystem on the node. | +| kube.node.fs.capacity_bytes | float | bytes | The total capacity, in bytes, of the filesystems underlying storage on the node. | +| kube.node.fs.used_bytes | float | bytes | The bytes used for a specific task on the filesystem on the node. | +| kube.node.fs.inodes_free | integer | | The free inodes in the filesystem on the node. | +| kube.node.fs.inodes | integer | | The total inodes in the filesystem on the node. | +| kube.node.fs.inodes_used | integer | | The inodes used by the filesystem on the node. | +| kube.node.imagefs.available_bytes | float | bytes | The storage space available, in bytes, for the filesystem on the node. | +| kube.node.imagefs.capacity_bytes | float | bytes | The total capacity, in bytes, of the filesystems underlying storage on the node. | +| kube.node.imagefs.used_bytes | float | bytes | The bytes used for a specific task on the filesystem on the node. | +| kube.node.imagefs.inodes_free | integer | | The free inodes in the filesystem on the node. | +| kube.node.imagefs.inodes | integer | | The free inodes in the filesystem on the node. | +| kube.node.imagefs.inodes_used | integer | | The free inodes in the filesystem on the node. | +| kube.node.runtime.imagefs.maxpid | integer | | The max PID for the OS. | +| kube.node.runtime.imagefs.curproc | integer | | The number of running process in the OS. | +| kube.sys-container.uptime | float | seconds | The sys-container uptime. | +| kube.sys-container.cpu.usage_rate | float | millicpu | Total CPU usage (sum of all cores) averaged over the sample window for sys-container. | +| kube.sys-container.cpu.usage | float | millicpu | Total CPU usage rate (sum of all cores) averaged over the sample window for sys-container. | +| kube.sys-container.memory.available_bytes | float | bytes | The storage space available, in bytes, for the filesystem for sys-container. | +| kube.sys-container.memory.usage_bytes |float | bytes | The node memory, in bytes, in use for the sys-container. | +| kube.sys-container.memory.rss_bytes | float | bytes | The amount of anonymous and swap cache memory, in bytes, for the sys-container. | +| kube.sys-container.memory.rss_bytes | float | bytes | The amount of anonymous and swap cache memory, in bytes, for the sys-container. | +| kube.sys-container.memory.page_faults | integer | | The cumulative number of minor page faults for the sys-container. | +| kube.sys-container.memory.major_page_faults | integer | | The cumulative number of major page faults for the sys-container. | +| kube.pod.uptime | float | seconds | The pod's uptime. | +| kube.pod.cpu.usage_rate | float | millicpu | Total CPU usage (sum of all cores), averaged over the sample window for the pod. | +| kube.pod.cpu.usage | float | nanocpu | Total CPU usage rate (sum of all cores), averaged over the sample window for the pod. | +| kube.pod.memory.available_bytes | float | bytes | Represents the storage space available, in bytes, for the filesystem for the pod. | +| kube.pod.memory.usage_bytes | float | bytes | The bytes used for a specific task on the filesystem for the pod. | +| kube.pod.memory.rss_bytes | float | bytes | The amount of anonymous and swap cache memory, in bytes, for the pod. | +| kube.pod.memory.page_faults | integer | | The cumulative number of minor page faults for the pod. | +| kube.pod.memory.major_page_faults | integer | | The cumulative number of minor page faults for the pod. | +| kube.pod.network.rx_bytes | float | bytes | The cumulative count of bytes received for the pod. | +| kube.pod.network.rx_errors | integer | | The cumulative count of receive errors encountered for the pod. | +| kube.pod.network.tx_bytes | float | bytes | The cumulative count of bytes transmitted for the pod. | +| kube.pod.network.tx_errors | integer | | The cumulative count of transmit errors encountered for the pod. | +| kube.pod.ephemeral-storage.available_bytes | float | bytes | The node's available memory for use, in bytes, in the pod's ephemeral storage. | +| kube.pod.ephemeral-storage.capacity_bytes | float | bytes | The total capacity, in bytes, of the filesystem's underlying storage for the pod's ephemeral storage. | +| kube.pod.ephemeral-storage.used_bytes | float | bytes | The bytes used for a specific task on the filesystem for the pod's ephemeral storage. | +| kube.pod.ephemeral-storage.inodes_free |integer | | The free inodes in the filesystem in the pod's ephemeral storage. | +| kube.pod.ephemeral-storage.inodes | integer | | The inodes in the filesystem for the pod's ephemeral storage. | +| kube.pod.ephemeral-storage.inodes_used | integer | | The inodes used in the filesystem for the pod's ephemeral storage. | +| kube.pod.volume.available_bytes | float | bytes | The storage space available, in bytes, for the filesystem for the pod's volume. | +| kube.pod.volume.capacity_bytes | float | bytes | The total capacity, in bytes, of the filesystems underlying storage for the pod's volume. | +| kube.pod.volume.used_bytes | float | bytes | The bytes used for a specific task on the filesystem for the pod's volume. | +| kube.pod.volume.inodes_free | integer | | The free inodes in the filesystem for the pod's volume. | +| kube.pod.volume.inodes | integer | | The inodes in the filesystem for the pod's volume. | +| kube.pod.volume.inodes_used | integer | | The used inodes in the filesystem for the pod's volume. | +| kube.container.uptime | float | seconds | The container's uptime. | +| kube.container.cpu.usage_rate | float | millicpu | Total CPU usage rate (sum of all cores) averaged over the sample window for the container. | | kube.container.cpu.usage | float | nanocpu | Total CPU usage rate (sum of all cores) averaged over the sample window for the container. | -| kube.container.memory.available_bytes | float | bytes | AvailableBytes represents the storage space available, in bytes, -for the filesystem for the container. | -| kube.container.memory.usage_bytes | float | bytes | UsedBytes represents the bytes used for a specific task -on the filesystem for the container. | +| kube.container.memory.available_bytes | float | bytes | The storage space available, in bytes, for the filesystem for the container. | +| kube.container.memory.usage_bytes | float | bytes | The bytes used for a specific task on the filesystem for the container. | | kube.container.memory.rss_bytes | float | bytes | The amount of anonymous and swap cache memory in bytes for the container. | -| kube.container.memory.page_faults | integer | |Cumulative number of minor page faults for the container. | -| kube.container.memory.major_page_faults |integer | |Cumulative number of major page faults for the container. | -| kube.container.rootfs.available_bytes |float |bytes |Represents the storage space available, in bytes, for -the filesystem for the container's rootfs. | -| kube.container.rootfs.capacity_bytes | float | bytes | Represents the total capacity (bytes) of the filesystems -underlying storage for the container's rootfs. | -| kube.container.rootfs.used_bytes | float | bytes | UsedBytes represents the bytes used for a specific task on -the filesystem for the container's rootfs. | -| kube.container.rootfs.inodes_free | integer | | Represents the free inodes in the filesystem for the container's rootfs. | -| kube.container.rootfs.inodes | integer | | Inodes represents the inodes in the filesystem for the container's rootfs. | +| kube.container.memory.page_faults | integer | | The cumulative number of minor page faults for the container. | +| kube.container.memory.major_page_faults | integer | | The cumulative number of major page faults for the container. | +| kube.container.rootfs.available_bytes | float | bytes | The storage space available, in bytes, for the filesystem for the container's rootfs. | +| kube.container.rootfs.capacity_bytes | float | bytes | The total capacity, in bytes, of the filesystems underlying storage for the container's rootfs. | +| kube.container.rootfs.used_bytes | float | bytes | The bytes used for a specific task on the filesystem for the container's rootfs. | +| kube.container.rootfs.inodes_free | integer | | The free inodes in the filesystem for the container's rootfs. | +| kube.container.rootfs.inodes | integer | | The inodes in the filesystem for the container's rootfs. | | kube.container.rootfs.inodes_used | integer | | Represents the used inodes in the filesystem for the container's rootfs. | -| kube.container.logs.available_bytes | float | bytes AvailableBytes represents the storage space available, in bytes, -for the filesystem for the container's logs. | -| kube.container.logs.capacity_bytes | float | bytes | Represents the total capacity (bytes) of the filesystems -underlying storage for the container's logs. | -| kube.container.logs.used_bytes | float | bytes | UsedBytes represents the bytes used for a specific task on the -filesystem for the container's logs. | -| kube.container.logs.inodes_free | integer | | Represents the free inodes in the filesystem for the container's logs. | -| kube.container.logs.inodes | integer | | Represents the inodes in the filesystem for the container's logs. | -| kube.container.logs.inodes_used | integer | | Represents the used inodes in the filesystem for the container's logs. | +| kube.container.logs.available_bytes | float | bytes | The storage space available, in bytes, for the filesystem for the container's logs. | +| kube.container.logs.capacity_bytes | float | bytes | The total capacity, in bytes, of the filesystem's underlying storage for the container's logs. | +| kube.container.logs.used_bytes | float | bytes | The bytes used for a specific task on the filesystem for the container's logs. | +| kube.container.logs.inodes_free | integer | | The free inodes in the filesystem for the container's logs. | +| kube.container.logs.inodes | integer | | The inodes in the filesystem for the container's logs. | +| kube.container.logs.inodes_used | integer | | The used inodes in the filesystem for the container's logs. | + +## Statistic Metrics - Stats Metrics | Metric Name | Metric Type | Metric Format | Metric Description | | --- | --- | --- | --- | -| kube.node.cpu.cfs.periods | ThrottlingData | uint64 | Cpu Completely Fair Scheduler statistics; -Total number of elapsed enforcement intervals. | -| kube.node.cpu.cfs.throttled_periods | ThrottlingData | uint64 | Cpu Completely Fair Scheduler statistics; Total -number of times tasks in the cgroup have been throttled. | -| kube.node.cpu.cfs.throttled_time | ThrottlingData | uint64 | Cpu Completely Fair Scheduler statistics; Total time -duration, in nanoseconds, for which tasks in the cgroup have been throttled. | +| kube.node.cpu.cfs.periods | ThrottlingData | uint64 | CPU Completely Fair Scheduler statistics. Total number of elapsed enforcement intervals. | +| kube.node.cpu.cfs.throttled_periods | ThrottlingData | uint64 | CPU Completely Fair Scheduler statistics. Total number of times tasks in the cgroup have been throttled. | +| kube.node.cpu.cfs.throttled_time | ThrottlingData | uint64 | CPU Completely Fair Scheduler statistics. Total time duration, in nanoseconds, for which tasks in the cgroup have been throttled. | | kube.node.cpu.usage.total | CPUUsage | uint64 | CPU usage time statistics in nanoseconds. | -| per_cpu_usage | CPUUsage | []uint64 | CPU usage time statistics. Per CPU/core usage of the container in nanoseconds. | +| per_cpu_usage | CPUUsage | uint64 | CPU usage time statistics. Per CPU/core usage of the container in nanoseconds. | | kube.node.cpu.usage.user | CPUUsage | uint64 | CPU usage time statistics. Time spent in user space in nanoseconds. | | kube.node.cpu.usage.system | CPUUsage | uint64 | CPU usage time statistics. Time spent in kernel space in nanoseconds. | -| kube.node.cpu.load_average | | | Smoothed average of number of runnable threads x 1000. Splunk software multiplies by -a thousand to avoid using floats while preserving precision. Load is smoothed over the last 10 seconds. Instantaneous value can be read from LoadStats.NrRunning. | -| kube.node.cpu.schedstat.run_time | | | Cpu Aggregated scheduler statistics; time spent on the cpu. | -| kube.node.cpu.schedstat.runqueue_time | | | Cpu Aggregated scheduler statistics; time spent waiting on a runqueue. | -| kube.node.cpu.schedstat.run_periods | | | Cpu Aggregated scheduler statistics; # of timeslices run on this cpu reservation -| kube.node.diskio..stats.Async | | | No Description in code | -| kube.node.diskio..stats.Read | | | No Description in code | -| kube.node.diskio..Sync | | | No Description in code | -| kube.node.diskio..stats.Total | | | No Description in code | -| kube.node.diskio..stats.Write| | | No Description in code | -| kube.node.diskio..minor | | | No Description in code | -| kube.node.diskio..major | | | No Description in code | -| kube.node.filesystem.available | | | Number of bytes available for non-root user. | -| kube.node.filesystem.base_usage | | | Base Usage that is consumed by the container's writable layer. This field is -only applicable for docker container's as of now. | -| kube.node.filesystem.capacity | | | Number of bytes that can be consumed by the container on this filesystem. | -| kube.node.filesystem.inodes | | | Number of Inodes | -| kube.node.filesystem.inodes_free | | | Number of available Inodes | -| kube.node.filesystem.io_in_progress | | | Number of I/Os currently in progress. It is the only field that -should go to zero. Value is incremented as requests are given to appropriate struct request_queue and decremented -as they finish. | -| kube.node.filesystem.io_time | | | Number of milliseconds spent doing I/Os. This field increases so long as field -9 is nonzero. | -| kube.node.filesystem.read_time | | | Number of milliseconds spent reading - total number of milliseconds spent -by all reads (as measured from __make_request() to end_that_request_last()). | -| kube.node.filesystem.reads_completed | | | The total number of reads completed successfully. | -| kube.node.filesystem.reads_merged | | | Number of reads merged; Reads and writes which are adjacent to each other -and may be merged for efficiency. For example, two 4K reads may become one 8K read before it is ultimately handed to -the disk, and so it will be counted (and queued) as only one I/O. This field lets you know how often this was done. | -| kube.node.filesystem.sectors_read | | | Total number of sectors successfully read. | -| kube.node.filesystem.sectors_written | | | This is the total number of sectors successfully written. | -| kube.node.filesystem.usage | | | Number of bytes that is consumed by the container on this filesystem. | -| kube.node.filesystem.weighted_io_time | | | Weighted number of milliseconds spent doing I/Os. This field is -incremented at each I/O start, I/O completion, I/O merge. Or the field can read of these stats by the number of I/Os in progress (field 9) times the number of milliseconds spent doing I/O since the last update of this field. This can provide an -easy measure of both I/O completion time and the backlog that may be accumulating. | -| kube.node.filesystem.write_time | | | Total number of milliseconds spent by all writes, as measured -from __make_request() to end_that_request_last(). | -| kube.node.filesystem.writes_completed | | | Total number of writes completed successfully. | -| kube.node.filesystem.writes_merged | | | Number of writes merged. | -| kube.node.memory.cache | | | Number of bytes of page cache memory in bytes. | -| kube.node.memory.container_data.pgfault | | | No Description in code. | -| kube.node.memory.container_data.pgmajfault | | | No Description in code | -| kube.node.memory.failcnt | | | No Description in code | -| kube.node.memory.hierarchical_data.pgfault | | | No Description in code | -| kube.node.memory.hierarchical_data.pgmajfault | | | No Description in code | -| kube.node.memory.max_usage | | | Maximum memory usage recorded in bytes. | -| kube.node.memory.rss | | | The amount of anonymous and swap cache memory (includes transparent -hugepages) in bytes. -| kube.node.memory.swap | | | The amount of swap, in bytes, currently used by the processes in this cgroup. | -| kube.node.memory.usage | | | Current memory usage, in bytes. This includes all memory regardless of when it was accessed. | -| kube.node.memory.working_set | | | The amount of working set memory in bytes. This includes recently accessed memory, -dirty memory, and kernel memory. Working set is <= "usage". | +| kube.node.cpu.load_average | | | Smoothed average of number of runnable threads x 1000. Splunk software multiplies by a thousand to avoid using floats while preserving precision. Load is smoothed over the last 10 seconds. Instantaneous value can be read from LoadStats.NrRunning. | +| kube.node.cpu.schedstat.run_time | | | The CPU Aggregated scheduler statistics, time spent on the CPU. | +| kube.node.cpu.schedstat.runqueue_time | | | The CPU Aggregated scheduler statistics, time spent waiting on a runqueue. | +| kube.node.cpu.schedstat.run_periods | | | The CPU Aggregated scheduler statistics, number of timeslices run on the CPU reservation. | +| kube.node.diskio..stats.Async | | | | +| kube.node.diskio..stats.Read | | | | +| kube.node.diskio..Sync | | | | +| kube.node.diskio..stats.Total | | | | +| kube.node.diskio..stats.Write | | | | +| kube.node.diskio..minor | | | | +| kube.node.diskio..major | | | | +| kube.node.filesystem.available | | bytes | The bytes available for non-root user. | +| kube.node.filesystem.base_usage | | integer | Base usage consumed by the container's writable layer. At this time, this value is only applicable for Docker containers. | +| kube.node.filesystem.capacity | | bytes | Bytes that can be consumed by the container on this filesystem. | +| kube.node.filesystem.inodes | | integer | Number of inodes. | +| kube.node.filesystem.inodes_free | | integer | Number of available inodes. | +| kube.node.filesystem.io_in_progress | | integer | Number of I/Os currently in progress. It is the only field that should go to zero. Value is incremented as requests are given to appropriate struct request_queue and decremented as they finish. | +| kube.node.filesystem.io_time | | | Number of milliseconds spent doing I/Os. This field increases so long as field 9 is nonzero. | +| kube.node.filesystem.read_time | | | Number of milliseconds spent reading, total number of milliseconds spent by all reads (as measured from make_request() to end_that_request_last()). | +| kube.node.filesystem.reads_completed | | integer | The total number of reads completed successfully. | +| kube.node.filesystem.reads_merged | | integer | Number of reads merged. Reads and writes which are adjacent to each other and may be merged for efficiency. For example, two 4K reads may become one 8K read before it is ultimately handed to the disk, and so it will be counted (and queued) as only one I/O. This field lets you know how often this was done. | +| kube.node.filesystem.sectors_read | | integer | Total number of sectors successfully read. | +| kube.node.filesystem.sectors_written | | integer| The total number of sectors successfully written. | +| kube.node.filesystem.usage | | bytes | Number of bytes consumed by the container on this filesystem. | +| kube.node.filesystem.weighted_io_time | | | Weighted number of milliseconds spent doing I/Os. This field is incremented at each I/O start, I/O completion, I/O merge. Or the field can read these stats by the number of I/Os in progress (field 9) times the number of milliseconds spent doing I/O since the last update of this field. This can provide an easy measure of both I/O completion time and of the backlog that may be accumulating. | +| kube.node.filesystem.write_time | | | Total number of milliseconds spent by all writes, as measured from make_request() to end_that_request_last(). | +| kube.node.filesystem.writes_completed | | integer | Total number of writes completed successfully. | +| kube.node.filesystem.writes_merged | | integer | Number of writes merged. | +| kube.node.memory.cache | | bytes | Number of bytes of page cache memory in bytes. | +| kube.node.memory.container_data.pgfault | | | | +| kube.node.memory.container_data.pgmajfault | | | | +| kube.node.memory.failcnt | | | | +| kube.node.memory.hierarchical_data.pgfault | | | | +| kube.node.memory.hierarchical_data.pgmajfault | | | | +| kube.node.memory.max_usage | | bytes | Maximum memory usage recorded in bytes. | +| kube.node.memory.rss | | bytes | The amount of anonymous and swap cache memory, including transparent hugepages, in bytes. | +| kube.node.memory.swap | | bytes | The amount of swap, in bytes, currently used by the processes in this cgroup. | +| kube.node.memory.usage | | bytes | Current memory usage, in bytes. This includes all memory regardless of when it was accessed. | +| kube.node.memory.working_set | | | The amount of working set memory, in bytes. This includes recently accessed memory, dirty memory, and kernel memory. Working set is <= "usage". | | kube.node.memory.mapped_file | | | | -| kube.node.tasks_stats.nr_io_wait | | | Number of tasks waiting on IO. | -| kube.node.tasks_stats.nr_running | | | Number of running tasks. | -| kube.node.tasks_stats.nr_sleeping | | | Number of sleeping tasks. | -| kube.node.tasks_stats.nr_stopped | | | Number of tasks in stopped state. | -| kube.node.tasks_stats.nr_uninterruptible | | | Number of tasks in uninterruptible state. | -| kube.node.network..rx_bytes | | | Cumulative count of bytes received. | +| kube.node.tasks_stats.nr_io_wait | | integer | Number of tasks waiting on IO. | +| kube.node.tasks_stats.nr_running | | integer | Number of running tasks. | +| kube.node.tasks_stats.nr_sleeping | | integer | Number of sleeping tasks. | +| kube.node.tasks_stats.nr_stopped | | integer | Number of tasks in stopped state. | +| kube.node.tasks_stats.nr_uninterruptible | | integer | Number of tasks in uninterruptible state. | +| kube.node.network..rx_bytes | | bytes | Cumulative count of bytes received. | | kube.node.network..rx_dropped | | | Cumulative count of packets dropped while receiving. | | kube.node.network..rx_errors | | | Cumulative count of receive errors encountered. | | kube.node.network..rx_packets | | | Cumulative count of packets received. | @@ -252,14 +201,11 @@ dirty memory, and kernel memory. Working set is <= "usage". | | kube.node.network..tx_errors | | | Cumulative count of transmit errors encountered. | | kube.node.network..tx_packets | | | Cumulative count of packets transmitted. | + ## Cadvisor Metrics - - - # Cadvisor Metrics - - | Metric Name | Metric Description | -| cadvisor_version_info | A metric with a constant '1' value labeled by kernel version, OS version, docker version, -cadvisor version & cadvisor revision. | +| Metric Name | Metric Description | +| --- | --- | +| cadvisor_version_info | A metric with a constant '1' value labeled by kernel version, OS version, docker version, cadvisor version & cadvisor revision. | | container_cpu_load_average_10s | Value of container cpu load average over the last 10 seconds. | | container_cpu_system_seconds_total | Cumulative system cpu time consumed in seconds. | | container_cpu_usage_seconds_total | Cumulative cpu time consumed in seconds. | From 8bad92785a4d55e8412e2c3afb05c51b0799bc25 Mon Sep 17 00:00:00 2001 From: dtregonning Date: Tue, 5 Mar 2019 17:43:59 -0800 Subject: [PATCH 02/10] update filename + --- metrics-information.md | 2 +- metrics-sources.dm => metrics-sources.md | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename metrics-sources.dm => metrics-sources.md (100%) diff --git a/metrics-information.md b/metrics-information.md index bce0fa9..822f120 100644 --- a/metrics-information.md +++ b/metrics-information.md @@ -136,7 +136,7 @@ for the container. | | kube.container.logs.inodes_used | integer | | The used inodes in the filesystem for the container's logs. | -## Statistic Metrics +## Stats Metrics | Metric Name | Metric Type | Metric Format | Metric Description | | --- | --- | --- | --- | diff --git a/metrics-sources.dm b/metrics-sources.md similarity index 100% rename from metrics-sources.dm rename to metrics-sources.md From 8f66670491ac6edba61bab7ba006d56d1ea8db6f Mon Sep 17 00:00:00 2001 From: Donald Tregonning Date: Wed, 6 Mar 2019 11:38:51 -0800 Subject: [PATCH 03/10] Combined doc updates (#42) * Updated docs and gem-spec versions * gemlock updates --- Gemfile.lock | 14 +- README.md | 6 +- fluent-plugin-kubernetes-metrics.gemspec | 6 +- metrics-sources.md | 317 ----------------------- 4 files changed, 14 insertions(+), 329 deletions(-) delete mode 100644 metrics-sources.md diff --git a/Gemfile.lock b/Gemfile.lock index 8818c28..109645e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,11 +1,11 @@ PATH remote: . specs: - fluent-plugin-kubernetes-metrics (1.1.0.Alpha) - fluentd (~> 1.3.3) + fluent-plugin-kubernetes-metrics (1.1.0) + fluentd (~> 1.4.0) kubeclient (~> 4.2.2) multi_json (~> 1.13.1) - oj (~> 3.7.8) + oj (~> 3.7.9) GEM remote: https://rubygems.org/ @@ -19,7 +19,7 @@ GEM docile (1.3.1) domain_name (0.5.20180417) unf (>= 0.0.5, < 1.0.0) - fluentd (1.3.3) + fluentd (1.4.0) cool.io (>= 1.4.5, < 2.0.0) dig_rb (~> 1.0.0) http_parser.rb (>= 0.5.1, < 0.7.0) @@ -48,10 +48,10 @@ GEM mime-types (3.2.2) mime-types-data (~> 3.2015) mime-types-data (3.2018.0812) - msgpack (1.2.6) + msgpack (1.2.7) multi_json (1.13.1) netrc (0.11.0) - oj (3.7.8) + oj (3.7.9) power_assert (1.1.3) public_suffix (3.0.3) rake (12.3.2) @@ -90,7 +90,7 @@ PLATFORMS ruby DEPENDENCIES - bundler (~> 2.0.1) + bundler (~> 2.0.0) fluent-plugin-kubernetes-metrics! rake (~> 12.3.2) simplecov (~> 0.16.1) diff --git a/README.md b/README.md index 1026f3a..2276c35 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,15 @@ [![CircleCI](https://circleci.com/gh/git-lfs/git-lfs.svg?style=shield&circle-token=856152c2b02bfd236f54d21e1f581f3e4ebf47ad)](https://circleci.com/gh/splunk/fluent-plugin-kubernetes-metrics) # Fluentd Plugin for Kubernetes Metrics -The [Fluentd](https://fluentd.org/) input plugin collects kubernetes cluster metrics which are exposed by the [Kubelet API](https://kubernetes.io/docs/admin/kubelet/) and forwards them to fluentd. +The [Fluentd](https://fluentd.org/) input plugin collects Kubernetes cluster metrics which are exposed by the [Kubelet API](https://kubernetes.io/docs/admin/kubelet/) and forwards them to fluentd. The plugin collects metrics from: * The kubelet summary API * The kubelet stats API * The cAdvisor metrics API -The Fluentd input plugin can be configured to fetch metrics from either the Kublernetes API server or from the Kubelet itself. +The Fluentd input plugin can be configured to fetch metrics from the Kubernetes API server or from the Kubelet. +For more details on the specific metrics that are collected and aggregated with this plugin, please refer to the +[metrics information](https://github.com/splunk/fluent-plugin-kubernetes-metrics/blob/master/metrics-information.md) document. ## Installation diff --git a/fluent-plugin-kubernetes-metrics.gemspec b/fluent-plugin-kubernetes-metrics.gemspec index c01d7f9..1edefa5 100644 --- a/fluent-plugin-kubernetes-metrics.gemspec +++ b/fluent-plugin-kubernetes-metrics.gemspec @@ -17,13 +17,13 @@ Gem::Specification.new do |spec| spec.executables = files.grep(%r{^bin/}) { |f| File.basename(f) } spec.test_files = test_files spec.require_paths = ['lib'] - spec.add_development_dependency 'bundler', '~> 2.0.1' + spec.add_development_dependency 'bundler', '~> 2.0.0' spec.add_development_dependency 'rake', '~> 12.3.2' spec.add_development_dependency 'simplecov', '~> 0.16.1' spec.add_development_dependency 'test-unit', '~> 3.3.0' spec.add_development_dependency 'webmock', '~> 3.5.1' - spec.add_runtime_dependency 'fluentd', '~> 1.3.3' + spec.add_runtime_dependency 'fluentd', '~> 1.4.0' spec.add_runtime_dependency 'kubeclient', '~> 4.2.2' spec.add_runtime_dependency 'multi_json', '~> 1.13.1' - spec.add_runtime_dependency 'oj', '~> 3.7.8' + spec.add_runtime_dependency 'oj', '~> 3.7.9' end diff --git a/metrics-sources.md b/metrics-sources.md deleted file mode 100644 index 6d4f0be..0000000 --- a/metrics-sources.md +++ /dev/null @@ -1,317 +0,0 @@ -# Aggregator Metrics - -|Metric Name |Metric Type |Metric Format |Metric Description | -| --- | --- | --- | --- | -| kube.container.cpu.limit | float | millicpu | Container's cpu limit | -| kube.container.cpu.request| float| millicpu| Container's cpu request | -| kube.container.memory.limit | float | megabyte | Container's memory limit | -| kube.container.memory.request | float | megabyte | Container's memory request | -| kube.pod.cpu.limit | float | millicpu | Pod's cpu limit | -| kube.pod.cpu.request | float | millicpu | Pod's cpu request | -| kube.pod.memory.limit | float | megabyte | Pod's memory limit | -| kube.pod.memory.request | float | megabyte | Pod's memory request | -| kube.namespace.cpu.limit | float | millicpu | Namespace's cpu limit | -| kube.namespace.cpu.request | float | millicpu | Namespace's cpu request | -| kube.namespace.memory.limit | float | megabyte | Namespace's memory limit | -| kube.namespace.memory.request | float | megabyte | Namespace's memory request | -| kube.cluster.cpu.limit | float | millicpu | Cluster's cpu limit | -| kube.cluster.cpu.request | float | millicpu | Cluster's cpu request | -| kube.cluster.memory.limit | float | megabyte | Cluster's memory limit | -| kube.cluster.memory.request | float | megabyte | Cluster's memory request | -| kube.node.cpu.capacity| float | millicpu | Node's cpu capacity | -| kube.node.cpu.allocatable | float | millicpu | Node's cpu allocatable | -| kube.node.memory.capacity | float | megabyte | Node's memory capacity | -| kube.node.memory.allocatable | float | megabyte |Node's memory allocatable | -| kube.node.cpu.reservation | float | millicpu | Node's cpu reservation | -| kube.node.cpu.utilization | float | millicpu | Node's cpu utilization | -| kube.node.memory.reservation | float | megabyte | Node's memory reservation | -| kube.node.memory.utilization | float | megabyte | Node's memory utilization | -| kube.namespace.cpu.usage | float | millicpu | Namespace's cpu usage | -| kube.namespace.memory.usage | float | megabyte | Namespace's memory usage | -| kube.cluster.cpu.usage | float | millicpu | Cluster's cpu usage | -| kube.cluster.memory.usage | float | bytes | Cluster's memory usage| -| kube.node.runtime | | | | - - - -# Summary Metrics - -| Jargon | Definition | -| --- | --- | -| Node | A single machine in a kubernetes cluster | -| imagefs | Stats about the underlying filesystem where container images are stored. Usage here refers -to the total number of bytes occupied by images on the filesystem. | -| fs | Stats pertaining to total usage of filesystem resources on the rootfs used by node k8s components. | -| sys-container | Stats of system daemons tracked as raw containers. | -| runtime | Stats about the underlying container runtime. | -| volume | Stats pertaining to volume usage of filesystem resources. | -| ephemeral-storage | Reports the total filesystem usage for the containers and emptyDir-backed volumes in the measured Pod. | -| rootfs | Stats pertaining to container rootfs usage of filesystem resources. | - -Reference: https://github.com/kubernetes/kubernetes/blob/master/pkg/kubelet/apis/stats/v1alpha1/types.go - - -# Summary Metrics - -| Metric Name | Metric Type | Metric Format | Metric Description| -| --- | --- | --- | --- | -| kube.node.uptime | float | seconds | Node's uptime | -| kube.node.cpu.usage_rate | float | millicpu | Total CPU usage (sum of all cores) averaged over the sample window. | -| kube.node.cpu.usage | float | nanocpu | Total CPU usage (sum of all cores) averaged over the sample window. | -| kube.node.memory.available_bytes | float | bytes | Node's available memory for use in bytes. | -| kube.node.memory.usage_bytes | float | bytes | Node's memory in use in bytes. | -| kube.node.memory.rss_bytes | float | bytes | The amount of anonymous and swap cache memory in bytes in the node. | -| kube.node.memory.page_faults | integer | | Cumulative number of minor page faults in the node. | -| kube.node.memory.major_page_faults | integer | | Cumulative number of major page faults in the node. | -| kube.node.network.rx_bytes | float | bytes | Cumulative count of bytes received in the node. | -| kube.node.network.rx_errors | integer | | Cumulative count of receive errors encountered in the node. | -| kube.node.network.tx_bytes | float | bytes | Cumulative count of bytes transmitted in the node. | -| kube.node.network.tx_errors | integer | | Cumulative count of transmit errors encountered in the node. | - -| Metric | Metric Type | Metric Format | Metric Descrioption | -| --- | --- | --- | --- | -| kube.node.fs.available_bytes | float | bytes | Represents the storage space -available, in bytes, for the filesystem on the node. | -| kube.node.fs.capacity_bytes | float | bytes | Represents the total capacity, -in bytes, of the filesystems underlying storage on the node. | -| kube.node.fs.used_bytes | float | bytes | Represents the bytes used for a specific -task on the filesystem on the node. | -| kube.node.fs.inodes_free | integer | | InodesFree represents the free inodes in the filesystem on the node. | -| kube.node.fs.inodes | integer | | Inodes represents the total inodes in the filesystem on the node. | -| kube.node.fs.inodes_used | integer | | Represents the inodes used by the filesystem on the node. | -| kube.node.imagefs.available_bytes | float | bytes | Represents the storage space available, in -bytes, for the filesystem on the node. | -| kube.node.imagefs.capacity_bytes | float | bytes | Represents the total capacity, in bytes, of -the filesystems underlying storage on the node. | -| kube.node.imagefs.used_bytes | float | bytes | Represents the bytes used for a specific task -on the filesystem on the node. | -| kube.node.imagefs.inodes_free | integer | | InodesFree represents the free inodes in the filesystem on the node. -| kube.node.imagefs.inodes | integer | | Inodes represents the free inodes in the filesystem on the node. | -| kube.node.imagefs.inodes_used | integer | | Inodes represents the free inodes in the filesystem on the node. | -| kube.node.runtime.imagefs.maxpid | integer | | The max PID of OS | -| kube.node.runtime.imagefs.curproc | integer | | The number of running process in the OS | -| kube.sys-container.uptime | float | seconds | Sys container's uptime | -| kube.sys-container.cpu.usage_rate | float | millicpu | Total CPU usage (sum of all cores) averaged over the -sample window for sys-container. | -| kube.sys-container.cpu.usage | float | millicpu | Total CPU usage rate (sum of all cores) averaged over the -sample window for sys-container. | -| kube.sys-container.memory.available_bytes | float | bytes | Represents the storage space -available, in bytes, for the filesystem for sys-container. | -| kube.sys-container.memory.usage_bytes |float |bytes |Node's memory in use in bytes for sys-container. | -| kube.sys-container.memory.rss_bytes | float | bytes | The amount of anonymous and swap cache memory. -in bytes, for sys-container. | -| kube.sys-container.memory.rss_bytes | float | bytes | The amount of anonymous and swap cache memory, -in bytes, for sys-container. -| kube.sys-container.memory.page_faults | integer | | Cumulative number of minor page faults for sys-container. | -| kube.sys-container.memory.major_page_faults | integer | | Cumulative number of major page faults for sys-container. | -| kube.pod.uptime |float |seconds |Pod's uptime. | -| kube.pod.cpu.usage_rate | float | millicpu | Total CPU usage (sum of all cores) averaged over the sample window -for the pod. | -| kube.pod.cpu.usage | float | nanocpu | Total CPU usage rate (sum of all cores) averaged over the sample window -for the pod. | -| kube.pod.memory.available_bytes | float | bytes | Represents the storage space -available, in bytes, for the filesystem for the pod. | -| kube.pod.memory.usage_bytes | float | bytes | Represents the bytes used for a specific -task on the filesystem for the pod. | -| kube.pod.memory.rss_bytes | float | bytes | The amount of anonymous and swap cache memory. in bytes, for the pod. | -| kube.pod.memory.page_faults | integer | | Cumulative number of minor page faults for the pod. | -| kube.pod.memory.major_page_faults | integer | | Cumulative number of minor page faults for the pod. | -| kube.pod.network.rx_bytes | float | bytes | Cumulative count of bytes received for the pod. | -| kube.pod.network.rx_errors | integer | | Cumulative count of receive errors encountered for the pod. | -| kube.pod.network.tx_bytes | float | bytes | Cumulative count of bytes transmitted for the pod. | -| kube.pod.network.tx_errors | integer | | Cumulative count of transmit errors encountered for the pod. | -| kube.pod.ephemeral-storage.available_bytes | float | bytes | Node's available memory for use in bytes for -the pod's ephemeral storage. | -| kube.pod.ephemeral-storage.capacity_bytes | float | bytes | Represents the total capacity, -in bytes, of the filesystems underlying storage for the pod's ephemeral storage. | -| kube.pod.ephemeral-storage.used_bytes | float | bytes | Represents the bytes used for a specific -task on the filesystem for the pod's ephemeral storage. | -| kube.pod.ephemeral-storage.inodes_free |integer | |InodesFree represents the free inodes in the filesystem -for the pod's ephemeral storage. | -| kube.pod.ephemeral-storage.inodes | integer | | Represents the inodes in the filesystem for -the pod's ephemeral storage. | -| kube.pod.ephemeral-storage.inodes_used | integer | | Represents the used inodes in the filesystem -for the pod's ephemeral storage. | -| kube.pod.volume.available_bytes | float | bytes | Represents the storage space available, -In bytes, for the filesystem for the pod's volume. | -| kube.pod.volume.capacity_bytes | float | bytes | Represents the total capacity, in bytes, of -the filesystems underlying storage for the pod's volume. | -| kube.pod.volume.used_bytes | float | bytes | UsedBytes represents the bytes used for a specific task on the -filesystem for the pod's volume. | -| kube.pod.volume.inodes_free | integer | | InodesFree represents the free inodes in the filesystem for the pod's volume. | -| kube.pod.volume.inodes | integer | | Represents the inodes in the filesystem for the pod's volume. | -| kube.pod.volume.inodes_used | integer | | Represents the used inodes in the filesystem for the pod's volume. | -| kube.container.uptime | float | seconds | Container's uptime | -| kube.container.cpu.usage_rate | float | millicpu | Total CPU usage rate (sum of all cores) averaged over the sample -window for the container. | -| kube.container.cpu.usage | float | nanocpu | Total CPU usage rate (sum of all cores) averaged over the sample window -for the container. | -| kube.container.memory.available_bytes | float | bytes | AvailableBytes represents the storage space available, in bytes, -for the filesystem for the container. | -| kube.container.memory.usage_bytes | float | bytes | UsedBytes represents the bytes used for a specific task -on the filesystem for the container. | -| kube.container.memory.rss_bytes | float | bytes | The amount of anonymous and swap cache memory in bytes for the container. | -| kube.container.memory.page_faults | integer | |Cumulative number of minor page faults for the container. | -| kube.container.memory.major_page_faults |integer | |Cumulative number of major page faults for the container. | -| kube.container.rootfs.available_bytes |float |bytes |Represents the storage space available, in bytes, for -the filesystem for the container's rootfs. | -| kube.container.rootfs.capacity_bytes | float | bytes | Represents the total capacity (bytes) of the filesystems -underlying storage for the container's rootfs. | -| kube.container.rootfs.used_bytes | float | bytes | UsedBytes represents the bytes used for a specific task on -the filesystem for the container's rootfs. | -| kube.container.rootfs.inodes_free | integer | | Represents the free inodes in the filesystem for the container's rootfs. | -| kube.container.rootfs.inodes | integer | | Inodes represents the inodes in the filesystem for the container's rootfs. | -| kube.container.rootfs.inodes_used | integer | | Represents the used inodes in the filesystem for the container's rootfs. | -| kube.container.logs.available_bytes | float | bytes AvailableBytes represents the storage space available, in bytes, -for the filesystem for the container's logs. | -| kube.container.logs.capacity_bytes | float | bytes | Represents the total capacity (bytes) of the filesystems -underlying storage for the container's logs. | -| kube.container.logs.used_bytes | float | bytes | UsedBytes represents the bytes used for a specific task on the -filesystem for the container's logs. | -| kube.container.logs.inodes_free | integer | | Represents the free inodes in the filesystem for the container's logs. | -| kube.container.logs.inodes | integer | | Represents the inodes in the filesystem for the container's logs. | -| kube.container.logs.inodes_used | integer | | Represents the used inodes in the filesystem for the container's logs. | - - -Stats Metrics -| Metric Name | Metric Type | Metric Format | Metric Description | -| --- | --- | --- | --- | -| kube.node.cpu.cfs.periods | ThrottlingData | uint64 | Cpu Completely Fair Scheduler statistics; -Total number of elapsed enforcement intervals. | -| kube.node.cpu.cfs.throttled_periods | ThrottlingData | uint64 | Cpu Completely Fair Scheduler statistics; Total -number of times tasks in the cgroup have been throttled. | -| kube.node.cpu.cfs.throttled_time | ThrottlingData | uint64 | Cpu Completely Fair Scheduler statistics; Total time -duration, in nanoseconds, for which tasks in the cgroup have been throttled. | -| kube.node.cpu.usage.total | CPUUsage | uint64 | CPU usage time statistics in nanoseconds. | -| per_cpu_usage | CPUUsage | []uint64 | CPU usage time statistics. Per CPU/core usage of the container in nanoseconds. | -| kube.node.cpu.usage.user | CPUUsage | uint64 | CPU usage time statistics. Time spent in user space in nanoseconds. | -| kube.node.cpu.usage.system | CPUUsage | uint64 | CPU usage time statistics. Time spent in kernel space in nanoseconds. | -| kube.node.cpu.load_average | | | Smoothed average of number of runnable threads x 1000. Splunk software multiplies by -a thousand to avoid using floats while preserving precision. Load is smoothed over the last 10 seconds. Instantaneous value can be read from LoadStats.NrRunning. | -| kube.node.cpu.schedstat.run_time | | | Cpu Aggregated scheduler statistics; time spent on the cpu. | -| kube.node.cpu.schedstat.runqueue_time | | | Cpu Aggregated scheduler statistics; time spent waiting on a runqueue. | -| kube.node.cpu.schedstat.run_periods | | | Cpu Aggregated scheduler statistics; # of timeslices run on this cpu reservation -| kube.node.diskio..stats.Async | | | No Description in code | -| kube.node.diskio..stats.Read | | | No Description in code | -| kube.node.diskio..Sync | | | No Description in code | -| kube.node.diskio..stats.Total | | | No Description in code | -| kube.node.diskio..stats.Write| | | No Description in code | -| kube.node.diskio..minor | | | No Description in code | -| kube.node.diskio..major | | | No Description in code | -| kube.node.filesystem.available | | | Number of bytes available for non-root user. | -| kube.node.filesystem.base_usage | | | Base Usage that is consumed by the container's writable layer. This field is -only applicable for docker container's as of now. | -| kube.node.filesystem.capacity | | | Number of bytes that can be consumed by the container on this filesystem. | -| kube.node.filesystem.inodes | | | Number of Inodes | -| kube.node.filesystem.inodes_free | | | Number of available Inodes | -| kube.node.filesystem.io_in_progress | | | Number of I/Os currently in progress. It is the only field that -should go to zero. Value is incremented as requests are given to appropriate struct request_queue and decremented -as they finish. | -| kube.node.filesystem.io_time | | | Number of milliseconds spent doing I/Os. This field increases so long as field -9 is nonzero. | -| kube.node.filesystem.read_time | | | Number of milliseconds spent reading - total number of milliseconds spent -by all reads (as measured from __make_request() to end_that_request_last()). | -| kube.node.filesystem.reads_completed | | | The total number of reads completed successfully. | -| kube.node.filesystem.reads_merged | | | Number of reads merged; Reads and writes which are adjacent to each other -and may be merged for efficiency. For example, two 4K reads may become one 8K read before it is ultimately handed to -the disk, and so it will be counted (and queued) as only one I/O. This field lets you know how often this was done. | -| kube.node.filesystem.sectors_read | | | Total number of sectors successfully read. | -| kube.node.filesystem.sectors_written | | | This is the total number of sectors successfully written. | -| kube.node.filesystem.usage | | | Number of bytes that is consumed by the container on this filesystem. | -| kube.node.filesystem.weighted_io_time | | | Weighted number of milliseconds spent doing I/Os. This field is -incremented at each I/O start, I/O completion, I/O merge. Or the field can read of these stats by the number of I/Os in progress (field 9) times the number of milliseconds spent doing I/O since the last update of this field. This can provide an -easy measure of both I/O completion time and the backlog that may be accumulating. | -| kube.node.filesystem.write_time | | | Total number of milliseconds spent by all writes, as measured -from __make_request() to end_that_request_last(). | -| kube.node.filesystem.writes_completed | | | Total number of writes completed successfully. | -| kube.node.filesystem.writes_merged | | | Number of writes merged. | -| kube.node.memory.cache | | | Number of bytes of page cache memory in bytes. | -| kube.node.memory.container_data.pgfault | | | No Description in code. | -| kube.node.memory.container_data.pgmajfault | | | No Description in code | -| kube.node.memory.failcnt | | | No Description in code | -| kube.node.memory.hierarchical_data.pgfault | | | No Description in code | -| kube.node.memory.hierarchical_data.pgmajfault | | | No Description in code | -| kube.node.memory.max_usage | | | Maximum memory usage recorded in bytes. | -| kube.node.memory.rss | | | The amount of anonymous and swap cache memory (includes transparent -hugepages) in bytes. -| kube.node.memory.swap | | | The amount of swap, in bytes, currently used by the processes in this cgroup. | -| kube.node.memory.usage | | | Current memory usage, in bytes. This includes all memory regardless of when it was accessed. | -| kube.node.memory.working_set | | | The amount of working set memory in bytes. This includes recently accessed memory, -dirty memory, and kernel memory. Working set is <= "usage". | -| kube.node.memory.mapped_file | | | | -| kube.node.tasks_stats.nr_io_wait | | | Number of tasks waiting on IO. | -| kube.node.tasks_stats.nr_running | | | Number of running tasks. | -| kube.node.tasks_stats.nr_sleeping | | | Number of sleeping tasks. | -| kube.node.tasks_stats.nr_stopped | | | Number of tasks in stopped state. | -| kube.node.tasks_stats.nr_uninterruptible | | | Number of tasks in uninterruptible state. | -| kube.node.network..rx_bytes | | | Cumulative count of bytes received. | -| kube.node.network..rx_dropped | | | Cumulative count of packets dropped while receiving. | -| kube.node.network..rx_errors | | | Cumulative count of receive errors encountered. | -| kube.node.network..rx_packets | | | Cumulative count of packets received. | -| kube.node.network..tx_bytes | | | Cumulative count of bytes transmitted. | -| kube.node.network..tx_dropped | | | Cumulative count of packets dropped while transmitting. | -| kube.node.network..tx_errors | | | Cumulative count of transmit errors encountered. | -| kube.node.network..tx_packets | | | Cumulative count of packets transmitted. | - - - - -# Cadvisor Metrics - -| Metric Name | Metric Description | -| cadvisor_version_info | A metric with a constant '1' value labeled by kernel version, OS version, docker version, -cadvisor version & cadvisor revision. | -| container_cpu_load_average_10s | Value of container cpu load average over the last 10 seconds. | -| container_cpu_system_seconds_total | Cumulative system cpu time consumed in seconds. | -| container_cpu_usage_seconds_total | Cumulative cpu time consumed in seconds. | -| container_cpu_user_seconds_total | Cumulative user cpu time consumed in seconds. | -| container_fs_inodes_free | Number of available Inodes. | -| container_fs_inodes_total | Number of Inodes in use. | -| container_fs_io_current | Number of I/Os currently in progress. | -| container_fs_io_time_seconds_total | Cumulative count of seconds spent doing I/Os. | -| container_fs_io_time_weighted_seconds_total | Cumulative weighted I/O time in seconds. | -| container_fs_limit_bytes | Number of bytes that can be consumed by the container on this filesystem. | -| container_fs_read_seconds_total | Cumulative count of seconds spent reading. | -| container_fs_reads_bytes_total | Cumulative count of bytes read. | -| container_fs_reads_merged_total | Cumulative count of reads merged. | -| container_fs_reads_total | Cumulative count of reads completed. | -| container_fs_sector_reads_total | Cumulative count of sector writes completed. | -| container_fs_sector_writes_total | Number of bytes that are consumed by the container on this filesystem. | -| container_fs_usage_bytes | Cumulative count of seconds spent writing. | -| container_fs_write_seconds_total | Cumulative count of bytes written. | -| container_fs_writes_bytes_total | Cumulative count of writes merged. | -| container_fs_writes_merged_total | Cumulative count of writes completed. | -| container_fs_writes_total | Last time a container was seen by the exporter. | -| container_last_seen | Last time a container was seen by the exporter. | -| container_memory_cache | Number of bytes of page cache memory. | -| container_memory_failcnt | Number of memory usage hits limits. | -| container_memory_failures_total | Cumulative count of memory allocation failures. | -| container_memory_max_usage_bytes | Maximum memory usage recorded in bytes. | -| container_memory_rss | Size of RSS in bytes. | -| container_memory_swap | Container swap usage in bytes. | -| container_memory_usage_bytes | Current memory usage in bytes, including all memory regardless of when it was accessed. | -| container_memory_working_set_bytes | Current working set in bytes. | -| container_network_receive_bytes_total | Cumulative count of bytes received. | -| container_network_receive_errors_total | Cumulative count of errors encountered while receiving. | -| container_network_receive_packets_dropped_total | Cumulative count of packets dropped while receiving. | -| container_network_receive_packets_total | Cumulative count of packets received. | -| container_network_tcp_usage_total | tcp connection usage statistic for container. | -| container_network_transmit_bytes_total | Cumulative count of bytes transmitted. | -| container_network_transmit_errors_total | Cumulative count of errors encountered while transmitting. | -| container_network_transmit_packets_dropped_total | Cumulative count of packets dropped while transmitting. | -| container_network_transmit_packets_total | Cumulative count of packets transmitted. | -| container_network_udp_usage_total | udp connection usage statistic for container. | -| container_scrape_error | 1 if there was an error while getting container metrics, 0 otherwise. | -| container_spec_cpu_period | CPU period of the container. | -| container_spec_cpu_shares | CPU share of the container. | -| container_spec_memory_limit_bytes | Memory limit for the container. | -| container_spec_memory_reservation_limit_bytes | Memory reservation limit for the container. | -| container_spec_memory_swap_limit_bytes | Memory swap limit for the container. | -| container_start_time_seconds | Start time of the container since unix epoch in seconds. | -| container_tasks_state | Number of tasks in given state. | -| machine_cpu_cores | Number of CPU cores on the machine. | -| machine_memory_bytes | Amount of memory installed on the machine. | -| container_cpu_cfs_throttled_seconds_total | Total time duration the container has been throttled. | - - - From 4ba236ae430a52207c3ca82daeb3b98a3e9a3439 Mon Sep 17 00:00:00 2001 From: JENNIFER WORTHINGTON <37708067+jenworthington@users.noreply.github.com> Date: Wed, 6 Mar 2019 14:41:14 -0800 Subject: [PATCH 04/10] Update metrics-information.md updayes --- metrics-information.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/metrics-information.md b/metrics-information.md index 822f120..7af7631 100644 --- a/metrics-information.md +++ b/metrics-information.md @@ -6,7 +6,7 @@ | --- | --- | | Node | A single machine in a kubernetes cluster | | imagefs | Stats for the underlying filesystem where container images are stored. Usage here refers to the total number of bytes occupied by images on the filesystem. | -| fs | Stats pertaining to total usage of filesystem resources on the rootfs used by node k8s components. | +| fs | Stats pertaining to total usage of filesystem resources on the rootfs used by node Kubernetes components. | | sys-container | Stats for system daemons tracked as raw containers. | | runtime | Stats for the underlying container runtime. | | volume | Stats for volume usage of filesystem resources. | @@ -16,7 +16,9 @@ Reference: https://github.com/kubernetes/kubernetes/blob/master/pkg/kubelet/apis/stats/v1alpha1/types.go -## Aggregator Metrics +## Aggregated Metrics + +Metrics based on values extracted from aggregated files and field data. | Metric Name | Metric Type | Metric Format | Metric Description | | --- | --- | --- | --- | @@ -52,6 +54,8 @@ ## Summary Metrics +Provides a total count of observations and as a sum of all observed values. + | Metric Name | Metric Type | Metric Format | Metric Description | | --- | --- | --- | --- | | kube.node.uptime | float | seconds | The node uptime. | @@ -138,6 +142,9 @@ for the container. | ## Stats Metrics +Metrics based on measures and recording of data points and views. + + | Metric Name | Metric Type | Metric Format | Metric Description | | --- | --- | --- | --- | | kube.node.cpu.cfs.periods | ThrottlingData | uint64 | CPU Completely Fair Scheduler statistics. Total number of elapsed enforcement intervals. | @@ -202,6 +209,8 @@ for the container. | | kube.node.network..tx_packets | | | Cumulative count of packets transmitted. | ## Cadvisor Metrics + + cAdvisor provides performance and usage information for running containers. | Metric Name | Metric Description | | --- | --- | From 8ed23a75f0c2ee2d272537317d1bfd42179ebfd8 Mon Sep 17 00:00:00 2001 From: gp510 Date: Tue, 30 Apr 2019 11:38:18 -0700 Subject: [PATCH 05/10] Adding issue templates (#46) --- .github/ISSUE_TEMPLATE/bug_report.md | 29 +++++++++++++++++++ .github/ISSUE_TEMPLATE/enhancement_request.md | 14 +++++++++ .github/ISSUE_TEMPLATE/failing_test.md | 18 ++++++++++++ 3 files changed, 61 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/enhancement_request.md create mode 100644 .github/ISSUE_TEMPLATE/failing_test.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..b9687d5 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,29 @@ +--- +name: Bug report +about: Report a bug encountered while operating fluent-plugin-kubernetes-metrics +title: '' +labels: '' +assignees: '' + +--- + + + + +**What happened**: + +**What you expected to happen**: + +**How to reproduce it (as minimally and precisely as possible)**: + +**Anything else we need to know?**: + +**Environment**: +- Kubernetes version (use `kubectl version`): +- Ruby version (use `ruby --version`): +- OS (e.g: `cat /etc/os-release`): +- Splunk version: +- Others: diff --git a/.github/ISSUE_TEMPLATE/enhancement_request.md b/.github/ISSUE_TEMPLATE/enhancement_request.md new file mode 100644 index 0000000..420b92f --- /dev/null +++ b/.github/ISSUE_TEMPLATE/enhancement_request.md @@ -0,0 +1,14 @@ +--- +name: Enhancement Request +about: Suggest an enhancement to the fluent-plugin-kubernetes-metrics project +title: '' +labels: '' +assignees: '' + +--- + +< + +**What would you like to be added**: + +**Why is this needed**: diff --git a/.github/ISSUE_TEMPLATE/failing_test.md b/.github/ISSUE_TEMPLATE/failing_test.md new file mode 100644 index 0000000..3b3a2ee --- /dev/null +++ b/.github/ISSUE_TEMPLATE/failing_test.md @@ -0,0 +1,18 @@ +--- +name: Failing Test +about: Report test failures in fluent-plugin-kubernetes-metrics +title: '' +labels: '' +assignees: '' + +--- + + + +**Which test(s) are failing**: + +**Since when has it been failing**: + +**Reason for failure**: + +**Anything else we need to know**: From 8f41761104b5a519feb1b260c7c5f36824e480fb Mon Sep 17 00:00:00 2001 From: Peter Wu Date: Thu, 9 May 2019 17:58:00 -0700 Subject: [PATCH 06/10] SII-4119: Stop Kubernetes nodes from showing up as the address used to connect to Kubelet * Add kubelet_address as an alternative address to use to connect to Kubelet in place of node_name. - This relates to ADDON-21681 --- README.md | 8 +++++++- lib/fluent/plugin/in_kubernetes_metrics.rb | 9 ++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2276c35..d9b1a48 100644 --- a/README.md +++ b/README.md @@ -97,9 +97,15 @@ The name of the node from which the plugin should collect metrics. This enables Array of the nodes from which the this plugin should collect metrics. This enables the plugin to fetch metrics from kubeapiserver. Used only when use_rest_client configuration parameter is not enabled. +### kubelet_address (string) (optional) + +The address that Kubelet is on. This can be a hostname or an IP address. If this is not provided, node_name is used to fetch metrics from the Kubelet API. + +Default value: `nil`. + ### kubelet_port (integer) (optional) -The port that kubelet is listening to. +The port that kubelet is listening on. Default value: `10250`. diff --git a/lib/fluent/plugin/in_kubernetes_metrics.rb b/lib/fluent/plugin/in_kubernetes_metrics.rb index fb7c835..46fc079 100644 --- a/lib/fluent/plugin/in_kubernetes_metrics.rb +++ b/lib/fluent/plugin/in_kubernetes_metrics.rb @@ -61,6 +61,9 @@ class KubernetesMetricsInput < Fluent::Plugin::Input desc 'Name of the nodes that this plugin should collect metrics from.' config_param :node_names, :array, default: [], value_type: :string + desc 'The hostname or IP address that kubelet will use to connect to. If not supplied, node_name will be used instead.' + config_param :kubelet_address, :string, default: nil + desc 'The port that kubelet is listening to.' config_param :kubelet_port, :integer, default: 10_250 @@ -193,7 +196,11 @@ def initialize_client end def initialize_rest_client - env_host = @node_name + if @kubelet_address.nil? + env_host = @node_name + else + env_host = @kubelet_address + end env_port = @kubelet_port if env_host && env_port From 0f92c3f42911b720ea2f57c9e6b4515f2f1a3075 Mon Sep 17 00:00:00 2001 From: gp510 Date: Fri, 31 May 2019 16:59:32 -0700 Subject: [PATCH 07/10] Separating out CLA and adding PR template --- .github/PULL_REQUEST_TEMPLATE.md | 23 +++++++++++++++++++++++ CLA.md | 18 ++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 CLA.md diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..db8477e --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,23 @@ +## Proposed changes + +Describe the big picture of your changes here to communicate to the maintainers why we should accept this pull request. If it fixes a bug or resolves a feature request, be sure to link to that issue. + +## Types of changes + +What types of changes does your code introduce? +_Put an `x` in the boxes that apply_ + +- [ ] Bugfix (non-breaking change which fixes an issue) +- [ ] New feature (non-breaking change which adds functionality) +- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) + +## Checklist + +_Put an `x` in the boxes that apply._ + +- [ ] I have read the [CONTRIBUTING](https://github.com/splunk/fluent-plugin-kubernetes-metrics/blob/develop/CONTRIBUTING.md) doc +- [ ] I have read the [CLA](https://github.com/splunk/fluent-plugin-kubernetes-metrics/blob/develop/CLA.md) +- [ ] I have added tests that prove my fix is effective or that my feature works +- [ ] I have added necessary documentation (if appropriate) +- [ ] Any dependent changes have been merged and published in downstream modules + diff --git a/CLA.md b/CLA.md new file mode 100644 index 0000000..8964061 --- /dev/null +++ b/CLA.md @@ -0,0 +1,18 @@ +By submitting a Contribution to this Work, You agree that Your Contribution is made subject to the primary LICENSE +file applicable to this Work. In addition, You represent that: (i) You are the copyright owner of the Contribution +or (ii) You have the requisite rights to make the Contribution. + +Definitions: + +“You” shall mean: (i) yourself if you are making a Contribution on your own behalf; or (ii) your company, +if you are making a Contribution on behalf of your company. If you are making a Contribution on behalf of your +company, you represent that you have the requisite authority to do so. + +"Contribution" shall mean any original work of authorship, including any modifications or additions to an existing +work, that is intentionally submitted by You for inclusion in, or documentation of, this project/repository. For the +purposes of this definition, "submitted" means any form of electronic, verbal, or written communication submitted for +inclusion in this project/repository, including but not limited to communication on electronic mailing lists, source +code control systems, and issue tracking systems that are managed by, or on behalf of, the maintainers of +the project/repository. + +“Work” shall mean the collective software, content, and documentation in this project/repository. From 48f3f6fa1aebf8d1e06c22ef7b67e3c548be16ce Mon Sep 17 00:00:00 2001 From: Peter Wu Date: Mon, 3 Jun 2019 16:04:05 -0700 Subject: [PATCH 08/10] SII-4119: Set default kubelet_address to "#{ENV['KUBERNETES_NODE_IP']}" - As per cphalak's PR comment, this should be the default case for all users. --- README.md | 4 ++-- lib/fluent/plugin/in_kubernetes_metrics.rb | 10 +++------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index d9b1a48..b87869c 100644 --- a/README.md +++ b/README.md @@ -99,9 +99,9 @@ Array of the nodes from which the this plugin should collect metrics. This enabl ### kubelet_address (string) (optional) -The address that Kubelet is on. This can be a hostname or an IP address. If this is not provided, node_name is used to fetch metrics from the Kubelet API. +The hostname or IP address that kubelet will use to connect to. If not supplied, status.hostIP of the node is used to fetch metrics from the Kubelet API (via the $KUBERNETES_NODE_IP environment variable). -Default value: `nil`. +Default value: `"#{ENV['KUBERNETES_NODE_IP']}"`. ### kubelet_port (integer) (optional) diff --git a/lib/fluent/plugin/in_kubernetes_metrics.rb b/lib/fluent/plugin/in_kubernetes_metrics.rb index 46fc079..13118de 100644 --- a/lib/fluent/plugin/in_kubernetes_metrics.rb +++ b/lib/fluent/plugin/in_kubernetes_metrics.rb @@ -61,8 +61,8 @@ class KubernetesMetricsInput < Fluent::Plugin::Input desc 'Name of the nodes that this plugin should collect metrics from.' config_param :node_names, :array, default: [], value_type: :string - desc 'The hostname or IP address that kubelet will use to connect to. If not supplied, node_name will be used instead.' - config_param :kubelet_address, :string, default: nil + desc 'The hostname or IP address that kubelet will use to connect to. If not supplied, status.hostIP of the node is used to fetch metrics from the Kubelet API (via the $KUBERNETES_NODE_IP environment variable)' + config_param :kubelet_address, :string, default: "#{ENV['KUBERNETES_NODE_IP']}" desc 'The port that kubelet is listening to.' config_param :kubelet_port, :integer, default: 10_250 @@ -196,11 +196,7 @@ def initialize_client end def initialize_rest_client - if @kubelet_address.nil? - env_host = @node_name - else - env_host = @kubelet_address - end + env_host = @kubelet_address env_port = @kubelet_port if env_host && env_port From 1f5dee804eadffa9d35838814dddb12bf9f282d1 Mon Sep 17 00:00:00 2001 From: Chaitanya Phalak Date: Wed, 5 Jun 2019 09:33:08 -0700 Subject: [PATCH 09/10] SII patch fix unit tests --- test/plugin/test_in_kubernetes_metrics.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/plugin/test_in_kubernetes_metrics.rb b/test/plugin/test_in_kubernetes_metrics.rb index eb9c54d..3b2431d 100644 --- a/test/plugin/test_in_kubernetes_metrics.rb +++ b/test/plugin/test_in_kubernetes_metrics.rb @@ -19,6 +19,7 @@ class KubernetesMetricsInputTest < Test::Unit::TestCase use_rest_client true use_rest_client_ssl false kubelet_port 10_255 + kubelet_address generics-aws-node-name ).freeze SUMMARY_CONFIG = %( @@ -30,6 +31,7 @@ class KubernetesMetricsInputTest < Test::Unit::TestCase use_rest_client false use_rest_client_ssl false kubelet_port 10_255 + kubelet_address generics-aws-node-name ).freeze setup do From 775a349032cdd1c54feca82af0d3f1c9e5e4fc7e Mon Sep 17 00:00:00 2001 From: Chaitanya Phalak Date: Mon, 10 Jun 2019 12:45:41 -0700 Subject: [PATCH 10/10] metrics 1.1.1 release prep --- .circleci/build_and_push_to_dockerhub.sh | 2 +- VERSION | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/build_and_push_to_dockerhub.sh b/.circleci/build_and_push_to_dockerhub.sh index 61a15af..b6b065b 100755 --- a/.circleci/build_and_push_to_dockerhub.sh +++ b/.circleci/build_and_push_to_dockerhub.sh @@ -3,7 +3,7 @@ set -e echo "Building docker image..." cp /tmp/pkg/fluent-plugin-kubernetes-metrics-*.gem docker VERSION=`cat VERSION` -docker build --build-arg VERSION=$VERSION --no-cache -t splunk/fluent-plugin-kubernetes-metrics:ci ./docker +docker build --build-arg VERSION=$FLUENT_SPLUNK_HEC_GEM_VERSION --no-cache -t splunk/fluent-plugin-kubernetes-metrics:ci ./docker docker tag splunk/fluent-plugin-kubernetes-metrics:ci splunk/${DOCKERHUB_REPO_NAME}:${VERSION} echo "Push docker image to splunk dockerhub..." docker login --username=$DOCKERHUB_ACCOUNT_ID --password=$DOCKERHUB_ACCOUNT_PASS diff --git a/VERSION b/VERSION index 1cc5f65..8cfbc90 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.1.0 \ No newline at end of file +1.1.1 \ No newline at end of file