Skip to content

Commit

Permalink
[chore] [cmd/mdatagen] Separate configuration generation
Browse files Browse the repository at this point in the history
- Render the configuration separately
- Add config tests 
- Allow setting `resource_attributes` group in metadata.yaml which will result in generation of the config related to resource attributes.
  • Loading branch information
dmitryax committed May 5, 2023
1 parent 1108ae9 commit bf64f3c
Show file tree
Hide file tree
Showing 199 changed files with 12,551 additions and 7,021 deletions.
2 changes: 2 additions & 0 deletions cmd/mdatagen/embeded_templates_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ func TestEnsureTemplatesLoaded(t *testing.T) {
var (
templateFiles = map[string]struct{}{
path.Join(rootDir, "documentation.md.tmpl"): {},
path.Join(rootDir, "config_test.go.tmpl"): {},
path.Join(rootDir, "config.go.tmpl"): {},
path.Join(rootDir, "metrics_test.go.tmpl"): {},
path.Join(rootDir, "metrics.go.tmpl"): {},
path.Join(rootDir, "readme.md.tmpl"): {},
Expand Down
1 change: 1 addition & 0 deletions cmd/mdatagen/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/cmd/mdatagen
go 1.19

require (
github.com/google/go-cmp v0.5.9
github.com/stretchr/testify v1.8.2
go.opentelemetry.io/collector/component v0.76.2-0.20230502195822-4df44379e094
go.opentelemetry.io/collector/confmap v0.76.2-0.20230502195822-4df44379e094
Expand Down
1 change: 1 addition & 0 deletions cmd/mdatagen/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

93 changes: 93 additions & 0 deletions cmd/mdatagen/internal/metadata/generated_config.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

130 changes: 130 additions & 0 deletions cmd/mdatagen/internal/metadata/generated_config_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

89 changes: 0 additions & 89 deletions cmd/mdatagen/internal/metadata/generated_metrics.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 1 addition & 15 deletions cmd/mdatagen/internal/metadata/generated_metrics_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit bf64f3c

Please sign in to comment.