|
1 | 1 | {{- if .Metrics }} |
2 | 2 | metrics_config: |
3 | | - description: MetricsConfig provides config for {{ .Type }} metrics. |
4 | | - type: object |
5 | | - properties: |
6 | | - {{- range $name, $metric := .Metrics }} |
7 | | - {{- $metricReag := hasAggregatableAttributes $metric.Attributes }} |
8 | | - {{ $name }}: |
9 | | - description: "{{ $name.Render }}MetricConfig provides config for the {{ $name }} metric." |
10 | | - type: object |
11 | | - properties: |
12 | | - enabled: |
13 | | - type: boolean |
14 | | - default: {{ $metric.Enabled }} |
15 | | - {{- if $metricReag }} |
16 | | - aggregation_strategy: |
17 | | - type: string |
18 | | - enum: |
19 | | - - "sum" |
20 | | - - "avg" |
21 | | - - "min" |
22 | | - - "max" |
23 | | - {{- if eq $metric.Data.Type "Sum" }} |
24 | | - default: "sum" |
25 | | - {{- else }} |
26 | | - default: "avg" |
27 | | - {{- end }} |
28 | | - attributes: |
29 | | - type: array |
30 | | - items: |
31 | | - type: string |
32 | | - enum: |
33 | | - {{- range $metric.Attributes }} |
34 | | - - "{{ (attributeInfo .).Name }}" |
35 | | - {{- end }} |
36 | | - default: |
37 | | - {{- range $metric.Attributes }} |
38 | | - {{- if (attributeInfo .).IsNotOptIn }} |
39 | | - - "{{ (attributeInfo .).Name }}" |
40 | | - {{- end }} |
41 | | - {{- end }} |
42 | | - {{- end }} |
43 | | - {{- end }} |
| 3 | + description: MetricsConfig provides config for {{ .Type }} metrics. |
| 4 | + type: object |
| 5 | + properties: |
| 6 | + {{- range $name, $metric := .Metrics }} |
| 7 | + {{- $metricReag := hasAggregatableAttributes $metric.Attributes }} |
| 8 | + {{ $name }}: |
| 9 | + description: "{{ $name.Render }}MetricConfig provides config for the {{ $name }} metric." |
| 10 | + type: object |
| 11 | + properties: |
| 12 | + enabled: |
| 13 | + type: boolean |
| 14 | + default: {{ $metric.Enabled }} |
| 15 | + {{- if $metricReag }} |
| 16 | + aggregation_strategy: |
| 17 | + type: string |
| 18 | + enum: |
| 19 | + - "sum" |
| 20 | + - "avg" |
| 21 | + - "min" |
| 22 | + - "max" |
| 23 | + {{- if eq $metric.Data.Type "Sum" }} |
| 24 | + default: "sum" |
| 25 | + {{- else }} |
| 26 | + default: "avg" |
| 27 | + {{- end }} |
| 28 | + attributes: |
| 29 | + type: array |
| 30 | + items: |
| 31 | + type: string |
| 32 | + enum: |
| 33 | + {{- range $metric.Attributes }} |
| 34 | + - "{{ (attributeInfo .).Name }}" |
| 35 | + {{- end }} |
| 36 | + default: |
| 37 | + {{- range $metric.Attributes }} |
| 38 | + {{- if (attributeInfo .).IsNotOptIn }} |
| 39 | + - "{{ (attributeInfo .).Name }}" |
| 40 | + {{- end }} |
| 41 | + {{- end }} |
| 42 | + {{- end }} |
| 43 | + {{- end }} |
44 | 44 | {{- end }} |
45 | 45 | {{- if .Events }} |
46 | 46 | events_config: |
47 | | - description: EventsConfig provides config for {{ .Type }} events. |
48 | | - type: object |
49 | | - properties: |
50 | | - {{- range $name, $event := .Events }} |
51 | | - {{ $name }}: |
52 | | - description: EventConfig provides common config for a {{ $name }} event. |
53 | | - type: object |
54 | | - properties: |
55 | | - enabled: |
56 | | - type: boolean |
57 | | - default: {{ $event.Enabled }} |
58 | | - {{- end }} |
| 47 | + description: EventsConfig provides config for {{ .Type }} events. |
| 48 | + type: object |
| 49 | + properties: |
| 50 | + {{- range $name, $event := .Events }} |
| 51 | + {{ $name }}: |
| 52 | + description: EventConfig provides common config for a {{ $name }} event. |
| 53 | + type: object |
| 54 | + properties: |
| 55 | + enabled: |
| 56 | + type: boolean |
| 57 | + default: {{ $event.Enabled }} |
| 58 | + {{- end }} |
59 | 59 | {{- end }} |
60 | 60 | {{- if .ResourceAttributes }} |
61 | 61 | resource_attributes_config: |
62 | | - description: ResourceAttributesConfig provides config for {{ .Type }} resource attributes. |
63 | | - type: object |
64 | | - properties: |
65 | | - {{- range $name, $attr := .ResourceAttributes }} |
66 | | - {{ $name }}: |
67 | | - description: ResourceAttributeConfig provides common config for a {{ $name }} resource attribute. |
68 | | - type: object |
69 | | - properties: |
70 | | - enabled: |
71 | | - type: boolean |
72 | | - default: {{ $attr.Enabled }} |
73 | | - {{- if $.Metrics }} |
74 | | - metrics_include: |
75 | | - description: "Experimental: MetricsInclude defines a list of filters for attribute values. If the list is not empty, only metrics with matching resource attribute values will be emitted." |
76 | | - type: array |
77 | | - items: |
78 | | - $ref: {{ schemaRef "go.opentelemetry.io/collector/filter.config" }} |
79 | | - metrics_exclude: |
80 | | - description: "Experimental: MetricsExclude defines a list of filters for attribute values. If the list is not empty, metrics with matching resource attribute values will not be emitted. MetricsInclude has higher priority than MetricsExclude." |
81 | | - type: array |
82 | | - items: |
83 | | - $ref: {{ schemaRef "go.opentelemetry.io/collector/filter.config" }} |
84 | | - {{- end }} |
85 | | - {{- if $.Events }} |
86 | | - events_include: |
87 | | - description: "Experimental: EventsInclude defines a list of filters for attribute values. If the list is not empty, only events with matching resource attribute values will be emitted." |
88 | | - type: array |
89 | | - items: |
90 | | - $ref: {{ schemaRef "go.opentelemetry.io/collector/filter.config" }} |
91 | | - events_exclude: |
92 | | - description: "Experimental: EventsExclude defines a list of filters for attribute values. If the list is not empty, events with matching resource attribute values will not be emitted. EventsInclude has higher priority than EventsExclude." |
93 | | - type: array |
94 | | - items: |
95 | | - $ref: {{ schemaRef "go.opentelemetry.io/collector/filter.config" }} |
96 | | - {{- end }} |
97 | | - {{- end }} |
| 62 | + description: ResourceAttributesConfig provides config for {{ .Type }} resource attributes. |
| 63 | + type: object |
| 64 | + properties: |
| 65 | + {{- range $name, $attr := .ResourceAttributes }} |
| 66 | + {{ $name }}: |
| 67 | + description: ResourceAttributeConfig provides common config for a {{ $name }} resource attribute. |
| 68 | + type: object |
| 69 | + properties: |
| 70 | + enabled: |
| 71 | + type: boolean |
| 72 | + default: {{ $attr.Enabled }} |
| 73 | + {{- if $.Metrics }} |
| 74 | + metrics_include: |
| 75 | + description: "Experimental: MetricsInclude defines a list of filters for attribute values. If the list is not empty, only metrics with matching resource attribute values will be emitted." |
| 76 | + type: array |
| 77 | + items: |
| 78 | + $ref: {{ schemaRef "go.opentelemetry.io/collector/filter.config" }} |
| 79 | + metrics_exclude: |
| 80 | + description: "Experimental: MetricsExclude defines a list of filters for attribute values. If the list is not empty, metrics with matching resource attribute values will not be emitted. MetricsInclude has higher priority than MetricsExclude." |
| 81 | + type: array |
| 82 | + items: |
| 83 | + $ref: {{ schemaRef "go.opentelemetry.io/collector/filter.config" }} |
| 84 | + {{- end }} |
| 85 | + {{- if $.Events }} |
| 86 | + events_include: |
| 87 | + description: "Experimental: EventsInclude defines a list of filters for attribute values. If the list is not empty, only events with matching resource attribute values will be emitted." |
| 88 | + type: array |
| 89 | + items: |
| 90 | + $ref: {{ schemaRef "go.opentelemetry.io/collector/filter.config" }} |
| 91 | + events_exclude: |
| 92 | + description: "Experimental: EventsExclude defines a list of filters for attribute values. If the list is not empty, events with matching resource attribute values will not be emitted. EventsInclude has higher priority than EventsExclude." |
| 93 | + type: array |
| 94 | + items: |
| 95 | + $ref: {{ schemaRef "go.opentelemetry.io/collector/filter.config" }} |
| 96 | + {{- end }} |
| 97 | + {{- end }} |
98 | 98 | {{- end }} |
99 | 99 | {{- if .Metrics }} |
100 | 100 | metrics_builder_config: |
101 | | - description: MetricsBuilderConfig is a configuration for {{ .Type }} metrics builder. |
102 | | - type: object |
103 | | - properties: |
104 | | - metrics: |
105 | | - $ref: metrics_config |
106 | | - {{- if .ResourceAttributes }} |
107 | | - resource_attributes: |
108 | | - $ref: resource_attributes_config |
109 | | - {{- end }} |
| 101 | + description: MetricsBuilderConfig is a configuration for {{ .Type }} metrics builder. |
| 102 | + type: object |
| 103 | + properties: |
| 104 | + metrics: |
| 105 | + $ref: metrics_config |
| 106 | + {{- if .ResourceAttributes }} |
| 107 | + resource_attributes: |
| 108 | + $ref: resource_attributes_config |
| 109 | + {{- end }} |
110 | 110 | {{- end }} |
111 | 111 | {{- if .Events }} |
112 | 112 | logs_builder_config: |
113 | | - description: LogsBuilderConfig is a configuration for {{ .Type }} logs builder. |
114 | | - type: object |
115 | | - properties: |
116 | | - events: |
117 | | - $ref: events_config |
118 | | - {{- if .ResourceAttributes }} |
119 | | - resource_attributes: |
120 | | - $ref: resource_attributes_config |
121 | | - {{- end }} |
| 113 | + description: LogsBuilderConfig is a configuration for {{ .Type }} logs builder. |
| 114 | + type: object |
| 115 | + properties: |
| 116 | + events: |
| 117 | + $ref: events_config |
| 118 | + {{- if .ResourceAttributes }} |
| 119 | + resource_attributes: |
| 120 | + $ref: resource_attributes_config |
| 121 | + {{- end }} |
122 | 122 | {{- end }} |
0 commit comments