diff --git a/.chloggen/add_distribution_owners.yaml b/.chloggen/add_distribution_owners.yaml new file mode 100755 index 000000000000..b01201bf13e8 --- /dev/null +++ b/.chloggen/add_distribution_owners.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. filelogreceiver) +component: githubgen + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Adds a set of distribution reports that can be used to notify distribution maintainers of any changes to distributions. + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [28628] + +# (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: + +# If your change doesn't affect end users or the exported elements of any package, +# you should instead start your pull request title with [chore] or use the "Skip Changelog" label. +# 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: [] diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 5570b6902d18..e5538cab31b8 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -271,6 +271,21 @@ testbed/ @open-telemetry/collect testbed/mockdatareceivers/mockawsxrayreceiver/ @open-telemetry/collector-contrib-approvers @wangzlei @srprash testbed/mockdatasenders/mockdatadogagentexporter/ @open-telemetry/collector-contrib-approvers @boostchicken +##################################################### +# +# List of distribution maintainers for OpenTelemetry Collector Contrib +# +##################################################### +reports/distributions/core.yaml @open-telemetry/collector-contrib-approvers +reports/distributions/contrib.yaml @open-telemetry/collector-contrib-approvers +reports/distributions/aws.yaml @open-telemetry/collector-contrib-approvers +reports/distributions/grafana.yaml @open-telemetry/collector-contrib-approvers +reports/distributions/observiq.yaml @open-telemetry/collector-contrib-approvers +reports/distributions/redhat.yaml @open-telemetry/collector-contrib-approvers +reports/distributions/splunk.yaml @open-telemetry/collector-contrib-approvers atoulme dmitryax hughesjj rfitzpatrick +reports/distributions/sumo.yaml @open-telemetry/collector-contrib-approvers +reports/distributions/liatrio.yaml @open-telemetry/collector-contrib-approvers + ## UNMAINTAINED components diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 3352e376b295..cf29ef35e036 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -207,6 +207,10 @@ jobs: run: | make genoteltestbedcol git diff -s --exit-code || (echo 'Generated code is out of date, please run "make genoteltestbedcol" and commit the changes in this PR.' && exit 1) + - name: Gen distributions + run: | + make gendistributions + git diff -s --exit-code || (echo 'Generated code is out of date, please run "make gendistributions" and commit the changes in this PR.' && exit 1) - name: CodeGen run: | make -j2 generate diff --git a/Makefile b/Makefile index f308b4c6b306..e9ffe1f40113 100644 --- a/Makefile +++ b/Makefile @@ -232,11 +232,18 @@ mdatagen-test: cd cmd/mdatagen && $(GOCMD) generate ./... cd cmd/mdatagen && $(GOCMD) test ./... -.PHONY: gengithub -gengithub: +.PHONY: githubgen-install +githubgen-install: cd cmd/githubgen && $(GOCMD) install . + +.PHONY: gengithub +gengithub: githubgen-install githubgen +.PHONY: gendistributions +gendistributions: githubgen-install + githubgen distributions + .PHONY: update-codeowners update-codeowners: gengithub generate diff --git a/cmd/githubgen/allowlist.txt b/cmd/githubgen/allowlist.txt index 61b1f77d378d..834669e83c64 100644 --- a/cmd/githubgen/allowlist.txt +++ b/cmd/githubgen/allowlist.txt @@ -7,7 +7,6 @@ agoallikmaa architjugran asaharn billmeyer -braydonk emreyalvac keep94 kiranmayib @@ -22,3 +21,4 @@ am-kinetica mcube8 sokoide zdaratom +braydonk diff --git a/cmd/githubgen/codeowners.go b/cmd/githubgen/codeowners.go index d467e04bb9eb..39f1d373e8b1 100644 --- a/cmd/githubgen/codeowners.go +++ b/cmd/githubgen/codeowners.go @@ -62,6 +62,14 @@ const codeownersHeader = `# Code generated by githubgen. DO NOT EDIT. * @open-telemetry/collector-contrib-approvers ` +const distributionCodeownersHeader = ` +##################################################### +# +# List of distribution maintainers for OpenTelemetry Collector Contrib +# +##################################################### +` + type codeownersGenerator struct { } @@ -140,6 +148,17 @@ LOOP: } } + codeowners += distributionCodeownersHeader + longestName := 0 + for _, dist := range data.distributions { + if longestName < len(dist.Name) { + longestName = len(dist.Name) + } + } + for _, dist := range data.distributions { + codeowners += fmt.Sprintf("reports/distributions/%s.yaml%s @open-telemetry/collector-contrib-approvers %s\n", dist.Name, strings.Repeat(" ", longestName-len(dist.Name)), strings.Join(dist.Maintainers, " ")) + } + err = os.WriteFile(filepath.Join(".github", "CODEOWNERS"), []byte(codeowners+unmaintainedCodeowners), 0600) if err != nil { return err diff --git a/cmd/githubgen/distributions.go b/cmd/githubgen/distributions.go new file mode 100644 index 000000000000..c5629430b731 --- /dev/null +++ b/cmd/githubgen/distributions.go @@ -0,0 +1,63 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package main + +import ( + "fmt" + "os" + "path/filepath" + "sort" + + "gopkg.in/yaml.v3" +) + +type distributionsGenerator struct { +} + +type distOutput struct { + Name string `yaml:"name"` + URL string `yaml:"url"` + Maintainers []string `yaml:"maintainers"` + Components map[string][]string `yaml:"components"` +} + +func (cg distributionsGenerator) generate(data *githubData) error { + for _, dist := range data.distributions { + components := map[string][]string{} + for _, c := range data.components { + inDistro := false + for _, componentDistro := range c.Status.Distributions { + if dist.Name == componentDistro { + inDistro = true + break + } + } + if inDistro { + array, ok := components[c.Status.Class] + if !ok { + array = []string{} + } + components[c.Status.Class] = append(array, c.Type) + } + } + for _, comps := range components { + sort.Strings(comps) + } + output := distOutput{ + Name: dist.Name, + URL: dist.URL, + Maintainers: dist.Maintainers, + Components: components, + } + b, err := yaml.Marshal(output) + if err != nil { + return nil + } + err = os.WriteFile(filepath.Join("reports", "distributions", fmt.Sprintf("%s.yaml", dist.Name)), b, 0600) + if err != nil { + return nil + } + } + return nil +} diff --git a/cmd/githubgen/go.mod b/cmd/githubgen/go.mod index 7cb90df35616..3569093338c7 100644 --- a/cmd/githubgen/go.mod +++ b/cmd/githubgen/go.mod @@ -5,6 +5,7 @@ go 1.20 require ( github.com/google/go-github/v53 v53.2.0 go.opentelemetry.io/collector/confmap v0.91.0 + gopkg.in/yaml.v3 v3.0.1 ) require ( @@ -27,5 +28,4 @@ require ( golang.org/x/sys v0.14.0 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/protobuf v1.31.0 // indirect - gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/cmd/githubgen/main.go b/cmd/githubgen/main.go index 6c3fbcb46b88..c07891dab16f 100644 --- a/cmd/githubgen/main.go +++ b/cmd/githubgen/main.go @@ -9,10 +9,12 @@ import ( "fmt" "io/fs" "log" + "os" "path/filepath" "sort" "go.opentelemetry.io/collector/confmap/provider/fileprovider" + "gopkg.in/yaml.v3" ) const unmaintainedStatus = "unmaintained" @@ -25,6 +27,7 @@ type generator interface { // .github/CODEOWNERS // .github/ALLOWLIST // .github/ISSUE_TEMPLATES/*.yaml (list of components) +// reports/distributions/* func main() { folder := flag.String("folder", ".", "folder investigated for codeowners") allowlistFilePath := flag.String("allowlist", "cmd/githubgen/allowlist.txt", "path to a file containing an allowlist of members outside the OpenTelemetry organization") @@ -36,6 +39,8 @@ func main() { generators = append(generators, issueTemplatesGenerator{}) case "codeowners": generators = append(generators, codeownersGenerator{}) + case "distributions": + generators = append(generators, distributionsGenerator{}) default: panic(fmt.Sprintf("Unknown generator: %s", arg)) } @@ -71,12 +76,19 @@ type metadata struct { Status *Status `mapstructure:"status"` } +type distributionData struct { + Name string `yaml:"name"` + URL string `yaml:"url"` + Maintainers []string `yaml:"maintainers,omitempty"` +} + type githubData struct { folders []string codeowners []string allowlistFilePath string maxLength int components map[string]metadata + distributions []distributionData } func loadMetadata(filePath string) (metadata, error) { @@ -147,12 +159,23 @@ func run(folder string, allowlistFilePath string, generators []generator) error } sort.Strings(codeownersList) + var distributions []distributionData + dd, err := os.ReadFile(filepath.Join(folder, "distributions.yaml")) + if err != nil { + return err + } + err = yaml.Unmarshal(dd, &distributions) + if err != nil { + return err + } + data := &githubData{ folders: foldersList, codeowners: codeownersList, allowlistFilePath: allowlistFilePath, maxLength: maxLength, components: components, + distributions: distributions, } for _, g := range generators { diff --git a/distributions.yaml b/distributions.yaml new file mode 100644 index 000000000000..716914d6c29d --- /dev/null +++ b/distributions.yaml @@ -0,0 +1,27 @@ +# A collection of distributions that can be referenced in the metadata.yaml files. +# The rules below apply to every distribution added to this list: +# - The distribution must be open source. +# - The link must point to a publicly accessible repository. + - name: core + url: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol + - name: contrib + url: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib + - name: aws + url: https://github.com/aws-observability/aws-otel-collector + - name: grafana + url: https://github.com/grafana/agent + - name: observiq + url: https://github.com/observIQ/observiq-otel-collector + - name: redhat + url: https://github.com/os-observability/redhat-opentelemetry-collector + - name: splunk + url: https://github.com/signalfx/splunk-otel-collector + maintainers: + - atoulme + - dmitryax + - hughesjj + - rfitzpatrick + - name: sumo + url: https://github.com/SumoLogic/sumologic-otel-collector + - name: liatrio + url: https://github.com/liatrio/liatrio-otel-collector \ No newline at end of file diff --git a/reports/distributions/aws.yaml b/reports/distributions/aws.yaml new file mode 100644 index 000000000000..a69fd8cc5245 --- /dev/null +++ b/reports/distributions/aws.yaml @@ -0,0 +1,46 @@ +name: aws +url: https://github.com/aws-observability/aws-otel-collector +maintainers: [] +components: + exporter: + - awsemf + - awsxray + - datadog + - dynatrace + - file + - kafka + - loadbalancing + - logzio + - prometheus + - prometheusremotewrite + - sapm + - signalfx + extension: + - awsproxy + - ecs_observer + - health_check + - pprof + - sigv4auth + processor: + - attributes + - cumulativetodelta + - deltatorate + - experimental_metricsgeneration + - filter + - groupbytrace + - k8sattributes + - metricstransform + - probabilistic_sampler + - resource + - resourcedetection + - span + - tail_sampling + receiver: + - awscontainerinsightreceiver + - awsecscontainermetrics + - awsxray + - jaeger + - kafka + - prometheus + - statsd + - zipkin diff --git a/reports/distributions/contrib.yaml b/reports/distributions/contrib.yaml new file mode 100644 index 000000000000..f5746848b2b1 --- /dev/null +++ b/reports/distributions/contrib.yaml @@ -0,0 +1,187 @@ +name: contrib +url: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib +maintainers: [] +components: + connector: + - count + - datadog + - exceptions + - failover + - routing + - servicegraph + - spanmetrics + exporter: + - alertmanager + - alibabacloud_logservice + - awscloudwatchlogs + - awsemf + - awskinesis + - awss3 + - awsxray + - azuredataexplorer + - azuremonitor + - carbon + - cassandra + - clickhouse + - coralogix + - datadog + - dataset + - dynatrace + - elasticsearch + - f5cloud + - file + - googlecloud + - googlecloudpubsub + - googlemanagedprometheus + - honeycombmarker + - influxdb + - instana + - kafka + - loadbalancing + - logicmonitor + - logzio + - loki + - mezmo + - opencensus + - prometheus + - prometheusremotewrite + - pulsar + - sapm + - sentry + - signalfx + - skywalking + - splunk_hec + - sumologic + - syslog + - tanzuobservability + - tencentcloud_logservice + - zipkin + extension: + - asapclient + - awsproxy + - basicauth + - bearertokenauth + - db_storage + - docker_observer + - ecs_observer + - ecs_task_observer + - file_storage + - headers_setter + - health_check + - host_observer + - http_forwarder + - jaegerremotesampling + - k8s_observer + - oauth2client + - oidc + - pprof + - sigv4auth + processor: + - attributes + - cumulativetodelta + - datadog + - deltatorate + - experimental_metricsgeneration + - filter + - groupbyattrs + - groupbytrace + - k8sattributes + - metricstransform + - probabilistic_sampler + - redaction + - remotetap + - resource + - resourcedetection + - routing + - servicegraph + - span + - spanmetrics + - sumologic + - tail_sampling + - transform + receiver: + - active_directory_ds + - aerospike + - apache + - apachespark + - awscloudwatch + - awscloudwatchmetrics + - awscontainerinsightreceiver + - awsecscontainermetrics + - awsfirehose + - awsxray + - azureblob + - azureeventhub + - azuremonitor + - bigip + - carbon + - chrony + - cloudflare + - cloudfoundry + - collectd + - couchdb + - datadog + - docker_stats + - elasticsearch + - expvar + - file + - filelog + - filestats + - flinkmetrics + - fluentforward + - googlecloudspanner + - haproxy + - hostmetrics + - httpcheck + - iis + - influxdb + - jaeger + - jmx + - journald + - k8s_cluster + - k8s_events + - k8sobjects + - kafka + - kafkametrics + - kubeletstats + - loki + - memcached + - mongodb + - mongodbatlas + - mysql + - nginx + - nsxt + - opencensus + - oracledb + - otlpjsonfile + - podman_stats + - postgresql + - prometheus + - prometheus_simple + - pulsar + - purefa + - purefb + - rabbitmq + - receiver_creator + - redis + - riak + - saphana + - sapm + - signalfx + - skywalking + - snmp + - snowflake + - solace + - splunk_hec + - sqlquery + - sqlserver + - sshcheck + - statsd + - syslog + - tcplog + - udplog + - vcenter + - wavefront + - windowsperfcounters + - zipkin + - zookeeper diff --git a/reports/distributions/core.yaml b/reports/distributions/core.yaml new file mode 100644 index 000000000000..4dcbb1de3d92 --- /dev/null +++ b/reports/distributions/core.yaml @@ -0,0 +1,24 @@ +name: core +url: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol +maintainers: [] +components: + exporter: + - file + - prometheus + - prometheusremotewrite + - zipkin + extension: + - health_check + - pprof + processor: + - attributes + - filter + - probabilistic_sampler + - resource + - span + receiver: + - hostmetrics + - jaeger + - opencensus + - prometheus + - zipkin diff --git a/reports/distributions/grafana.yaml b/reports/distributions/grafana.yaml new file mode 100644 index 000000000000..a5d8add005d8 --- /dev/null +++ b/reports/distributions/grafana.yaml @@ -0,0 +1,30 @@ +name: grafana +url: https://github.com/grafana/agent +maintainers: [] +components: + connector: + - servicegraph + - spanmetrics + exporter: + - loadbalancing + - prometheus + extension: + - basicauth + - bearertokenauth + - headers_setter + - jaegerremotesampling + - oauth2client + - sigv4auth + processor: + - attributes + - k8sattributes + - probabilistic_sampler + - span + - tail_sampling + - transform + receiver: + - jaeger + - kafka + - opencensus + - prometheus + - zipkin diff --git a/reports/distributions/liatrio.yaml b/reports/distributions/liatrio.yaml new file mode 100644 index 000000000000..6f5136b67e5d --- /dev/null +++ b/reports/distributions/liatrio.yaml @@ -0,0 +1,6 @@ +name: liatrio +url: https://github.com/liatrio/liatrio-otel-collector +maintainers: [] +components: + receiver: + - gitprovider diff --git a/reports/distributions/observiq.yaml b/reports/distributions/observiq.yaml new file mode 100644 index 000000000000..edcc9522076c --- /dev/null +++ b/reports/distributions/observiq.yaml @@ -0,0 +1,117 @@ +name: observiq +url: https://github.com/observIQ/observiq-otel-collector +maintainers: [] +components: + exporter: + - alibabacloud_logservice + - awscloudwatchlogs + - awsemf + - awskinesis + - awss3 + - awsxray + - azuremonitor + - carbon + - coralogix + - datadog + - dynatrace + - elasticsearch + - f5cloud + - file + - googlecloud + - googlecloudpubsub + - googlemanagedprometheus + - influxdb + - kafka + - loadbalancing + - logzio + - loki + - opencensus + - prometheus + - prometheusremotewrite + - sapm + - signalfx + - splunk_hec + - zipkin + extension: + - basicauth + - bearertokenauth + - file_storage + - health_check + - oidc + - pprof + processor: + - attributes + - cumulativetodelta + - deltatorate + - filter + - groupbyattrs + - groupbytrace + - k8sattributes + - logstransform + - metricstransform + - probabilistic_sampler + - resource + - resourcedetection + - routing + - span + - spanmetrics + - tail_sampling + - transform + receiver: + - active_directory_ds + - aerospike + - apache + - awscloudwatch + - awscontainerinsightreceiver + - awsecscontainermetrics + - awsfirehose + - awsxray + - azureeventhub + - bigip + - carbon + - cloudflare + - cloudfoundry + - collectd + - couchdb + - docker_stats + - elasticsearch + - filelog + - flinkmetrics + - fluentforward + - googlecloudpubsub + - googlecloudspanner + - hostmetrics + - iis + - influxdb + - jaeger + - jmx + - journald + - k8s_cluster + - k8s_events + - kafka + - kubeletstats + - memcached + - mongodb + - mongodbatlas + - mysql + - nginx + - opencensus + - podman_stats + - postgresql + - prometheus + - prometheus_simple + - rabbitmq + - redis + - riak + - saphana + - sapm + - sqlquery + - sqlserver + - syslog + - tcplog + - udplog + - vcenter + - windowseventlog + - windowsperfcounters + - zipkin + - zookeeper diff --git a/reports/distributions/redhat.yaml b/reports/distributions/redhat.yaml new file mode 100644 index 000000000000..0edb828817a9 --- /dev/null +++ b/reports/distributions/redhat.yaml @@ -0,0 +1,25 @@ +name: redhat +url: https://github.com/os-observability/redhat-opentelemetry-collector +maintainers: [] +components: + exporter: + - prometheus + extension: + - basicauth + - bearertokenauth + - health_check + - jaegerremotesampling + - oauth2client + - pprof + processor: + - attributes + - filter + - k8sattributes + - resource + - resourcedetection + - routing + - span + receiver: + - jaeger + - opencensus + - zipkin diff --git a/reports/distributions/splunk.yaml b/reports/distributions/splunk.yaml new file mode 100644 index 000000000000..500f1dc77392 --- /dev/null +++ b/reports/distributions/splunk.yaml @@ -0,0 +1,82 @@ +name: splunk +url: https://github.com/signalfx/splunk-otel-collector +maintainers: + - atoulme + - dmitryax + - hughesjj + - rfitzpatrick +components: + connector: + - spanmetrics + exporter: + - file + - kafka + - loadbalancing + - pulsar + - sapm + - signalfx + - splunk_hec + extension: + - basicauth + - docker_observer + - ecs_observer + - ecs_task_observer + - file_storage + - health_check + - host_observer + - http_forwarder + - k8s_observer + - pprof + processor: + - attributes + - filter + - groupbyattrs + - k8sattributes + - logstransform + - metricstransform + - probabilistic_sampler + - resource + - resourcedetection + - routing + - span + - spanmetrics + - tail_sampling + - transform + receiver: + - azureeventhub + - carbon + - cloudfoundry + - collectd + - filelog + - fluentforward + - hostmetrics + - jaeger + - jmx + - journald + - k8s_cluster + - k8s_events + - k8sobjects + - kafka + - kafkametrics + - kubeletstats + - mongodbatlas + - mysql + - oracledb + - postgresql + - prometheus + - prometheus_simple + - receiver_creator + - redis + - sapm + - signalfx + - solace + - splunk_hec + - sqlquery + - statsd + - syslog + - tcplog + - udplog + - wavefront + - windowseventlog + - windowsperfcounters + - zipkin diff --git a/reports/distributions/sumo.yaml b/reports/distributions/sumo.yaml new file mode 100644 index 000000000000..a02bbf0d3461 --- /dev/null +++ b/reports/distributions/sumo.yaml @@ -0,0 +1,137 @@ +name: sumo +url: https://github.com/SumoLogic/sumologic-otel-collector +maintainers: [] +components: + connector: + - count + - servicegraph + - spanmetrics + exporter: + - awss3 + - carbon + - file + - kafka + - loadbalancing + - prometheus + extension: + - asapclient + - awsproxy + - basicauth + - bearertokenauth + - db_storage + - docker_observer + - ecs_observer + - ecs_task_observer + - file_storage + - headers_setter + - health_check + - host_observer + - http_forwarder + - jaegerremotesampling + - k8s_observer + - oauth2client + - oidc + - pprof + - sigv4auth + processor: + - attributes + - cumulativetodelta + - deltatorate + - experimental_metricsgeneration + - filter + - groupbyattrs + - groupbytrace + - k8sattributes + - logstransform + - metricstransform + - probabilistic_sampler + - redaction + - resource + - resourcedetection + - routing + - schema + - servicegraph + - span + - spanmetrics + - sumologic + - tail_sampling + - transform + receiver: + - active_directory_ds + - aerospike + - apache + - awscloudwatch + - awscontainerinsightreceiver + - awsecscontainermetrics + - awsfirehose + - awsxray + - azureeventhub + - bigip + - carbon + - cloudflare + - cloudfoundry + - collectd + - couchdb + - datadog + - docker_stats + - elasticsearch + - expvar + - filelog + - filestats + - flinkmetrics + - fluentforward + - googlecloudpubsub + - googlecloudspanner + - haproxy + - hostmetrics + - httpcheck + - iis + - influxdb + - jaeger + - jmx + - journald + - k8s_cluster + - k8s_events + - k8sobjects + - kafka + - kafkametrics + - kubeletstats + - loki + - memcached + - mongodb + - mongodbatlas + - mysql + - nginx + - nsxt + - opencensus + - otlpjsonfile + - podman_stats + - postgresql + - prometheus + - prometheus_simple + - purefa + - purefb + - rabbitmq + - receiver_creator + - redis + - riak + - saphana + - sapm + - signalfx + - skywalking + - snmp + - solace + - splunk_hec + - sqlquery + - sqlserver + - sshcheck + - statsd + - syslog + - tcplog + - udplog + - vcenter + - wavefront + - windowseventlog + - windowsperfcounters + - zipkin + - zookeeper