update documentation for stability framework

Change-Id: Id3fea91aac9c6faf2c920b1a0bec721e930a99ae
This commit is contained in:
Han Kang 2022-10-31 15:16:52 -07:00
parent f9bfa378ef
commit 13e7fd8ed1
6 changed files with 56 additions and 6 deletions

View File

@ -26,8 +26,7 @@ To update the golden test list, you can run:
./test/instrumentation/test-update.sh
```
To update the list of documented metrics (which you need to run first before
upgrading the documentation markdown file).
To update the list of documented metrics, please run:
```console
./test/instrumentation/update-documentation-metrics.sh

View File

@ -0,0 +1,29 @@
/*
Copyright 2022 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
/*
This stand-alone package is utilized for dynamically generating/maintaining a list of
metrics; this list is determined by the stability class of the metric. We statically analyze
all files in the Kubernetes code base to:
- Determine whether the metric falls into a stability class with stability guarantees.
- Determine the metric's metadata, i.e. the name, labels, type of metric.
- Output (based on the above) the metrics which meet our criteria into a yaml file.
Due to the dynamic nature of how metrics can be written, we only support the subset of metrics
which can actually be parsed. If a metric cannot be parsed, it must be delegated to the stability
class `Internal`, which will exempt the metric from static analysis.
*/
package main

View File

@ -0,0 +1,21 @@
/*
Copyright 2022 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
/*
This stand-alone package is utilized for dynamically generating/maintaining
documentation on all parseable metrics in the Kubernetes code base.
*/
package main

View File

@ -13,7 +13,7 @@ components using an HTTP scrape, and fetch the current metrics data in Prometheu
### List of Stable Kubernetes Metrics
<table class="table" caption="This is the list of STABLE metrics emitted from core Kubernetes components">
<table class="table metrics" caption="This is the list of STABLE metrics emitted from core Kubernetes components">
<thead>
<tr>
<th class="metric_name">Name</th>
@ -151,7 +151,7 @@ components using an HTTP scrape, and fetch the current metrics data in Prometheu
### List of Alpha Kubernetes Metrics
<table class="table" caption="This is the list of ALPHA metrics emitted from core Kubernetes components">
<table class="table metrics" caption="This is the list of ALPHA metrics emitted from core Kubernetes components">
<thead>
<tr>
<th class="metric_name">Name</th>

View File

@ -55,7 +55,7 @@ components using an HTTP scrape, and fetch the current metrics data in Prometheu
### List of Stable Kubernetes Metrics
<table class="table" caption="This is the list of STABLE metrics emitted from core Kubernetes components">
<table class="table metrics" caption="This is the list of STABLE metrics emitted from core Kubernetes components">
<thead>
<tr>
<th class="metric_name">Name</th>
@ -79,7 +79,7 @@ components using an HTTP scrape, and fetch the current metrics data in Prometheu
### List of Alpha Kubernetes Metrics
<table class="table" caption="This is the list of ALPHA metrics emitted from core Kubernetes components">
<table class="table metrics" caption="This is the list of ALPHA metrics emitted from core Kubernetes components">
<thead>
<tr>
<th class="metric_name">Name</th>

View File

@ -25,4 +25,5 @@ set -o pipefail
KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/../..
source "${KUBE_ROOT}/test/instrumentation/stability-utils.sh"
kube::update::documentation::list
kube::update::documentation