diff --git a/.chloggen/add-display-name-14114.yaml b/.chloggen/add-display-name-14114.yaml new file mode 100644 index 00000000000..7f242d04a3d --- /dev/null +++ b/.chloggen/add-display-name-14114.yaml @@ -0,0 +1,27 @@ +# Use this changelog template to create an entry for release notes. + +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: enhancement + +# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver) +component: cmd/mdatagen + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Add optional `display_name` field to metadata.yaml for human-readable component names + +# One or more tracking issues or pull requests related to the change +issues: [14114] + +# (Optional) One or more lines of additional information to render under the primary note. +# These lines will be padded with 2 spaces and then inserted directly into the document. +# Use pipe (|) for multiline entries. +subtext: | + The `display_name` field allows components to specify a human-readable name in metadata.yaml. + If not provided, the component type will be used with the first letter capitalized. + +# Optional: The change log or logs in which this entry should be included. +# e.g. '[user]' or '[user, api]' +# Include 'user' if the change is relevant to end users. +# Include 'api' if there is a change to a library API. +# Default: '[user]' +change_logs: [user] diff --git a/.github/workflows/utils/cspell.json b/.github/workflows/utils/cspell.json index dcec12199e6..083a6ddde49 100644 --- a/.github/workflows/utils/cspell.json +++ b/.github/workflows/utils/cspell.json @@ -324,6 +324,7 @@ "nonclobbering", "nopexporter", "nopreceiver", + "nodisplayname", "nosuchprocessor", "notls", "obsreceiver", diff --git a/cmd/mdatagen/README.md b/cmd/mdatagen/README.md index 99469c03d01..fb1b14a593f 100644 --- a/cmd/mdatagen/README.md +++ b/cmd/mdatagen/README.md @@ -1,5 +1,8 @@ # Metadata Generator + +# Mdatagen + | Status | | | ------------- |-----------| diff --git a/cmd/mdatagen/internal/loader_test.go b/cmd/mdatagen/internal/loader_test.go index e5b8afbd741..a06cb90cf7b 100644 --- a/cmd/mdatagen/internal/loader_test.go +++ b/cmd/mdatagen/internal/loader_test.go @@ -47,6 +47,8 @@ func TestLoadMetadata(t *testing.T) { GithubProject: "open-telemetry/opentelemetry-collector", GeneratedPackageName: "metadata", Type: "sample", + DisplayName: "Sample Receiver", + Description: "This receiver is used for testing purposes to check the output of mdatagen.", SemConvVersion: "1.37.0", PackageName: "go.opentelemetry.io/collector/cmd/mdatagen/internal/samplereceiver", Status: &Status{ @@ -455,6 +457,7 @@ func TestLoadMetadata(t *testing.T) { name: "testdata/parent.yaml", want: Metadata{ Type: "subcomponent", + DisplayName: "Subcomponent", Parent: "parentComponent", GeneratedPackageName: "metadata", ScopeName: "go.opentelemetry.io/collector/cmd/mdatagen/internal/testdata", @@ -467,6 +470,7 @@ func TestLoadMetadata(t *testing.T) { name: "testdata/generated_package_name.yaml", want: Metadata{ Type: "custom", + DisplayName: "Custom", GeneratedPackageName: "customname", ScopeName: "go.opentelemetry.io/collector/cmd/mdatagen/internal/testdata", PackageName: "go.opentelemetry.io/collector/cmd/mdatagen/internal/testdata", @@ -486,6 +490,7 @@ func TestLoadMetadata(t *testing.T) { name: "testdata/empty_test_config.yaml", want: Metadata{ Type: "test", + DisplayName: "Test", GeneratedPackageName: "metadata", ScopeName: "go.opentelemetry.io/collector/cmd/mdatagen/internal/testdata", PackageName: "go.opentelemetry.io/collector/cmd/mdatagen/internal/testdata", @@ -553,6 +558,62 @@ func TestLoadMetadata(t *testing.T) { name: "testdata/~~this file doesn't exist~~.yaml", wantErr: "unable to read the file file:testdata/~~this file doesn't exist~~.yaml", }, + { + name: "testdata/display_name.yaml", + want: Metadata{ + Type: "test", + DisplayName: "Test Receiver", + GeneratedPackageName: "metadata", + ScopeName: "go.opentelemetry.io/collector/cmd/mdatagen/internal/testdata", + PackageName: "go.opentelemetry.io/collector/cmd/mdatagen/internal/testdata", + ShortFolderName: "testdata", + Tests: Tests{Host: "newMdatagenNopHost()"}, + Status: &Status{ + Class: "receiver", + Stability: map[component.StabilityLevel][]string{ + component.StabilityLevelBeta: {"logs"}, + }, + }, + }, + }, + { + name: "testdata/no_display_name.yaml", + want: Metadata{ + Type: "nodisplayname", + DisplayName: "", + GeneratedPackageName: "metadata", + ScopeName: "go.opentelemetry.io/collector/cmd/mdatagen/internal/testdata", + PackageName: "go.opentelemetry.io/collector/cmd/mdatagen/internal/testdata", + ShortFolderName: "testdata", + Tests: Tests{Host: "newMdatagenNopHost()"}, + Status: &Status{ + Class: "receiver", + Stability: map[component.StabilityLevel][]string{ + component.StabilityLevelBeta: {"logs"}, + }, + }, + }, + }, + { + name: "testdata/with_description.yaml", + want: Metadata{ + Type: "test", + DisplayName: "Test Component", + Description: "This is a test component used to validate the description field functionality in mdatagen.", + GeneratedPackageName: "metadata", + ScopeName: "go.opentelemetry.io/collector/cmd/mdatagen/internal/testdata", + PackageName: "go.opentelemetry.io/collector/cmd/mdatagen/internal/testdata", + ShortFolderName: "testdata", + Tests: Tests{Host: "newMdatagenNopHost()"}, + Status: &Status{ + Class: "receiver", + Stability: map[component.StabilityLevel][]string{ + component.StabilityLevelBeta: {"metrics"}, + }, + Distributions: []string{}, + }, + }, + }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { diff --git a/cmd/mdatagen/internal/metadata.go b/cmd/mdatagen/internal/metadata.go index d5355273e72..8f06124e1d1 100644 --- a/cmd/mdatagen/internal/metadata.go +++ b/cmd/mdatagen/internal/metadata.go @@ -18,6 +18,10 @@ import ( type Metadata struct { // Type of the component. Type string `mapstructure:"type"` + // DisplayName is a human-readable name for the component. + DisplayName string `mapstructure:"display_name"` + // Description is a brief description of the component. + Description string `mapstructure:"description"` // Type of the parent component (applicable to subcomponents). Parent string `mapstructure:"parent"` // Status information for the component. diff --git a/cmd/mdatagen/internal/sampleconnector/internal/metadata/generated_config_test.go b/cmd/mdatagen/internal/sampleconnector/internal/metadata/generated_config_test.go index cc1a2cd0525..6f68e8e7713 100644 --- a/cmd/mdatagen/internal/sampleconnector/internal/metadata/generated_config_test.go +++ b/cmd/mdatagen/internal/sampleconnector/internal/metadata/generated_config_test.go @@ -140,6 +140,6 @@ func loadResourceAttributesConfig(t *testing.T, name string) ResourceAttributesC sub, err = sub.Sub("resource_attributes") require.NoError(t, err) cfg := DefaultResourceAttributesConfig() - require.NoError(t, sub.Unmarshal(&cfg)) + require.NoError(t, sub.Unmarshal(&cfg, confmap.WithIgnoreUnused())) return cfg } diff --git a/cmd/mdatagen/internal/samplefactoryreceiver/README.md b/cmd/mdatagen/internal/samplefactoryreceiver/README.md index 6a12429d7cf..32c7c2ad88e 100644 --- a/cmd/mdatagen/internal/samplefactoryreceiver/README.md +++ b/cmd/mdatagen/internal/samplefactoryreceiver/README.md @@ -1,6 +1,8 @@ -# Sample Receiver -This receiver is used for testing purposes to check the output of mdatagen. +# Sample Factory Receiver +This receiver is used for testing purposes to check the output of mdatagen. + + | Status | | | ------------- |-----------| | Stability | [deprecated]: profiles | diff --git a/cmd/mdatagen/internal/samplefactoryreceiver/metadata.yaml b/cmd/mdatagen/internal/samplefactoryreceiver/metadata.yaml index a64cd97fd72..7c8679e679b 100644 --- a/cmd/mdatagen/internal/samplefactoryreceiver/metadata.yaml +++ b/cmd/mdatagen/internal/samplefactoryreceiver/metadata.yaml @@ -1,6 +1,8 @@ # Sample metadata file with all available configurations for a receiver. type: sample +display_name: Sample Factory Receiver +description: This receiver is used for testing purposes to check the output of mdatagen. scope_name: go.opentelemetry.io/collector/internal/receiver/samplefactoryreceiver github_project: open-telemetry/opentelemetry-collector diff --git a/cmd/mdatagen/internal/sampleprocessor/README.md b/cmd/mdatagen/internal/sampleprocessor/README.md index 48c23b1e51b..3c108d2a0ea 100644 --- a/cmd/mdatagen/internal/sampleprocessor/README.md +++ b/cmd/mdatagen/internal/sampleprocessor/README.md @@ -1,6 +1,8 @@ + # Sample Processor This processor is used for testing purposes to check the output of mdatagen. - + + | Status | | | ------------- |-----------| | Stability | [development]: logs | diff --git a/cmd/mdatagen/internal/sampleprocessor/internal/metadata/generated_config_test.go b/cmd/mdatagen/internal/sampleprocessor/internal/metadata/generated_config_test.go index 66f4d0ad959..37b0914a8e0 100644 --- a/cmd/mdatagen/internal/sampleprocessor/internal/metadata/generated_config_test.go +++ b/cmd/mdatagen/internal/sampleprocessor/internal/metadata/generated_config_test.go @@ -10,6 +10,7 @@ import ( "github.com/google/go-cmp/cmp/cmpopts" "github.com/stretchr/testify/require" + "go.opentelemetry.io/collector/confmap" "go.opentelemetry.io/collector/confmap/confmaptest" ) @@ -66,6 +67,6 @@ func loadResourceAttributesConfig(t *testing.T, name string) ResourceAttributesC sub, err = sub.Sub("resource_attributes") require.NoError(t, err) cfg := DefaultResourceAttributesConfig() - require.NoError(t, sub.Unmarshal(&cfg)) + require.NoError(t, sub.Unmarshal(&cfg, confmap.WithIgnoreUnused())) return cfg } diff --git a/cmd/mdatagen/internal/sampleprocessor/metadata.yaml b/cmd/mdatagen/internal/sampleprocessor/metadata.yaml index ce7f738c0f6..2c727996c98 100644 --- a/cmd/mdatagen/internal/sampleprocessor/metadata.yaml +++ b/cmd/mdatagen/internal/sampleprocessor/metadata.yaml @@ -1,6 +1,8 @@ # Sample metadata file with all available configurations for a receiver. type: sample +display_name: Sample Processor +description: This processor is used for testing purposes to check the output of mdatagen. scope_name: go.opentelemetry.io/collector/internal/receiver/samplereceiver github_project: open-telemetry/opentelemetry-collector diff --git a/cmd/mdatagen/internal/samplereceiver/README.md b/cmd/mdatagen/internal/samplereceiver/README.md index 70549c2036d..bef89e4bc55 100644 --- a/cmd/mdatagen/internal/samplereceiver/README.md +++ b/cmd/mdatagen/internal/samplereceiver/README.md @@ -1,6 +1,8 @@ + # Sample Receiver This receiver is used for testing purposes to check the output of mdatagen. - + + | Status | | | ------------- |-----------| | Stability | [deprecated]: profiles | diff --git a/cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_config_test.go b/cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_config_test.go index abe03b709a5..002e397583d 100644 --- a/cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_config_test.go +++ b/cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_config_test.go @@ -152,6 +152,6 @@ func loadResourceAttributesConfig(t *testing.T, name string) ResourceAttributesC sub, err = sub.Sub("resource_attributes") require.NoError(t, err) cfg := DefaultResourceAttributesConfig() - require.NoError(t, sub.Unmarshal(&cfg)) + require.NoError(t, sub.Unmarshal(&cfg, confmap.WithIgnoreUnused())) return cfg } diff --git a/cmd/mdatagen/internal/samplereceiver/metadata.yaml b/cmd/mdatagen/internal/samplereceiver/metadata.yaml index c1ede02b02f..40921d0a90b 100644 --- a/cmd/mdatagen/internal/samplereceiver/metadata.yaml +++ b/cmd/mdatagen/internal/samplereceiver/metadata.yaml @@ -1,6 +1,8 @@ # Sample metadata file with all available configurations for a receiver. type: sample +display_name: Sample Receiver +description: This receiver is used for testing purposes to check the output of mdatagen. scope_name: go.opentelemetry.io/collector/internal/receiver/samplereceiver github_project: open-telemetry/opentelemetry-collector diff --git a/cmd/mdatagen/internal/samplescraper/README.md b/cmd/mdatagen/internal/samplescraper/README.md index 5654b3aeb54..cf4bca172ce 100644 --- a/cmd/mdatagen/internal/samplescraper/README.md +++ b/cmd/mdatagen/internal/samplescraper/README.md @@ -1,6 +1,8 @@ + # Sample Scraper This scraper is used for testing purposes to check the output of mdatagen. - + + | Status | | | ------------- |-----------| | Stability | [development]: logs | diff --git a/cmd/mdatagen/internal/samplescraper/internal/metadata/generated_config_test.go b/cmd/mdatagen/internal/samplescraper/internal/metadata/generated_config_test.go index d68dcc807a0..32903cc5e98 100644 --- a/cmd/mdatagen/internal/samplescraper/internal/metadata/generated_config_test.go +++ b/cmd/mdatagen/internal/samplescraper/internal/metadata/generated_config_test.go @@ -142,6 +142,6 @@ func loadResourceAttributesConfig(t *testing.T, name string) ResourceAttributesC sub, err = sub.Sub("resource_attributes") require.NoError(t, err) cfg := DefaultResourceAttributesConfig() - require.NoError(t, sub.Unmarshal(&cfg)) + require.NoError(t, sub.Unmarshal(&cfg, confmap.WithIgnoreUnused())) return cfg } diff --git a/cmd/mdatagen/internal/samplescraper/metadata.yaml b/cmd/mdatagen/internal/samplescraper/metadata.yaml index 27b7cb91b66..2ed4a2927a9 100644 --- a/cmd/mdatagen/internal/samplescraper/metadata.yaml +++ b/cmd/mdatagen/internal/samplescraper/metadata.yaml @@ -1,6 +1,8 @@ # Sample metadata file with all available configurations for a scraper. type: sample +display_name: Sample Scraper +description: This scraper is used for testing purposes to check the output of mdatagen. github_project: open-telemetry/opentelemetry-collector sem_conv_version: 1.37.0 diff --git a/cmd/mdatagen/internal/templates/component_test.go.tmpl b/cmd/mdatagen/internal/templates/component_test.go.tmpl index 1437e6637c5..0e8b6e416c0 100644 --- a/cmd/mdatagen/internal/templates/component_test.go.tmpl +++ b/cmd/mdatagen/internal/templates/component_test.go.tmpl @@ -16,6 +16,7 @@ import ( {{- end }} "github.com/stretchr/testify/require" + "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" {{- if not (and .Tests.SkipLifecycle .Tests.SkipShutdown) }} diff --git a/cmd/mdatagen/internal/templates/config_test.go.tmpl b/cmd/mdatagen/internal/templates/config_test.go.tmpl index 781a115c4a0..b6f604ae7d3 100644 --- a/cmd/mdatagen/internal/templates/config_test.go.tmpl +++ b/cmd/mdatagen/internal/templates/config_test.go.tmpl @@ -136,7 +136,7 @@ func loadResourceAttributesConfig(t *testing.T, name string) ResourceAttributesC sub, err = sub.Sub("resource_attributes") require.NoError(t, err) cfg := DefaultResourceAttributesConfig() - require.NoError(t, sub.Unmarshal(&cfg)) + require.NoError(t, sub.Unmarshal(&cfg, confmap.WithIgnoreUnused())) return cfg } {{- end }} diff --git a/cmd/mdatagen/internal/templates/logs.go.tmpl b/cmd/mdatagen/internal/templates/logs.go.tmpl index 9908069b816..2a648f818de 100644 --- a/cmd/mdatagen/internal/templates/logs.go.tmpl +++ b/cmd/mdatagen/internal/templates/logs.go.tmpl @@ -3,20 +3,26 @@ package {{ .Package }} import ( - "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/pdata/pcommon" - "go.opentelemetry.io/collector/pdata/plog" - {{- if or isReceiver isScraper }} - "go.opentelemetry.io/collector/{{ .Status.Class }}" + {{- if .Events }} + "context" {{- end }} {{- if .SemConvVersion }} + conventions "go.opentelemetry.io/otel/semconv/v{{ .SemConvVersion }}" {{- end }} {{- if .Events }} - "context" "go.opentelemetry.io/otel/trace" + {{- end }} + + "go.opentelemetry.io/collector/component" + {{- if .Events }} "go.opentelemetry.io/collector/filter" {{- end }} + "go.opentelemetry.io/collector/pdata/pcommon" + "go.opentelemetry.io/collector/pdata/plog" + {{- if or isReceiver isScraper }} + "go.opentelemetry.io/collector/{{ .Status.Class }}" + {{- end }} ) diff --git a/cmd/mdatagen/internal/templates/logs_test.go.tmpl b/cmd/mdatagen/internal/templates/logs_test.go.tmpl index d2c602e5176..8958ffe5e30 100644 --- a/cmd/mdatagen/internal/templates/logs_test.go.tmpl +++ b/cmd/mdatagen/internal/templates/logs_test.go.tmpl @@ -3,20 +3,24 @@ package {{ .Package }} import ( - "time" + {{- if .Events }} + "context" + {{- end }} "testing" + "time" + "github.com/stretchr/testify/assert" + {{- if .Events }} + "go.opentelemetry.io/otel/trace" + {{- end }} "go.uber.org/zap" "go.uber.org/zap/zaptest/observer" + "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/plog" {{- if or isReceiver isScraper }} "go.opentelemetry.io/collector/{{ .Status.Class }}/{{ .Status.Class }}test" {{- end }} - {{- if .Events }} - "context" - "go.opentelemetry.io/otel/trace" - {{- end }} ) {{- if .Events }} diff --git a/cmd/mdatagen/internal/templates/metrics.go.tmpl b/cmd/mdatagen/internal/templates/metrics.go.tmpl index faeb3aa1f88..51fdb2f480a 100644 --- a/cmd/mdatagen/internal/templates/metrics.go.tmpl +++ b/cmd/mdatagen/internal/templates/metrics.go.tmpl @@ -8,19 +8,20 @@ import ( "fmt" {{- end }} "time" + {{- if .SemConvVersion }} + + conventions "go.opentelemetry.io/otel/semconv/v{{ .SemConvVersion }}" + {{- end }} "go.opentelemetry.io/collector/component" + {{ if .ResourceAttributes -}} + "go.opentelemetry.io/collector/filter" + {{- end }} "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/pmetric" {{- if or isReceiver isScraper isConnector }} "go.opentelemetry.io/collector/{{ .Status.Class }}" {{- end }} - {{- if .SemConvVersion }} - conventions "go.opentelemetry.io/otel/semconv/v{{ .SemConvVersion }}" - {{- end }} - {{ if .ResourceAttributes -}} - "go.opentelemetry.io/collector/filter" - {{- end }} ) {{ range $name, $info := .Attributes }} diff --git a/cmd/mdatagen/internal/templates/metrics_test.go.tmpl b/cmd/mdatagen/internal/templates/metrics_test.go.tmpl index 63321920979..83fac389ed9 100644 --- a/cmd/mdatagen/internal/templates/metrics_test.go.tmpl +++ b/cmd/mdatagen/internal/templates/metrics_test.go.tmpl @@ -6,13 +6,14 @@ import ( "testing" "github.com/stretchr/testify/assert" + "go.uber.org/zap" + "go.uber.org/zap/zaptest/observer" + "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/pmetric" {{- if or isReceiver isScraper isConnector }} "go.opentelemetry.io/collector/{{ .Status.Class }}/{{ .Status.Class }}test" {{- end }} - "go.uber.org/zap" - "go.uber.org/zap/zaptest/observer" ) diff --git a/cmd/mdatagen/internal/templates/package_test.go.tmpl b/cmd/mdatagen/internal/templates/package_test.go.tmpl index 892248f63df..f16f674b4da 100644 --- a/cmd/mdatagen/internal/templates/package_test.go.tmpl +++ b/cmd/mdatagen/internal/templates/package_test.go.tmpl @@ -4,12 +4,12 @@ package {{ if isCommand -}}main{{ else }}{{ .Package }}{{- end }} import ( {{- if .Tests.GoLeak.Skip }} - "os" + "os" {{- end }} "testing" - {{- if not .Tests.GoLeak.Skip }} - "go.uber.org/goleak" + + "go.uber.org/goleak" {{- end }} ) diff --git a/cmd/mdatagen/internal/templates/readme.md.tmpl b/cmd/mdatagen/internal/templates/readme.md.tmpl index 74ff711b8d1..328a69f0443 100644 --- a/cmd/mdatagen/internal/templates/readme.md.tmpl +++ b/cmd/mdatagen/internal/templates/readme.md.tmpl @@ -1,4 +1,12 @@ +{{- if .DisplayName }} +# {{ .DisplayName }} + +{{- end }} +{{- if .Description }} +{{ .Description }} + +{{ end -}} {{- if len .Status.Stability }} | Status | | | ------------- |-----------| diff --git a/cmd/mdatagen/internal/testdata/display_name.yaml b/cmd/mdatagen/internal/testdata/display_name.yaml new file mode 100644 index 00000000000..ea5f9088ecf --- /dev/null +++ b/cmd/mdatagen/internal/testdata/display_name.yaml @@ -0,0 +1,7 @@ +type: test +display_name: Test Receiver + +status: + class: receiver + stability: + beta: [logs] diff --git a/cmd/mdatagen/internal/testdata/empty_test_config.yaml b/cmd/mdatagen/internal/testdata/empty_test_config.yaml index 5b13e2dff33..347cb88d2a4 100644 --- a/cmd/mdatagen/internal/testdata/empty_test_config.yaml +++ b/cmd/mdatagen/internal/testdata/empty_test_config.yaml @@ -1,4 +1,5 @@ type: test +display_name: Test status: class: receiver diff --git a/cmd/mdatagen/internal/testdata/generated_package_name.yaml b/cmd/mdatagen/internal/testdata/generated_package_name.yaml index a880e69e608..23f78cb0aa4 100644 --- a/cmd/mdatagen/internal/testdata/generated_package_name.yaml +++ b/cmd/mdatagen/internal/testdata/generated_package_name.yaml @@ -1,4 +1,5 @@ type: custom +display_name: Custom generated_package_name: customname diff --git a/cmd/mdatagen/internal/testdata/no_display_name.yaml b/cmd/mdatagen/internal/testdata/no_display_name.yaml new file mode 100644 index 00000000000..0e7f304c2fc --- /dev/null +++ b/cmd/mdatagen/internal/testdata/no_display_name.yaml @@ -0,0 +1,6 @@ +type: nodisplayname + +status: + class: receiver + stability: + beta: [logs] diff --git a/cmd/mdatagen/internal/testdata/parent.yaml b/cmd/mdatagen/internal/testdata/parent.yaml index 1f8fc15ba17..fe12b3b0311 100644 --- a/cmd/mdatagen/internal/testdata/parent.yaml +++ b/cmd/mdatagen/internal/testdata/parent.yaml @@ -1,3 +1,4 @@ type: subcomponent +display_name: Subcomponent parent: parentComponent \ No newline at end of file diff --git a/cmd/mdatagen/internal/testdata/with_description.yaml b/cmd/mdatagen/internal/testdata/with_description.yaml new file mode 100644 index 00000000000..fc6fec3f72e --- /dev/null +++ b/cmd/mdatagen/internal/testdata/with_description.yaml @@ -0,0 +1,8 @@ +type: test +display_name: Test Component +description: This is a test component used to validate the description field functionality in mdatagen. +status: + class: receiver + stability: + beta: [metrics] + distributions: [] diff --git a/cmd/mdatagen/metadata-schema.yaml b/cmd/mdatagen/metadata-schema.yaml index e11880d26b3..c17b69cad21 100644 --- a/cmd/mdatagen/metadata-schema.yaml +++ b/cmd/mdatagen/metadata-schema.yaml @@ -1,6 +1,12 @@ # Required: The type of the component - Usually the name. The type and class combined uniquely identify the component (eg. receiver/otlp) or subcomponent (eg. receiver/hostmetricsreceiver/cpu) type: +# Optional: Human-readable display name for the component. If not set, the type field will be used. +display_name: string + +# Optional: Brief description of the component that will be included in the generated README. +description: string + # Required for subcomponents: The type of the parent component. parent: string