Skip to content

Commit

Permalink
[chore] [mdatagen] Fix generated tests for include/exclude capability (
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitryax authored Apr 16, 2024
1 parent 9731ea3 commit 49cc9e0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/mdatagen/templates/metrics.go.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ type MetricsBuilder struct {
metricsCapacity int // maximum observed number of metrics per resource.
metricsBuffer pmetric.Metrics // accumulates metrics data before emitting.
buildInfo component.BuildInfo // contains version information.
{{ if .ResourceAttributes -}}
{{- if .ResourceAttributes }}
resourceAttributeIncludeFilter map[string]filter.Filter
resourceAttributeExcludeFilter map[string]filter.Filter
{{- end }}
Expand Down
2 changes: 2 additions & 0 deletions cmd/mdatagen/templates/metrics_test.go.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ func TestMetricsBuilder(t *testing.T) {
resAttrsConfigured: true,
expectEmpty: true,
},
{{- if .ResourceAttributes }}
{
name: "filter_set_include",
resAttrsConfigured: true,
Expand All @@ -52,6 +53,7 @@ func TestMetricsBuilder(t *testing.T) {
resAttrsConfigured: true,
expectEmpty: true,
},
{{- end }}
}
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
Expand Down

0 comments on commit 49cc9e0

Please sign in to comment.