github.com/aclisp/heapster@v0.19.2-0.20160613100040-51756f899a96/docs/model.md (about)

     1  # Heapster Metric Model
     2  
     3  The Heapster Model is a structured representation of metrics for Kubernetes clusters, which is exposed through a set of REST API endpoints.
     4  It allows the extraction of up to 15 minutes of historical data for any Container, Pod, Node or Namespace in the cluster, as well as the cluster itself (depending on the metric).
     5  
     6  **Please bear in mind that this is not an official Kubernetes API, we will try to keep it stable but we don't guarantee that we won't change it in the future.**
     7  
     8  ## Usage
     9  
    10  The Heapster Model is enabled by default. The resolution of the model can be configured through
    11  the `-model_resolution` flag, which will cause the model to store historical data at the specified resolution. If the `-model_resolution` flag is not specified, the default resolution of 30 seconds will be used.
    12  
    13  ## API documentation
    14  
    15  A detailed documentation of each API endpoint is listed below. 
    16  
    17  All endpoints ending in `/metrics/{metric-name}/` can accept the optional `start` and `end` query parameters 
    18  that represent the start and end time of the requested timeseries. The result
    19  will be a list of (Timestamp, Value) pairs in the time range [start, end].
    20  `start` and `end` are strings formatted according to RFC3339. If `start` is not
    21  defined, it is assumed as the zero Unix epoch time. If `end` is not defined,
    22  then all data later than `start` will be returned.
    23  
    24  ### Cluster-level Metrics
    25  
    26  `/api/v1/model/metrics/`: Returns a list of available cluster-level metrics.
    27  
    28  `/api/v1/model/metrics/{metric-name}?start=X&end=Y`: Returns a set of (Timestamp, Value) 
    29  pairs for the requested cluster-level metric, between the time range specified by `start` and `end`. 
    30  
    31  ### Node-level Metrics
    32  `/api/v1/model/nodes/`: Returns a list of all available nodes.
    33  
    34  `/api/v1/model/nodes/{node-name}/metrics/`: Returns a list of available
    35  node-level metrics.
    36  
    37  `/api/v1/model/nodes/{node-name}/metrics/{metric-name}?start=X&end=Y`: Returns a set of (Timestamp, Value) 
    38  pairs for the requested node-level metric, within the time range specified by `start` and `end`. 
    39  
    40  ### Namespace-level Metrics 
    41  `/api/v1/model/namespaces/`: Returns a list of all available namespaces.
    42  
    43  `/api/v1/model/namespaces/{namespace-name}/metrics/`: Returns a list of available namespace-level metrics.
    44  
    45  `/api/v1/model/namespaces/{namespace-name}/metrics/{metric-name}?start=X&end=Y`: Returns a set of (Timestamp, Value) 
    46  pairs for the requested namespace-level metric, within the time range specified by `start` and `end`. 
    47  
    48  
    49  ### Pod-level Metrics
    50  `/api/v1/model/namespaces/{namespace-name}/pods/`: Returns a list of all available pods under a given namespace.
    51  
    52  `/api/v1/model/namespaces/{namespace-name}/pods/{pod-name}/metrics/`: Returns a list of available pod-level metrics
    53  
    54  `/api/v1/model/namespaces/{namespace-name}/pods/{pod-name}/metrics/{metric-name}?start=X&end=Y`: Returns a set of (Timestamp, Value) 
    55  pairs for the requested pod-level metric, within the time range specified by `start` and `end`. 
    56  
    57  ### Container-level Metrics
    58  Container metrics and stats are accessible for both containers that belong to
    59  pods, as well as for free containers running in each node.
    60  
    61  `/api/v1/model/namespaces/{namespace-name}/pods/{pod-name}/containers/`: Returns a list of all available containers under a given pod.
    62  
    63  `/api/v1/model/namespaces/{namespace-name}/pods/{pod-name}/containers/{container-name}/metrics/`: Returns a list of available container-level metrics
    64  
    65  `/api/v1/model/namespaces/{namespace-name}/pods/{pod-name}/containers/{container-name}/metrics/{metric-name}?start=X&end=Y`: Returns a set of (Timestamp, Value) 
    66  pairs for the requested container-level metric, within the time range specified by `start` and `end`. 
    67  
    68  `/api/v1/model/nodes/{node-name}/freecontainers/`: Returns a list of all available free containers under a given node.
    69  
    70  `/api/v1/model/nodes/{node-name}/freecontainers/{container-name}/metrics/`: Returns a list of available container-level metrics
    71  
    72  `/api/v1/model/nodes/{node-name}/freecontainers/{container-name}/metrics/{metric-name}?start=X&end=Y`: Returns a set of (Timestamp, Value) 
    73  pairs for the requested container-level metric, within the time range specified by `start` and `end`. 
    74  
    75  ### Metric Types
    76  
    77  All metrics available in the [storage schema](storage-schema.md) are also available through the api.