k8s.io/kubernetes@v1.29.3/test/instrumentation/README.md (about)

     1  This directory contains the regression test for controlling the list of stable metrics
     2  
     3  If you add or remove a stable metric, this test will fail and you will need
     4  to update the golden list of tests stored in `testdata/`.  Changes to that file
     5  require review by sig-instrumentation.
     6  
     7  To update the list, run
     8  
     9  ```console
    10  ./hack/update-generated-stable-metrics.sh
    11  ```
    12  
    13  Add the changed file to your PR, then send for review.
    14  
    15  If you want to test the stability framework, you can add metrics to the file in
    16  `test/instrumentation/testdata/pkg/kubelet/metrics/metrics.go` and run test
    17  verification via:
    18  
    19  ```console
    20  ./test/instrumentation/test-verify.sh
    21  ```
    22  
    23  To update the golden test list, you can run:
    24  
    25  ```console
    26  ./test/instrumentation/test-update.sh
    27  ```
    28  
    29  To update the list of documented metrics, please run:
    30  
    31  ```console
    32  ./test/instrumentation/update-documentation-metrics.sh
    33  ```
    34  
    35  To update the documented list of metrics for k8s/website, please run:
    36  
    37  ```console
    38  ./test/instrumentation/update-documentation.sh
    39  ```
    40  
    41  Then you need to copy the output to the appropriate website directory. Please
    42  define the directory in which the website repo lives in an env variable like so:
    43  
    44  ```shell
    45  export WEBSITE_ROOT=<path to website root>
    46  ```
    47  
    48  And then from the root of the k8s/k8s repository, please run this command:
    49  
    50  ```shell
    51  cp ./test/instrumentation/documentation/documentation.md $WEBSITE_ROOT/content/en/docs/reference/instrumentation/metrics.md
    52  ```