Skip to content

Commit ac530a0

Browse files
committed
fix: revert tabs in YAML template and add changelog entry
config.schema.yaml.tmpl generates YAML output; YAML forbids tab characters as indentation (yaml spec §5.5). Reverting to spaces prevents 'found character that cannot start any token' from mdatagen during make gogenerate. Also add required .chloggen entry for this PR. Assisted-by: Claude Sonnet 4.6
1 parent 296b80d commit ac530a0

2 files changed

Lines changed: 132 additions & 107 deletions

File tree

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Use this changelog template to create an entry for release notes.
2+
3+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
4+
change_type: bug_fix
5+
6+
# The name of the component, or a single word describing the area of concern, (e.g. receiver/otlp)
7+
component: cmd/mdatagen
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: Enforce tab indentation in Go template files to pass `gofmt` checks in generated code
11+
12+
# One or more tracking issues or pull requests related to the change
13+
issues: [14698]
14+
15+
# (Optional) One or more lines of additional information to render under the primary note.
16+
# These lines will be padded with 2 spaces and then inserted directly into the document.
17+
# Use pipe (|) for multiline entries.
18+
subtext:
19+
20+
# Optional: The change log or logs in which this entry should be included.
21+
# e.g. '[user]' or '[user, api]'
22+
# Include 'user' if the change is relevant to end users.
23+
# Include 'api' if there is a change to a library API.
24+
# Default: '[user]'
25+
change_logs: []
Lines changed: 107 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -1,122 +1,122 @@
11
{{- if .Metrics }}
22
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 }}
4444
{{- end }}
4545
{{- if .Events }}
4646
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 }}
5959
{{- end }}
6060
{{- if .ResourceAttributes }}
6161
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 }}
9898
{{- end }}
9999
{{- if .Metrics }}
100100
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 }}
110110
{{- end }}
111111
{{- if .Events }}
112112
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 }}
122122
{{- end }}

0 commit comments

Comments
 (0)