From 0024c7e16686dbe1009f8895e09e2782dc4e0ad7 Mon Sep 17 00:00:00 2001 From: Gauravpadam <1032201077@tcetmumbai.in> Date: Fri, 1 Sep 2023 08:08:51 +0530 Subject: [PATCH] Changed the generator codes for kubernetes metrics table Corrected the gotemplate range call Modified the wrapper class Delete test/instrumentation/documentation/documentation.md Removed documentation.md change as we're changing it over the other PR Restored the original doc.md ; PR is solely for the generator code now Some label fixes merge commits --- test/instrumentation/documentation/main.go | 111 ++++++++------------- 1 file changed, 42 insertions(+), 69 deletions(-) diff --git a/test/instrumentation/documentation/main.go b/test/instrumentation/documentation/main.go index c8a2b37c6d9..24970e2edd3 100755 --- a/test/instrumentation/documentation/main.go +++ b/test/instrumentation/documentation/main.go @@ -60,85 +60,58 @@ components using an HTTP scrape, and fetch the current metrics data in Prometheu Stable metrics observe strict API contracts and no labels can be added or removed from stable metrics during their lifetime. - - - - - - - - - - - - - -{{range $index, $metric := .StableMetrics}} - - - - -{{if not $metric.Labels }}{{else }}{{end}} -{{if not $metric.ConstLabels }}{{else }}{{end}} -{{if not $metric.DeprecatedVersion }}{{else }}{{end}}{{end}} - -
NameStability LevelTypeHelpLabelsConst LabelsDeprecated Version
{{with $metric}}{{.BuildFQName}}{{end}}{{$metric.StabilityLevel}}{{$metric.Type}}{{$metric.Help}}{{range $label := $metric.Labels}}
{{$label}}
{{end}}
{{range $key, $value := $metric.ConstLabels}}
{{$key}}:{{$value}}
{{end}}
{{$metric.DeprecatedVersion}}
+
+{{- range $index, $metric := .StableMetrics -}} +
+
{{with $metric}}{{.BuildFQName}}{{- end -}}
+
{{- $metric.Help -}}
+ +
{{end}} +
### List of Beta Kubernetes Metrics Beta metrics observe a looser API contract than its stable counterparts. No labels can be removed from beta metrics during their lifetime, however, labels can be added while the metric is in the beta stage. This offers the assurance that beta metrics will honor existing dashboards and alerts, while allowing for amendments in the future. - - - - - - - - - - - - - -{{range $index, $metric := .BetaMetrics}} - - - - -{{if not $metric.Labels }}{{else }}{{end}} -{{if not $metric.ConstLabels }}{{else }}{{end}} -{{if not $metric.DeprecatedVersion }}{{else }}{{end}}{{end}} - -
NameStability LevelTypeHelpLabelsConst LabelsDeprecated Version
{{with $metric}}{{.BuildFQName}}{{end}}{{$metric.StabilityLevel}}{{$metric.Type}}{{$metric.Help}}{{range $label := $metric.Labels}}
{{$label}}
{{end}}
{{range $key, $value := $metric.ConstLabels}}
{{$key}}:{{$value}}
{{end}}
{{$metric.DeprecatedVersion}}
+
+{{- range $index, $metric := .BetaMetrics -}} +
+
{{with $metric}}{{.BuildFQName}}{{- end -}}
+
{{- $metric.Help -}}
+ +
{{end}} +
### List of Alpha Kubernetes Metrics Alpha metrics do not have any API guarantees. These metrics must be used at your own risk, subsequent versions of Kubernetes may remove these metrics altogether, or mutate the API in such a way that breaks existing dashboards and alerts. - - - - - - - - - - - - - -{{range $index, $metric := .AlphaMetrics}} - - - - -{{if not $metric.Labels }}{{else }}{{end}} -{{if not $metric.ConstLabels }}{{else }}{{end}} -{{if not $metric.DeprecatedVersion }}{{else }}{{end}}{{end}} - -
NameStability LevelTypeHelpLabelsConst LabelsDeprecated Version
{{with $metric}}{{.BuildFQName}}{{end}}{{$metric.StabilityLevel}}{{$metric.Type}}{{$metric.Help}}{{range $label := $metric.Labels}}
{{$label}}
{{end}}
{{range $key, $value := $metric.ConstLabels}}
{{$key}}:{{$value}}
{{end}}
{{$metric.DeprecatedVersion}}
+
+{{- range $index, $metric := .AlphaMetrics -}} +
+
{{with $metric}}{{.BuildFQName}}{{- end -}}
+
{{- $metric.Help -}}
+ +
{{end}} +
` )