forked from open-telemetry/opentelemetry-collector-contrib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
documentation.md.tmpl
98 lines (66 loc) · 2.56 KB
/
documentation.md.tmpl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
{{- define "metric-documenation" -}}
{{- $metricName := . }}
{{- $metric := $metricName | metricInfo -}}
### {{ $metricName }}
{{ $metric.Description }}
{{- if $metric.ExtendedDocumentation }}
{{ $metric.ExtendedDocumentation }}
{{- end }}
| Unit | Metric Type | Value Type |{{ if $metric.Data.HasAggregated }} Aggregation Temporality |{{ end }}{{ if $metric.Data.HasMonotonic }} Monotonic |{{ end }}
| ---- | ----------- | ---------- |{{ if $metric.Data.HasAggregated }} ----------------------- |{{ end }}{{ if $metric.Data.HasMonotonic }} --------- |{{ end }}
| {{ $metric.Unit }} | {{ $metric.Data.Type }} | {{ $metric.Data.MetricValueType }} |
{{- if $metric.Data.HasAggregated }} {{ $metric.Data.Aggregated }} |{{ end }}
{{- if $metric.Data.HasMonotonic }} {{ $metric.Data.Monotonic }} |{{ end }}
{{- if $metric.Attributes }}
#### Attributes
| Name | Description | Values |
| ---- | ----------- | ------ |
{{- range $metric.Attributes }}
{{- $attribute := . | attributeInfo }}
| {{ attributeName . }} | {{ $attribute.Description }} |
{{- if $attribute.Enum }} {{ $attribute.Type }}: ``{{ stringsJoin $attribute.Enum "``, ``" }}``{{ else }} Any {{ $attribute.Type }}{{ end }} |
{{- end }}
{{- end }}
{{- end -}}
[comment]: <> (Code generated by mdatagen. DO NOT EDIT.)
# {{ .Type }}
{{- if .Parent }}
**Parent Component:** {{ .Parent }}
{{- end }}
## Default Metrics
The following metrics are emitted by default. Each of them can be disabled by applying the following configuration:
```yaml
metrics:
<metric_name>:
enabled: false
```
{{- range $metricName, $metric := .Metrics }}
{{- if $metric.Enabled }}
{{ template "metric-documenation" $metricName }}
{{- end }}
{{- end }}
{{- $optionalMetricSeen := false }}
{{- range $metricName, $metric := .Metrics }}
{{- if not $metric.Enabled }}
{{- if not $optionalMetricSeen }}
## Optional Metrics
The following metrics are not emitted by default. Each of them can be enabled by applying the following configuration:
```yaml
metrics:
<metric_name>:
enabled: true
```
{{- end }}
{{- $optionalMetricSeen = true }}
{{ template "metric-documenation" $metricName }}
{{- end }}
{{- end }}
{{- if .ResourceAttributes }}
## Resource Attributes
| Name | Description | Values | Enabled |
| ---- | ----------- | ------ | ------- |
{{- range $attributeName, $attribute := .ResourceAttributes }}
| {{ $attributeName }} | {{ $attribute.Description }} |
{{- if $attribute.Enum }} {{ $attribute.Type }}: ``{{ stringsJoin $attribute.Enum "``, ``" }}``{{ else }} Any {{ $attribute.Type }}{{ end }} | {{ $attribute.Enabled }} |
{{- end }}
{{- end }}