Skip to content

Commit 43f1d85

Browse files
committed
[mdatagen] support producing docs for internal telemetry attributes
This adds the ability to generate documentation for the internal metrics attributes. Signed-off-by: Alex Boten <[email protected]>
1 parent d020c90 commit 43f1d85

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

cmd/mdatagen/internal/templates/documentation.md.tmpl

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,19 @@
5353
| {{ $metric.Unit }} | {{ $metric.Data.Type }} | {{ $metric.Data.MetricValueType }} |
5454
{{- if $metric.Data.HasMonotonic }} {{ $metric.Data.Monotonic }} |{{ end }}
5555

56+
{{- if $metric.Attributes }}
57+
58+
#### Attributes
59+
60+
| Name | Description | Values |
61+
| ---- | ----------- | ------ |
62+
{{- range $metric.Attributes }}
63+
{{- $attribute := . | attributeInfo }}
64+
| {{ $attribute.Name }} | {{ $attribute.Description }} |
65+
{{- if $attribute.Enum }} {{ $attribute.Type }}: ``{{ stringsJoin $attribute.Enum "``, ``" }}``{{ else }} Any {{ $attribute.Type }}{{ end }} |
66+
{{- end }}
67+
68+
{{- end }}
5669

5770
{{- end -}}
5871

0 commit comments

Comments
 (0)