Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add minimal OTLP-only distribution #663

Merged
merged 10 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/workflows/ci-goreleaser-minimal.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Continuous Integration - Minimal - GoReleaser
jade-guiton-dd marked this conversation as resolved.
Show resolved Hide resolved

on:
push:
branches: [main]
paths:
- "distributions/otelcol-minimal/**"
- "cmd/**"
- ".github/**"
- "scripts/**"
- "Makefile"
- "go.mod"
- "go.sum"
pull_request:
branches: [main]
paths:
- "distributions/otelcol-minimal/**"
- "cmd/**"
- ".github/**"
- "scripts/**"
- "Makefile"
- "go.mod"
- "go.sum"

jobs:
check-goreleaser:
name: Continuous Integration - Minimal - GoReleaser
uses: ./.github/workflows/base-ci-goreleaser.yaml
with:
distribution: otelcol-minimal
goos: '[ "linux", "windows", "darwin" ]'
goarch: '[ "386", "amd64", "arm64", "ppc64le", "arm", "s390x" ]'
secrets: inherit
16 changes: 16 additions & 0 deletions .github/workflows/release-minimal.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Release Minimal

on:
push:
tags: ["v*"]

jobs:
release:
name: Release Minimal
uses: ./.github/workflows/base-release.yaml
with:
distribution: otelcol-minimal
goos: '[ "linux", "windows", "darwin" ]'
goarch: '[ "386", "amd64", "arm64", "ppc64le", "arm", "s390x" ]'
secrets: inherit
permissions: write-all
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ OTELCOL_BUILDER_VERSION ?= 0.109.0
OTELCOL_BUILDER_DIR ?= ${HOME}/bin
OTELCOL_BUILDER ?= ${OTELCOL_BUILDER_DIR}/ocb

DISTRIBUTIONS ?= "otelcol,otelcol-contrib,otelcol-k8s"
DISTRIBUTIONS ?= "otelcol,otelcol-contrib,otelcol-k8s,otelcol-minimal"
GEN_CONFIG_DISTRIBUTIONS ?= "otelcol,otelcol-contrib"
TylerHelmuth marked this conversation as resolved.
Show resolved Hide resolved

ci: check build
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ Current list of distributions:
- [OpenTelemetry Collector (also known as "otelcol")](./distributions/otelcol)
- [OpenTelemetry Collector Contrib (also known as "otelcol-contrib")](./distributions/otelcol-contrib)
- [OpenTelemetry Collector for Kubernetes (also known as "otelcol-k8s")](./distributions/otelcol-k8s)
- [OpenTelemetry Collector Minimal (also known as "otelcol-minimal")](./distributions/otelcol-minimal)
248 changes: 248 additions & 0 deletions distributions/otelcol-minimal/.goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,248 @@
partial:
by: target
version: 2
project_name: opentelemetry-collector-releases
env:
- COSIGN_YES=true
msi:
- id: otelcol-minimal
name: otelcol-minimal_{{ .Version }}_{{ .Os }}_{{ .MsiArch }}
wxs: windows-installer.wxs
extra_files:
- opentelemetry.ico
builds:
- id: otelcol-minimal
goos:
- darwin
- linux
- windows
goarch:
- "386"
- amd64
- arm
- arm64
- ppc64le
- s390x
goarm:
- "7"
ignore:
- goos: darwin
goarch: "386"
- goos: darwin
goarch: arm
- goos: darwin
goarch: s390x
- goos: windows
goarch: arm
- goos: windows
goarch: arm64
- goos: windows
goarch: s390x
dir: _build
binary: otelcol-minimal
ldflags:
- -s
- -w
flags:
- -trimpath
env:
- CGO_ENABLED=0
archives:
- id: otelcol-minimal
builds:
- otelcol-minimal
name_template: '{{ .Binary }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}_{{ .Mips }}{{ end }}'
nfpms:
- package_name: otelcol-minimal
contents:
- src: otelcol-minimal.service
dst: /lib/systemd/system/otelcol-minimal.service
- src: otelcol-minimal.conf
dst: /etc/otelcol-minimal/otelcol-minimal.conf
type: config|noreplace
scripts:
preinstall: preinstall.sh
postinstall: postinstall.sh
preremove: preremove.sh
overrides:
rpm:
dependencies:
- /bin/sh
id: otelcol-minimal
builds:
- otelcol-minimal
formats:
- deb
- rpm
maintainer: The OpenTelemetry Collector maintainers <[email protected]>
description: OpenTelemetry Collector - otelcol-minimal
license: Apache 2.0
checksum:
name_template: '{{ .ProjectName }}_otelcol-minimal_checksums.txt'
dockers:
- goos: linux
goarch: "386"
dockerfile: Dockerfile
image_templates:
- otel/opentelemetry-collector-minimal:{{ .Version }}-386
- otel/opentelemetry-collector-minimal:latest-386
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-minimal:{{ .Version }}-386
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-minimal:latest-386
build_flag_templates:
- --pull
- --platform=linux/386
- --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}}
- --label=org.opencontainers.image.licenses=Apache-2.0
use: buildx
- goos: linux
goarch: amd64
dockerfile: Dockerfile
image_templates:
- otel/opentelemetry-collector-minimal:{{ .Version }}-amd64
- otel/opentelemetry-collector-minimal:latest-amd64
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-minimal:{{ .Version }}-amd64
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-minimal:latest-amd64
build_flag_templates:
- --pull
- --platform=linux/amd64
- --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}}
- --label=org.opencontainers.image.licenses=Apache-2.0
use: buildx
- goos: linux
goarch: arm
goarm: "7"
dockerfile: Dockerfile
image_templates:
- otel/opentelemetry-collector-minimal:{{ .Version }}-armv7
- otel/opentelemetry-collector-minimal:latest-armv7
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-minimal:{{ .Version }}-armv7
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-minimal:latest-armv7
build_flag_templates:
- --pull
- --platform=linux/arm/v7
- --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}}
- --label=org.opencontainers.image.licenses=Apache-2.0
use: buildx
- goos: linux
goarch: arm64
dockerfile: Dockerfile
image_templates:
- otel/opentelemetry-collector-minimal:{{ .Version }}-arm64
- otel/opentelemetry-collector-minimal:latest-arm64
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-minimal:{{ .Version }}-arm64
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-minimal:latest-arm64
build_flag_templates:
- --pull
- --platform=linux/arm64
- --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}}
- --label=org.opencontainers.image.licenses=Apache-2.0
use: buildx
- goos: linux
goarch: ppc64le
dockerfile: Dockerfile
image_templates:
- otel/opentelemetry-collector-minimal:{{ .Version }}-ppc64le
- otel/opentelemetry-collector-minimal:latest-ppc64le
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-minimal:{{ .Version }}-ppc64le
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-minimal:latest-ppc64le
build_flag_templates:
- --pull
- --platform=linux/ppc64le
- --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}}
- --label=org.opencontainers.image.licenses=Apache-2.0
use: buildx
- goos: linux
goarch: s390x
dockerfile: Dockerfile
image_templates:
- otel/opentelemetry-collector-minimal:{{ .Version }}-s390x
- otel/opentelemetry-collector-minimal:latest-s390x
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-minimal:{{ .Version }}-s390x
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-minimal:latest-s390x
build_flag_templates:
- --pull
- --platform=linux/s390x
- --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}}
- --label=org.opencontainers.image.licenses=Apache-2.0
use: buildx
docker_manifests:
- name_template: otel/opentelemetry-collector-minimal:{{ .Version }}
image_templates:
- otel/opentelemetry-collector-minimal:{{ .Version }}-386
- otel/opentelemetry-collector-minimal:{{ .Version }}-amd64
- otel/opentelemetry-collector-minimal:{{ .Version }}-armv7
- otel/opentelemetry-collector-minimal:{{ .Version }}-arm64
- otel/opentelemetry-collector-minimal:{{ .Version }}-ppc64le
- otel/opentelemetry-collector-minimal:{{ .Version }}-s390x
- name_template: otel/opentelemetry-collector-minimal:latest
image_templates:
- otel/opentelemetry-collector-minimal:latest-386
- otel/opentelemetry-collector-minimal:latest-amd64
- otel/opentelemetry-collector-minimal:latest-armv7
- otel/opentelemetry-collector-minimal:latest-arm64
- otel/opentelemetry-collector-minimal:latest-ppc64le
- otel/opentelemetry-collector-minimal:latest-s390x
- name_template: ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-minimal:{{ .Version }}
image_templates:
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-minimal:{{ .Version }}-386
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-minimal:{{ .Version }}-amd64
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-minimal:{{ .Version }}-armv7
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-minimal:{{ .Version }}-arm64
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-minimal:{{ .Version }}-ppc64le
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-minimal:{{ .Version }}-s390x
- name_template: ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-minimal:latest
image_templates:
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-minimal:latest-386
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-minimal:latest-amd64
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-minimal:latest-armv7
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-minimal:latest-arm64
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-minimal:latest-ppc64le
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-minimal:latest-s390x
signs:
- cmd: cosign
args:
- sign-blob
- --output-signature
- ${artifact}.sig
- --output-certificate
- ${artifact}.pem
- ${artifact}
signature: ${artifact}.sig
artifacts: all
certificate: ${artifact}.pem
docker_signs:
- args:
- sign
- ${artifact}
artifacts: all
sboms:
- id: archive
artifacts: archive
- id: package
artifacts: package
monorepo:
tag_prefix: v
13 changes: 13 additions & 0 deletions distributions/otelcol-minimal/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM alpine:3.19 as certs
RUN apk --update add ca-certificates

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 --chmod=755 otelcol-minimal /otelcol-minimal
ENTRYPOINT ["/otelcol-minimal"]
CMD ["--config", "/etc/otelcol-minimal/config.yaml"]
EXPOSE 4317 55678 55679
15 changes: 15 additions & 0 deletions distributions/otelcol-minimal/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# OpenTelemetry Collector Minimal Distro

