Skip to content

Follow up for Add automated documentation for metrics #6256

@avlitman

Description

@avlitman

This Issue will detail the follow up suggestions that need to be implemented and/or discussed:

Follow up for: #6114:

  1. Add link to the metrics doc to the main README.
  2. Add condition to the log message to be more specific, like "webhook and metrics" where apt, or just "with webhooks".
  3. Update metricsdocs file to use Go template instead of creating a whole bunch of constants. Example template:
const metricsTemplate = `# Operator Metrics
This document aims to help users that are not familiar with metrics exposed by this operator.
The metrics documentation is auto-generated by the utility tool \"monitoring/metricsdocs\" and reflects all of the metrics that are exposed by the operator.

## Operator Metrics List
{{range .}}
### {{.Name}}
**Description:** {{.Description}}

**Type**:  {{.Type}}
{{end}}

## Developing new metrics
After developing new metrics or changing old ones, please run \"make generate-metricsdocs\" to regenerate this document.

If you feel that the new metric doesn't follow these rules, please change \"monitoring/metricsdocs\" according to your needs.

Then you can render this template by running something like:

tmpl := template.New("Operator metrics")

tmpl, err := tmpl.Parse(metricsTemplate)
// handle error

out := &bytes.Buffer{}
mList := metricList{}
err = tmpl.Execute(out, mList)
// handle error
  1. Moving the common generator code to a library. The generator should live in the operator project, but its helpers can still can be moved to a common place.

Metadata

Metadata

Assignees

Labels

help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.kind/documentationCategorizes issue or PR as related to documentation.priority/backlogHigher priority than priority/awaiting-more-evidence.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions