From 5ddd7d9ec2e54d7e8a8e91ae6685297a01e7624d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juraci=20Paix=C3=A3o=20Kr=C3=B6hling?= Date: Thu, 16 Dec 2021 17:27:34 +0100 Subject: [PATCH] Add otelcol-contrib release (#43) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add otelcol-contrib release Fixes #37 * Increase timeout for goreleaser * Remove arches with problems building contrib Signed-off-by: Juraci Paixão Kröhling --- .github/workflows/ci-goreleaser.yaml | 2 +- .github/workflows/release.yaml | 2 +- .goreleaser.yaml | 74 ++++++++++- Makefile | 2 +- configs/otelcol-contrib.yaml | 55 ++++++++ distributions/otelcol-contrib/Dockerfile | 20 +++ .../otelcol-contrib/distribution.conf | 1 + distributions/otelcol-contrib/manifest.yaml | 119 ++++++++++++++++++ .../otelcol-contrib/otelcol-contrib.conf | 5 + .../otelcol-contrib/otelcol-contrib.service | 15 +++ distributions/otelcol-contrib/postinstall.sh | 22 ++++ distributions/otelcol-contrib/preinstall.sh | 17 +++ distributions/otelcol-contrib/preremove.sh | 20 +++ distributions/otelcol/Dockerfile | 4 +- scripts/build.sh | 2 +- .../goreleaser-templates/builds.template.yaml | 5 - .../goreleaser-templates/nfpms.template.yaml | 1 + 17 files changed, 350 insertions(+), 16 deletions(-) create mode 100644 configs/otelcol-contrib.yaml create mode 100644 distributions/otelcol-contrib/Dockerfile create mode 100644 distributions/otelcol-contrib/distribution.conf create mode 100644 distributions/otelcol-contrib/manifest.yaml create mode 100644 distributions/otelcol-contrib/otelcol-contrib.conf create mode 100644 distributions/otelcol-contrib/otelcol-contrib.service create mode 100755 distributions/otelcol-contrib/postinstall.sh create mode 100755 distributions/otelcol-contrib/preinstall.sh create mode 100755 distributions/otelcol-contrib/preremove.sh diff --git a/.github/workflows/ci-goreleaser.yaml b/.github/workflows/ci-goreleaser.yaml index 92160d1b..65275ff9 100644 --- a/.github/workflows/ci-goreleaser.yaml +++ b/.github/workflows/ci-goreleaser.yaml @@ -30,4 +30,4 @@ jobs: uses: goreleaser/goreleaser-action@v2 with: version: latest - args: --snapshot --rm-dist + args: --snapshot --rm-dist --timeout 1h diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index fb542550..01e6af98 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -31,6 +31,6 @@ jobs: uses: goreleaser/goreleaser-action@v2 with: version: latest - args: release --rm-dist + args: release --rm-dist --timeout 1h env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.goreleaser.yaml b/.goreleaser.yaml index b98bb064..35307b53 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -6,6 +6,10 @@ archives: name_template: "{{ .Binary }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}_{{ .Mips }}{{ end }}" builds: - "otelcol" + - id: "otelcol-contrib" + name_template: "{{ .Binary }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}_{{ .Mips }}{{ end }}" + builds: + - "otelcol-contrib" builds: - id: "otelcol" dir: "distributions/otelcol/_build" @@ -19,12 +23,29 @@ builds: goarch: - 386 - amd64 - - arm - arm64 - - s390x - goarm: - - 6 - - 7 + flags: + - -trimpath + ldflags: + - -s -w + ignore: + - goos: windows + goarch: arm + - goos: windows + goarch: arm64 + - id: "otelcol-contrib" + dir: "distributions/otelcol-contrib/_build" + binary: "otelcol-contrib" + env: + - CGO_ENABLED=0 + goos: + - darwin + - linux + - windows + goarch: + - 386 + - amd64 + - arm64 flags: - -trimpath ldflags: @@ -35,10 +56,28 @@ builds: - goos: windows goarch: arm64 docker_manifests: + - name_template: otel/opentelemetry-collector-contrib:{{ .Version }} + image_templates: + - otel/opentelemetry-collector-contrib:{{ .Version }}-amd64 - name_template: otel/opentelemetry-collector:{{ .Version }} image_templates: - otel/opentelemetry-collector:{{ .Version }}-amd64 dockers: + - image_templates: + - "otel/opentelemetry-collector-contrib:{{ .Version }}-amd64" + dockerfile: "distributions/otelcol-contrib/Dockerfile" + use: buildx + build_flag_templates: + - "--pull" + - "--label=org.opencontainers.image.created={{.Date}}" + - "--label=org.opencontainers.image.name={{.ProjectName}}" + - "--label=org.opencontainers.image.revision={{.FullCommit}}" + - "--label=org.opencontainers.image.version={{.Version}}" + - "--label=org.opencontainers.image.source={{.GitURL}}" + - "--platform=linux/amd64" + extra_files: + - "configs/otelcol-contrib.yaml" + goarch: amd64 - image_templates: - "otel/opentelemetry-collector:{{ .Version }}-amd64" dockerfile: "distributions/otelcol/Dockerfile" @@ -55,10 +94,35 @@ dockers: - "configs/otelcol.yaml" goarch: amd64 nfpms: + - id: "otelcol-contrib" + package_name: "otelcol-contrib" + license: Apache 2.0 + description: "OpenTelemetry Collector - otelcol-contrib" + maintainer: The OpenTelemetry Collector maintainers + formats: + - apk + - deb + - rpm + scripts: + preinstall: "distributions/otelcol-contrib/preinstall.sh" + postinstall: "distributions/otelcol-contrib/postinstall.sh" + preremove: "distributions/otelcol-contrib/preremove.sh" + builds: + - "otelcol-contrib" + contents: + - src: "distributions/otelcol-contrib/otelcol-contrib.service" + dst: "/lib/systemd/system/otelcol-contrib.service" + - src: "distributions/otelcol-contrib/otelcol-contrib.conf" + dst: "/etc/otelcol-contrib/otelcol-contrib.conf" + type: "config|noreplace" + - src: "configs/otelcol-contrib.yaml" + dst: "/etc/otelcol-contrib/config.yaml" + type: config - id: "otelcol" package_name: "otelcol" license: Apache 2.0 description: "OpenTelemetry Collector - otelcol" + maintainer: The OpenTelemetry Collector maintainers formats: - apk - deb diff --git a/Makefile b/Makefile index c02b890a..6fd525e6 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ YQ_VERSION ?= 4.11.1 YQ_DIR ?= ${OTELCOL_BUILDER_DIR} YQ ?= ${YQ_DIR}/yq -DISTRIBUTIONS ?= "otelcol" +DISTRIBUTIONS ?= "otelcol,otelcol-contrib" ci: check build check: ensure-goreleaser-up-to-date diff --git a/configs/otelcol-contrib.yaml b/configs/otelcol-contrib.yaml new file mode 100644 index 00000000..ce9ba1a8 --- /dev/null +++ b/configs/otelcol-contrib.yaml @@ -0,0 +1,55 @@ +extensions: + health_check: + pprof: + endpoint: 0.0.0.0:1777 + zpages: + endpoint: 0.0.0.0:55679 + +receivers: + otlp: + protocols: + grpc: + http: + + opencensus: + + # Collect own metrics + prometheus: + config: + scrape_configs: + - job_name: 'otel-collector' + scrape_interval: 10s + static_configs: + - targets: ['0.0.0.0:8888'] + + jaeger: + protocols: + grpc: + thrift_binary: + thrift_compact: + thrift_http: + + zipkin: + +processors: + batch: + +exporters: + logging: + logLevel: debug + +service: + + pipelines: + + traces: + receivers: [otlp, opencensus, jaeger, zipkin] + processors: [batch] + exporters: [logging] + + metrics: + receivers: [otlp, opencensus, prometheus] + processors: [batch] + exporters: [logging] + + extensions: [health_check, pprof, zpages] diff --git a/distributions/otelcol-contrib/Dockerfile b/distributions/otelcol-contrib/Dockerfile new file mode 100644 index 00000000..6d144be2 --- /dev/null +++ b/distributions/otelcol-contrib/Dockerfile @@ -0,0 +1,20 @@ +FROM alpine:3.13 as certs +RUN apk --update add ca-certificates + +FROM alpine:3.13 AS otelcol-contrib +COPY otelcol-contrib /otelcol-contrib +# Note that this shouldn't be necessary, but in some cases the file seems to be +# copied with the execute bit lost (see #1317) +RUN chmod 755 /otelcol-contrib + +FROM scratch + +ARG USER_UID=10001 +USER ${USER_UID} + +COPY --from=certs /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt +COPY --from=otelcol-contrib /otelcol-contrib / +COPY configs/otelcol-contrib.yaml /etc/otelcol-contrib/config.yaml +ENTRYPOINT ["/otelcol-contrib"] +CMD ["--config", "/etc/otelcol-contrib/config.yaml"] +EXPOSE 4317 55678 55679 diff --git a/distributions/otelcol-contrib/distribution.conf b/distributions/otelcol-contrib/distribution.conf new file mode 100644 index 00000000..4afe866d --- /dev/null +++ b/distributions/otelcol-contrib/distribution.conf @@ -0,0 +1 @@ +CONTAINER_BASE_NAME=otel/opentelemetry-collector-contrib diff --git a/distributions/otelcol-contrib/manifest.yaml b/distributions/otelcol-contrib/manifest.yaml new file mode 100644 index 00000000..ba712ef7 --- /dev/null +++ b/distributions/otelcol-contrib/manifest.yaml @@ -0,0 +1,119 @@ +dist: + module: github.com/open-telemetry/opentelemetry-collector-releases/contrib + name: otelcol-contrib + description: OpenTelemetry Collector Contrib + version: 0.41.0 + output_path: ./_build + otelcol_version: 0.41.0 + +extensions: + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/asapauthextension v0.41.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/awsproxy v0.41.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/bearertokenauthextension v0.41.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/fluentbitextension v0.41.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/healthcheckextension v0.41.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/httpforwarder v0.41.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/oauth2clientauthextension v0.41.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/hostobserver v0.41.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/k8sobserver v0.41.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/oidcauthextension v0.41.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/pprofextension v0.41.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage v0.41.0 + import: github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage/filestorage + +exporters: +- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/alibabacloudlogserviceexporter v0.41.0 +- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/awsemfexporter v0.41.0 +- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/awskinesisexporter v0.41.0 +- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/awsprometheusremotewriteexporter v0.41.0 +- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/awsxrayexporter v0.41.0 +- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/azuremonitorexporter v0.41.0 +- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/carbonexporter v0.41.0 +- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/datadogexporter v0.41.0 +- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/dynatraceexporter v0.41.0 +- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/elasticexporter v0.41.0 +- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/f5cloudexporter v0.41.0 +- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/fileexporter v0.41.0 +- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/googlecloudexporter v0.41.0 +- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/honeycombexporter v0.41.0 +- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/humioexporter v0.41.0 +- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/influxdbexporter v0.41.0 +- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/jaegerexporter v0.41.0 +- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/jaegerthrifthttpexporter v0.41.0 +- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/kafkaexporter v0.41.0 +- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/loadbalancingexporter v0.41.0 +- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/logzioexporter v0.41.0 +- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/lokiexporter v0.41.0 +- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/newrelicexporter v0.41.0 +- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/opencensusexporter v0.41.0 +- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/prometheusexporter v0.41.0 +- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/prometheusremotewriteexporter v0.41.0 +- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/sapmexporter v0.41.0 +- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/sentryexporter v0.41.0 +- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/signalfxexporter v0.41.0 +- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/skywalkingexporter v0.41.0 +- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/splunkhecexporter v0.41.0 +- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/stackdriverexporter v0.41.0 +- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/sumologicexporter v0.41.0 +- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/tanzuobservabilityexporter v0.41.0 +- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/tencentcloudlogserviceexporter v0.41.0 +- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/zipkinexporter v0.41.0 + +processors: + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/attributesprocessor v0.41.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/cumulativetodeltaprocessor v0.41.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/deltatorateprocessor v0.41.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/filterprocessor v0.41.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/groupbyattrsprocessor v0.41.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/groupbytraceprocessor v0.41.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/k8sattributesprocessor v0.41.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/metricsgenerationprocessor v0.41.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/metricstransformprocessor v0.41.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/probabilisticsamplerprocessor v0.41.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.41.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourceprocessor v0.41.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/routingprocessor v0.41.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/spanmetricsprocessor v0.41.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/spanprocessor v0.41.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/tailsamplingprocessor v0.41.0 + +receivers: + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awscontainerinsightreceiver v0.41.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awsecscontainermetricsreceiver v0.41.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awsxrayreceiver v0.41.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/carbonreceiver v0.41.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/collectdreceiver v0.41.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/dockerstatsreceiver v0.41.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/dotnetdiagnosticsreceiver v0.41.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/filelogreceiver v0.41.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/fluentforwardreceiver v0.41.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/googlecloudspannerreceiver v0.41.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver v0.41.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/influxdbreceiver v0.41.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/jaegerreceiver v0.41.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/jmxreceiver v0.41.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/journaldreceiver v0.41.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/k8sclusterreceiver v0.41.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/kafkametricsreceiver v0.41.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/kafkareceiver v0.41.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/kubeletstatsreceiver v0.41.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/memcachedreceiver v0.41.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/mongodbatlasreceiver v0.41.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/opencensusreceiver v0.41.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/podmanreceiver v0.41.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/prometheusexecreceiver v0.41.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/prometheusreceiver v0.41.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/receivercreator v0.41.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/redisreceiver v0.41.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/sapmreceiver v0.41.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/signalfxreceiver v0.41.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/simpleprometheusreceiver v0.41.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/splunkhecreceiver v0.41.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/statsdreceiver v0.41.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/syslogreceiver v0.41.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/tcplogreceiver v0.41.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/udplogreceiver v0.41.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/wavefrontreceiver v0.41.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/windowsperfcountersreceiver v0.41.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/zipkinreceiver v0.41.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/zookeeperreceiver v0.41.0 diff --git a/distributions/otelcol-contrib/otelcol-contrib.conf b/distributions/otelcol-contrib/otelcol-contrib.conf new file mode 100644 index 00000000..29c245b2 --- /dev/null +++ b/distributions/otelcol-contrib/otelcol-contrib.conf @@ -0,0 +1,5 @@ +# Systemd environment file for the otelcol-contrib service + +# Command-line options for the otelcol-contrib service. +# Run `/usr/bin/otelcol-contrib --help` to see all available options. +OTELCOL_OPTIONS="--config=/etc/otelcol-contrib/config.yaml" diff --git a/distributions/otelcol-contrib/otelcol-contrib.service b/distributions/otelcol-contrib/otelcol-contrib.service new file mode 100644 index 00000000..0dc539ad --- /dev/null +++ b/distributions/otelcol-contrib/otelcol-contrib.service @@ -0,0 +1,15 @@ +[Unit] +Description=OpenTelemetry Collector Contrib +After=network.target + +[Service] +EnvironmentFile=/etc/otelcol-contrib/otelcol-contrib.conf +ExecStart=/usr/local/bin/otelcol-contrib $OTELCOL_OPTIONS +KillMode=mixed +Restart=on-failure +Type=simple +User=otelcol-contrib +Group=otelcol-contrib + +[Install] +WantedBy=multi-user.target diff --git a/distributions/otelcol-contrib/postinstall.sh b/distributions/otelcol-contrib/postinstall.sh new file mode 100755 index 00000000..3ec790ba --- /dev/null +++ b/distributions/otelcol-contrib/postinstall.sh @@ -0,0 +1,22 @@ +#!/bin/sh + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +if command -v systemctl >/dev/null 2>&1; then + systemctl enable otelcol-contrib.service + if [ -f /etc/otelcol-contrib/config.yaml ]; then + systemctl start otelcol-contrib.service + fi +fi diff --git a/distributions/otelcol-contrib/preinstall.sh b/distributions/otelcol-contrib/preinstall.sh new file mode 100755 index 00000000..8737cae6 --- /dev/null +++ b/distributions/otelcol-contrib/preinstall.sh @@ -0,0 +1,17 @@ +#!/bin/sh + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +getent passwd otelcol-contrib >/dev/null || useradd --system --user-group --no-create-home --shell /sbin/nologin otelcol-contrib diff --git a/distributions/otelcol-contrib/preremove.sh b/distributions/otelcol-contrib/preremove.sh new file mode 100755 index 00000000..5739d608 --- /dev/null +++ b/distributions/otelcol-contrib/preremove.sh @@ -0,0 +1,20 @@ +#!/bin/sh + +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +if command -v systemctl >/dev/null 2>&1; then + systemctl stop otelcol-contrib.service + systemctl disable otelcol-contrib.service +fi diff --git a/distributions/otelcol/Dockerfile b/distributions/otelcol/Dockerfile index 525cf04a..e03674f1 100644 --- a/distributions/otelcol/Dockerfile +++ b/distributions/otelcol/Dockerfile @@ -14,7 +14,7 @@ USER ${USER_UID} COPY --from=certs /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt COPY --from=otelcol /otelcol / -COPY configs/otelcol.yaml /etc/otel/config.yaml +COPY configs/otelcol.yaml /etc/otelcol/config.yaml ENTRYPOINT ["/otelcol"] -CMD ["--config", "/etc/otel/config.yaml"] +CMD ["--config", "/etc/otelcol/config.yaml"] EXPOSE 4317 55678 55679 diff --git a/scripts/build.sh b/scripts/build.sh index 1ef005f9..66d5e2ab 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -18,7 +18,7 @@ done if [ -z $distributions ]; then echo "List of distributions to build not provided. Use '-d' to specify the names of the distributions to build. Ex.:" - echo "$0 -d opentelemetry-collector" + echo "$0 -d otelcol" exit 1 fi diff --git a/scripts/goreleaser-templates/builds.template.yaml b/scripts/goreleaser-templates/builds.template.yaml index ff01b477..3a81eb20 100644 --- a/scripts/goreleaser-templates/builds.template.yaml +++ b/scripts/goreleaser-templates/builds.template.yaml @@ -11,12 +11,7 @@ builds: goarch: - 386 - amd64 - - arm - arm64 - - s390x - goarm: - - 6 - - 7 flags: - -trimpath diff --git a/scripts/goreleaser-templates/nfpms.template.yaml b/scripts/goreleaser-templates/nfpms.template.yaml index dd38098e..bfdcfa6f 100644 --- a/scripts/goreleaser-templates/nfpms.template.yaml +++ b/scripts/goreleaser-templates/nfpms.template.yaml @@ -3,6 +3,7 @@ nfpms: package_name: "{distribution}" license: Apache 2.0 description: "OpenTelemetry Collector - {distribution}" + maintainer: The OpenTelemetry Collector maintainers formats: - apk