github.com/timstclair/heapster@v0.20.0-alpha1/docs/storage-schema.md (about) 1 ## Metrics 2 3 Heapster exports the following metrics to its backends. 4 5 | Metric Name | Description | Type | Units | Supported Since | 6 |--------------------------|----------------------------------------------------------------------------------------------------|------------|--------------|-----------------| 7 | uptime | Number of millisecond since the container was started | Cumulative | Milliseconds | v0.9 | 8 | cpu/usage | Cumulative CPU usage on all cores | Cumulative | Nanoseconds | v0.9 | 9 | memory/usage | Total memory usage | Gauge | Bytes | v0.9 | 10 | memory/working_set | Total working set usage. Working set is the memory being used and not easily dropped by the Kernel | Gauge | Bytes | v0.9 | 11 | memory/page_faults | Total number of page faults | Cumulative | Count | v0.9 | 12 | memory/major_page_faults | Number of major page faults | Cumulative | Count | HEAD | 13 | network/rx | Cumulative number of bytes received over the network | Cumulative | Bytes | v0.9 | 14 | network/rx_errors | Cumulative number of errors while receiving over the network | Cumulative | Count | v0.9 | 15 | network/tx | Cumulative number of bytes sent over the network | Cumulative | Bytes | v0.9 | 16 | network/tx_errors | Cumulative number of errors while sending over the network | Cumulative | Count | v0.9 | 17 | filesystem/usage | Total number of bytes used on a filesystem identified by label 'resource_id' | Gauge | Bytes | v0.11.0 | 18 19 *Note: Gauge refers to instantaneous metrics* 20 21 ## Labels 22 23 Heapster tags each metric with the following labels. 24 25 | Label Name | Description | Supported Since | Kubernetes specific | 26 |----------------|-------------------------------------------------------------------------------|-----------------|---------------------| 27 | pod_id | Unique ID of a Pod | v0.9 | Yes | 28 | pod_name | User-provided name of a Pod | v0.13 | Yes | 29 | pod_namespace | The namespace of a Pod | v0.10 | Yes | 30 | container_name | User-provided name of the container or full cgroup name for system containers | v0.9 | No | 31 | labels | Comma-separated list of user-provided labels. Format is 'key:value' | v0.9 | Yes | 32 | hostname | Hostname where the container ran | v0.9 | No | 33 | namespace_id | UID of the namespace of a Pod | v0.14.1 | Yes | 34 | host_id | Cloud-provider specified or user specified Identifier of a node | v0.14.1 | Yes | 35 | resource_id | An unique identifier used to differentiate multiple metrics of the same type. e.x. Fs partitions under filesystem/usage | v0.11.0 | No | 36 37 38 ## Storage Schema 39 40 ### InfluxDB 41 42 Each metric translates to a separate 'series' in InfluxDB. Labels are stored as additional columns. 43 The series name is constructed by combining the metric name with its type and units: "metric Name"_"units"_"type". 44 45 ###### Query 46 `list series` 47 48 ###### Output 49 50 ``` 51 cpu/usage_ns_cumulative 52 filesystem/usage 53 memory/page_faults_gauge 54 memory/usage_bytes_gauge 55 memory/working_set_bytes_gauge 56 network/rx_bytes_cumulative 57 network/rx_errors_cumulative 58 network/tx_bytes_cumulative 59 network/tx_errors_cumulative 60 uptime_ms_cumulative 61 ``` 62 63 *Note: Unit 'Count' is ignored* 64 65 Heapster adds timestamp and sequence number to every metric. 66 67 ### Google Cloud Monitoring 68 69 Metrics mentioned above are stored along with corresponding labels as [custom metrics](https://cloud.google.com/monitoring/custom-metrics/) in Google Cloud Monitoring. 70 71 * Metrics are collected every 2 minutes by default and pushed with a 1 minute precision. 72 * Each metric has a custom metric prefix - `custom.cloudmonitoring.googleapis.com` 73 * Each metric is pushed with an additonal namespace prefix - `kubernetes.io`. 74 * GCM does not support visualizing cumulative metrics yet. To work around that, heapster exports an equivalent gauge metric for all cumulative metrics mentioned above. 75 76 The gauge metrics use their parent cumulative metric name as the prefix, followed by a "_rate" suffix. 77 E.x.: "cpu/usage", which is cumulative, will have a corresponding gauge metric "cpu/usage_rate" 78 NOTE: The gauge metrics will be deprecated as soon as GCM supports visualizing cumulative metrics. 79 80 TODO: Add a snapshot of all the metrics stored in GCM. 81 82 ### Hawkular 83 84 Each metric is stored as separate timeseries (metric) in Hawkular-Metrics with tags being inherited from common ancestor type. The metric name is created with the following format: `containerName/podId/metricName` (`/` is separator). Each definition stores the labels as tags with following addons: 85 86 * All the Label descriptions are stored as label_description 87 * The ancestor metric name (such as cpu/usage) is stored under the tag `descriptor_name` 88 * To ease search, a tag with `group_id` stores the key `containerName/metricName` so each podId can be linked under a single timeseries if necessary. 89 * Units are stored under `units` tag 90 * If labelToTenant parameter is given, any metric with the label will use this label's value as the target tenant. If the metric doesn't have the label defined, default tenant is used. 91 92 At the start, all the definitions are fetched from the Hawkular-Metrics tenant and filtered to cache only the Heapster metrics. It is recommended to use a separate tenant for Heapster information if you have lots of metrics from other systems, but not required. 93 94 The Hawkular-Metrics instance can be a standalone installation of Hawkular-Metrics or the full installation of Hawkular.