diff --git a/.github/workflows/opentelemetry-collector-builder.yaml b/.github/workflows/opentelemetry-collector-builder.yaml new file mode 100644 index 000000000000..ecd8b0c7fc0b --- /dev/null +++ b/.github/workflows/opentelemetry-collector-builder.yaml @@ -0,0 +1,21 @@ +name: OpenTelemetry Collector Builder + +on: + pull_request: + branches: + - main + +jobs: + otelcolbuilder: + runs-on: ubuntu-20.04 + strategy: + matrix: + go: [ '1.16', '1.15', '1.14' ] + steps: + - uses: actions/checkout@v2 + - name: Setup go + uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go }} + working-directory: ./otelcolbuilder/ + run: make build diff --git a/otelcolbuilder/.gitignore b/otelcolbuilder/.gitignore new file mode 100644 index 000000000000..b3087b09750d --- /dev/null +++ b/otelcolbuilder/.gitignore @@ -0,0 +1 @@ +cmd/ diff --git a/otelcolbuilder/.otelcol-builder.yaml b/otelcolbuilder/.otelcol-builder.yaml new file mode 100644 index 000000000000..ef9dcbc27bf7 --- /dev/null +++ b/otelcolbuilder/.otelcol-builder.yaml @@ -0,0 +1,28 @@ +dist: + name: otelcol-sumo + description: Sumo Logic OpenTelemetry Collector distribution + + # the module name for the new distribution, following Go mod conventions. Optional, but recommended. + module: github.com/SumoLogic/opentelemetry-collector-builder + + otelcol_version: 0.24.0 # the OpenTelemetry Collector version to use as base for the distribution. + output_path: ./cmd/ # the path to write the output (sources and binary). + +processors: + - gomod: "github.com/open-telemetry/opentelemetry-collector-contrib/processor/cascadingfilterprocessor v0.24.0" + - gomod: "github.com/open-telemetry/opentelemetry-collector-contrib/processor/k8sprocessor v0.24.0" + - gomod: "github.com/open-telemetry/opentelemetry-collector-contrib/processor/sourceprocessor v0.24.0" + +exporters: + - gomod: "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/sumologicexporter v0.24.0" + +# Replacement paths are relative to the output_path (location of source files) +replaces: + - github.com/open-telemetry/opentelemetry-collector-contrib/processor/cascadingfilterprocessor => ./../../processor/cascadingfilterprocessor + + - github.com/open-telemetry/opentelemetry-collector-contrib/processor/k8sprocessor => ./../../processor/k8sprocessor + - github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8sconfig => ./../../internal/k8sconfig + + - github.com/open-telemetry/opentelemetry-collector-contrib/processor/sourceprocessor => ./../../processor/sourceprocessor + + - go.opentelemetry.io/collector => github.com/SumoLogic/opentelemetry-collector v0.24.0-sumo diff --git a/otelcolbuilder/Makefile b/otelcolbuilder/Makefile new file mode 100644 index 000000000000..7886c1c67839 --- /dev/null +++ b/otelcolbuilder/Makefile @@ -0,0 +1,5 @@ +install: + go install github.com/open-telemetry/opentelemetry-collector-builder@v0.24.0 + +build: install + opentelemetry-collector-builder --config .otelcol-builder.yaml