Skip to content

Commit

Permalink
Add opentelemetry-collector-builder with Makefile and Github Action t…
Browse files Browse the repository at this point in the history
…o build on PR (#1300)
  • Loading branch information
pmalek-sumo authored and pmalek committed May 13, 2021
1 parent 44bb259 commit cf09a91
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/opentelemetry-collector-builder.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: OpenTelemetry Collector Builder

on:
pull_request:
branches:
- main

jobs:
# otelcolbuilder_post_go1_16:
# runs-on: ubuntu-20.04
# strategy:
# matrix:
# go: [ '1.16' ]
# steps:
# - uses: actions/checkout@v2
# - name: Setup go
# uses: actions/setup-go@v2
# with:
# go-version: ${{ matrix.go }}
# - name: Print go version
# run: go version
# - name: Build OpenTelemetry distro
# working-directory: ./otelcolbuilder/
# run: |
# go install github.com/open-telemetry/opentelemetry-collector-builder@v0.24.0
# make build

# Just build on 1.15 for now because of a weird issue:
# https://github.com/actions/setup-go/issues/107
otelcolbuilder_pre_go1_16:
runs-on: ubuntu-20.04
strategy:
matrix:
go: [ '1.15' ]
steps:
- uses: actions/checkout@v2
- name: Setup go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go }}
- name: Print go version
run: go version
- name: Print go env
run: go env
- name: Build OpenTelemetry distro
working-directory: ./otelcolbuilder/
run: |
make install-prego1.16
make build
1 change: 1 addition & 0 deletions otelcolbuilder/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
cmd/
28 changes: 28 additions & 0 deletions otelcolbuilder/.otelcol-builder.yaml
Original file line number Diff line number Diff line change
@@ -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
8 changes: 8 additions & 0 deletions otelcolbuilder/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
install:
go install github.com/open-telemetry/opentelemetry-collector-builder@v0.24.0

install-prego1.16:
GO111MODULE=on go get github.com/open-telemetry/opentelemetry-collector-builder@v0.24.0

build:
opentelemetry-collector-builder --config .otelcol-builder.yaml

0 comments on commit cf09a91

Please sign in to comment.