|
| 1 | +--- |
| 2 | +title: Kubernetes Custom Metrics (v1beta2) |
| 3 | +content_type: tool-reference |
| 4 | +package: custom.metrics.k8s.io/v1beta2 |
| 5 | +auto_generated: true |
| 6 | +--- |
| 7 | +<p>Package v1beta2 is the v1beta2 version of the custom_metrics API.</p> |
| 8 | + |
| 9 | + |
| 10 | +## Resource Types |
| 11 | + |
| 12 | + |
| 13 | +- [MetricListOptions](#custom-metrics-k8s-io-v1beta2-MetricListOptions) |
| 14 | +- [MetricValue](#custom-metrics-k8s-io-v1beta2-MetricValue) |
| 15 | +- [MetricValueList](#custom-metrics-k8s-io-v1beta2-MetricValueList) |
| 16 | + |
| 17 | + |
| 18 | + |
| 19 | +## `MetricListOptions` {#custom-metrics-k8s-io-v1beta2-MetricListOptions} |
| 20 | + |
| 21 | + |
| 22 | + |
| 23 | +<p>MetricListOptions is used to select metrics by their label selectors</p> |
| 24 | + |
| 25 | + |
| 26 | +<table class="table"> |
| 27 | +<thead><tr><th width="30%">Field</th><th>Description</th></tr></thead> |
| 28 | +<tbody> |
| 29 | + |
| 30 | +<tr><td><code>apiVersion</code><br/>string</td><td><code>custom.metrics.k8s.io/v1beta2</code></td></tr> |
| 31 | +<tr><td><code>kind</code><br/>string</td><td><code>MetricListOptions</code></td></tr> |
| 32 | + |
| 33 | + |
| 34 | +<tr><td><code>labelSelector</code><br/> |
| 35 | +<code>string</code> |
| 36 | +</td> |
| 37 | +<td> |
| 38 | + <p>A selector to restrict the list of returned objects by their labels. |
| 39 | +Defaults to everything.</p> |
| 40 | +</td> |
| 41 | +</tr> |
| 42 | +<tr><td><code>metricLabelSelector</code><br/> |
| 43 | +<code>string</code> |
| 44 | +</td> |
| 45 | +<td> |
| 46 | + <p>A selector to restrict the list of returned metrics by their labels</p> |
| 47 | +</td> |
| 48 | +</tr> |
| 49 | +</tbody> |
| 50 | +</table> |
| 51 | + |
| 52 | +## `MetricValue` {#custom-metrics-k8s-io-v1beta2-MetricValue} |
| 53 | + |
| 54 | + |
| 55 | +**Appears in:** |
| 56 | + |
| 57 | +- [MetricValueList](#custom-metrics-k8s-io-v1beta2-MetricValueList) |
| 58 | + |
| 59 | + |
| 60 | +<p>MetricValue is the metric value for some object</p> |
| 61 | + |
| 62 | + |
| 63 | +<table class="table"> |
| 64 | +<thead><tr><th width="30%">Field</th><th>Description</th></tr></thead> |
| 65 | +<tbody> |
| 66 | + |
| 67 | +<tr><td><code>apiVersion</code><br/>string</td><td><code>custom.metrics.k8s.io/v1beta2</code></td></tr> |
| 68 | +<tr><td><code>kind</code><br/>string</td><td><code>MetricValue</code></td></tr> |
| 69 | + |
| 70 | + |
| 71 | +<tr><td><code>describedObject</code> <B>[Required]</B><br/> |
| 72 | +<a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#objectreference-v1-core"><code>core/v1.ObjectReference</code></a> |
| 73 | +</td> |
| 74 | +<td> |
| 75 | + <p>a reference to the described object</p> |
| 76 | +</td> |
| 77 | +</tr> |
| 78 | +<tr><td><code>metric</code> <B>[Required]</B><br/> |
| 79 | +<a href="#custom-metrics-k8s-io-v1beta2-MetricIdentifier"><code>MetricIdentifier</code></a> |
| 80 | +</td> |
| 81 | +<td> |
| 82 | + <span class="text-muted">No description provided.</span></td> |
| 83 | +</tr> |
| 84 | +<tr><td><code>timestamp</code> <B>[Required]</B><br/> |
| 85 | +<a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#time-v1-meta"><code>meta/v1.Time</code></a> |
| 86 | +</td> |
| 87 | +<td> |
| 88 | + <p>indicates the time at which the metrics were produced</p> |
| 89 | +</td> |
| 90 | +</tr> |
| 91 | +<tr><td><code>windowSeconds</code> <B>[Required]</B><br/> |
| 92 | +<code>int64</code> |
| 93 | +</td> |
| 94 | +<td> |
| 95 | + <p>indicates the window ([Timestamp-Window, Timestamp]) from |
| 96 | +which these metrics were calculated, when returning rate |
| 97 | +metrics calculated from cumulative metrics (or zero for |
| 98 | +non-calculated instantaneous metrics).</p> |
| 99 | +</td> |
| 100 | +</tr> |
| 101 | +<tr><td><code>value</code> <B>[Required]</B><br/> |
| 102 | +<a href="https://pkg.go.dev/k8s.io/apimachinery/pkg/api/resource#Quantity"><code>k8s.io/apimachinery/pkg/api/resource.Quantity</code></a> |
| 103 | +</td> |
| 104 | +<td> |
| 105 | + <p>the value of the metric for this</p> |
| 106 | +</td> |
| 107 | +</tr> |
| 108 | +</tbody> |
| 109 | +</table> |
| 110 | + |
| 111 | +## `MetricValueList` {#custom-metrics-k8s-io-v1beta2-MetricValueList} |
| 112 | + |
| 113 | + |
| 114 | + |
| 115 | +<p>MetricValueList is a list of values for a given metric for some set of objects</p> |
| 116 | + |
| 117 | + |
| 118 | +<table class="table"> |
| 119 | +<thead><tr><th width="30%">Field</th><th>Description</th></tr></thead> |
| 120 | +<tbody> |
| 121 | + |
| 122 | +<tr><td><code>apiVersion</code><br/>string</td><td><code>custom.metrics.k8s.io/v1beta2</code></td></tr> |
| 123 | +<tr><td><code>kind</code><br/>string</td><td><code>MetricValueList</code></td></tr> |
| 124 | + |
| 125 | + |
| 126 | +<tr><td><code>metadata</code> <B>[Required]</B><br/> |
| 127 | +<a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#listmeta-v1-meta"><code>meta/v1.ListMeta</code></a> |
| 128 | +</td> |
| 129 | +<td> |
| 130 | + <span class="text-muted">No description provided.</span></td> |
| 131 | +</tr> |
| 132 | +<tr><td><code>items</code> <B>[Required]</B><br/> |
| 133 | +<a href="#custom-metrics-k8s-io-v1beta2-MetricValue"><code>[]MetricValue</code></a> |
| 134 | +</td> |
| 135 | +<td> |
| 136 | + <p>the value of the metric across the described objects</p> |
| 137 | +</td> |
| 138 | +</tr> |
| 139 | +</tbody> |
| 140 | +</table> |
| 141 | + |
| 142 | +## `MetricIdentifier` {#custom-metrics-k8s-io-v1beta2-MetricIdentifier} |
| 143 | + |
| 144 | + |
| 145 | +**Appears in:** |
| 146 | + |
| 147 | +- [MetricValue](#custom-metrics-k8s-io-v1beta2-MetricValue) |
| 148 | + |
| 149 | + |
| 150 | +<p>MetricIdentifier identifies a metric by name and, optionally, selector</p> |
| 151 | + |
| 152 | + |
| 153 | +<table class="table"> |
| 154 | +<thead><tr><th width="30%">Field</th><th>Description</th></tr></thead> |
| 155 | +<tbody> |
| 156 | + |
| 157 | + |
| 158 | +<tr><td><code>name</code> <B>[Required]</B><br/> |
| 159 | +<code>string</code> |
| 160 | +</td> |
| 161 | +<td> |
| 162 | + <p>name is the name of the given metric</p> |
| 163 | +</td> |
| 164 | +</tr> |
| 165 | +<tr><td><code>selector</code><br/> |
| 166 | +<a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#labelselector-v1-meta"><code>meta/v1.LabelSelector</code></a> |
| 167 | +</td> |
| 168 | +<td> |
| 169 | + <p>selector represents the label selector that could be used to select |
| 170 | +this metric, and will generally just be the selector passed in to |
| 171 | +the query used to fetch this metric. |
| 172 | +When left blank, only the metric's Name will be used to gather metrics.</p> |
| 173 | +</td> |
| 174 | +</tr> |
| 175 | +</tbody> |
| 176 | +</table> |
| 177 | + |
0 commit comments