This distribution only contains the receiver and exporters for the OpenTelemetry Protocol (OTLP), supporting both gRPC and HTTP transport.

## Usage note

This distribution does not provide a default configuration file.

## Components

The full list of components is available in the [manifest](manifest.yaml)

### Rules for Component Inclusion

- Only `otlpreceiver`, `otlpexporter`, and `otlphttpexporter` are allowed.
18 changes: 18 additions & 0 deletions distributions/otelcol-minimal/manifest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
dist:
module: github.com/open-telemetry/opentelemetry-collector-releases/minimal
name: otelcol-minimal
description: OpenTelemetry Collector Minimal
version: 0.109.0
output_path: ./_build
otelcol_version: 0.109.0

exporters:
jade-guiton-dd marked this conversation as resolved.
Show resolved Hide resolved
- gomod: go.opentelemetry.io/collector/exporter/otlpexporter v0.109.0
- gomod: go.opentelemetry.io/collector/exporter/otlphttpexporter v0.109.0

receivers:
- gomod: go.opentelemetry.io/collector/receiver/otlpreceiver v0.109.0

providers:
- gomod: go.opentelemetry.io/collector/confmap/provider/envprovider v1.15.0
- gomod: go.opentelemetry.io/collector/confmap/provider/fileprovider v1.15.0
Binary file added distributions/otelcol-minimal/opentelemetry.ico
Binary file not shown.
5 changes: 5 additions & 0 deletions distributions/otelcol-minimal/otelcol-minimal.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Systemd environment file for the otelcol-minimal service

# Command-line options for the otelcol-minimal service.
# Run `/usr/bin/otelcol-minimal --help` to see all available options.
OTELCOL_OPTIONS="--config=/etc/otelcol-minimal/config.yaml"
15 changes: 15 additions & 0 deletions distributions/otelcol-minimal/otelcol-minimal.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[Unit]
Description=OpenTelemetry Collector Minimal
After=network.target

[Service]
EnvironmentFile=/etc/otelcol-minimal/otelcol-minimal.conf
ExecStart=/usr/bin/otelcol-minimal $OTELCOL_OPTIONS
KillMode=mixed
Restart=on-failure
Type=simple
User=otelcol-minimal
Group=otelcol-minimal

[Install]
WantedBy=multi-user.target
Loading
Loading