Skip to content

Commit

Permalink
Add minimal OTLP-only distribution (#663)
Browse files Browse the repository at this point in the history
* Add minimal OTLP-only distribution

* Pin CI goreleaser version to v2.2.0

Version 2.3 of goreleaser changed some of the output directory names, making the `Upload linux service packages` task failing silently, causing the `Package tests` tasks to fail at retrieving the package artifacts under test.

* Rename distro from "otelcol-minimal" to "otelcol-otlp"

* Add note in systemd .conf file

* Correct exposed ports in Dockerfile

* Removed default command line arguments in Dockerfile

* Updated README

* Update new distro to 0.110.0
  • Loading branch information
jade-guiton-dd authored Sep 25, 2024
1 parent aaa6ec9 commit 4800eb6
Show file tree
Hide file tree
Showing 15 changed files with 518 additions and 1 deletion.
33 changes: 33 additions & 0 deletions .github/workflows/ci-goreleaser-otlp.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Continuous Integration - OTLP - GoReleaser

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

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

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

jobs:
release:
name: Release OTLP
uses: ./.github/workflows/base-release.yaml
with:
distribution: otelcol-otlp
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.110.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-otlp"
GEN_CONFIG_DISTRIBUTIONS ?= "otelcol,otelcol-contrib"

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 OTLP (also known as "otelcol-otlp")](./distributions/otelcol-otlp)
248 changes: 248 additions & 0 deletions distributions/otelcol-otlp/.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-otlp
name: otelcol-otlp_{{ .Version }}_{{ .Os }}_{{ .MsiArch }}
wxs: windows-installer.wxs
extra_files:
- opentelemetry.ico
builds:
- id: otelcol-otlp
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-otlp
ldflags:
- -s
- -w
flags:
- -trimpath
env:
- CGO_ENABLED=0
archives:
- id: otelcol-otlp
builds:
- otelcol-otlp
name_template: '{{ .Binary }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}_{{ .Mips }}{{ end }}'
nfpms:
- package_name: otelcol-otlp
contents:
- src: otelcol-otlp.service
dst: /lib/systemd/system/otelcol-otlp.service
- src: otelcol-otlp.conf
dst: /etc/otelcol-otlp/otelcol-otlp.conf
type: config|noreplace
scripts:
preinstall: preinstall.sh
postinstall: postinstall.sh
preremove: preremove.sh
overrides:
rpm:
dependencies:
- /bin/sh
id: otelcol-otlp
builds:
- otelcol-otlp
formats:
- deb
- rpm
maintainer: The OpenTelemetry Collector maintainers <[email protected]>
description: OpenTelemetry Collector - otelcol-otlp
license: Apache 2.0
checksum:
name_template: '{{ .ProjectName }}_otelcol-otlp_checksums.txt'
dockers:
- goos: linux
goarch: "386"
dockerfile: Dockerfile
image_templates:
- otel/opentelemetry-collector-otlp:{{ .Version }}-386
- otel/opentelemetry-collector-otlp:latest-386
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-otlp:{{ .Version }}-386
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-otlp: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-otlp:{{ .Version }}-amd64
- otel/opentelemetry-collector-otlp:latest-amd64
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-otlp:{{ .Version }}-amd64
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-otlp: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-otlp:{{ .Version }}-armv7
- otel/opentelemetry-collector-otlp:latest-armv7
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-otlp:{{ .Version }}-armv7
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-otlp: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-otlp:{{ .Version }}-arm64
- otel/opentelemetry-collector-otlp:latest-arm64
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-otlp:{{ .Version }}-arm64
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-otlp: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-otlp:{{ .Version }}-ppc64le
- otel/opentelemetry-collector-otlp:latest-ppc64le
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-otlp:{{ .Version }}-ppc64le
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-otlp: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-otlp:{{ .Version }}-s390x
- otel/opentelemetry-collector-otlp:latest-s390x
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-otlp:{{ .Version }}-s390x
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-otlp: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-otlp:{{ .Version }}
image_templates:
- otel/opentelemetry-collector-otlp:{{ .Version }}-386
- otel/opentelemetry-collector-otlp:{{ .Version }}-amd64
- otel/opentelemetry-collector-otlp:{{ .Version }}-armv7
- otel/opentelemetry-collector-otlp:{{ .Version }}-arm64
- otel/opentelemetry-collector-otlp:{{ .Version }}-ppc64le
- otel/opentelemetry-collector-otlp:{{ .Version }}-s390x
- name_template: otel/opentelemetry-collector-otlp:latest
image_templates:
- otel/opentelemetry-collector-otlp:latest-386
- otel/opentelemetry-collector-otlp:latest-amd64
- otel/opentelemetry-collector-otlp:latest-armv7
- otel/opentelemetry-collector-otlp:latest-arm64
- otel/opentelemetry-collector-otlp:latest-ppc64le
- otel/opentelemetry-collector-otlp:latest-s390x
- name_template: ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-otlp:{{ .Version }}
image_templates:
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-otlp:{{ .Version }}-386
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-otlp:{{ .Version }}-amd64
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-otlp:{{ .Version }}-armv7
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-otlp:{{ .Version }}-arm64
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-otlp:{{ .Version }}-ppc64le
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-otlp:{{ .Version }}-s390x
- name_template: ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-otlp:latest
image_templates:
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-otlp:latest-386
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-otlp:latest-amd64
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-otlp:latest-armv7
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-otlp:latest-arm64
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-otlp:latest-ppc64le
- ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-otlp: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
12 changes: 12 additions & 0 deletions distributions/otelcol-otlp/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
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-otlp /otelcol-otlp
ENTRYPOINT ["/otelcol-otlp"]
EXPOSE 4317 4318
23 changes: 23 additions & 0 deletions distributions/otelcol-otlp/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# OpenTelemetry Collector OTLP Distro

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

## Configuration

Unlike the Core and Contrib distributions, this distribution does not provide a default configuration file, and one will need to be created. The location of the config file is specified with the `--config` command line option.

- For the .deb/.rpm systemd service packages, the command line options are set in `/etc/otelcol-otlp/otelcol-otlp.conf`, and the default config path is `/etc/otelcol-otlp/config.yaml`.

- For the Windows installer, the command line options are set during the install process, and the default config path is `%ProgramW6432%\OpenTelemetry Collector\config.yaml`.

- For the Docker images, the command line options are blank by default, and must be specified with a `CMD` directive.

Example: `CMD ["--config", "/etc/otelcol-otlp/config.yaml"]`

## 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-otlp/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/otlp
name: otelcol-otlp
description: OpenTelemetry Collector OTLP
version: 0.110.0
output_path: ./_build
otelcol_version: 0.110.0

exporters:
- gomod: go.opentelemetry.io/collector/exporter/otlpexporter v0.110.0
- gomod: go.opentelemetry.io/collector/exporter/otlphttpexporter v0.110.0

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

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

# Command-line options for the otelcol-otlp service.
# Run `/usr/bin/otelcol-otlp --help` to see all available options.
# Note: No default config file is provided at the path below, one must be created.
OTELCOL_OPTIONS="--config=/etc/otelcol-otlp/config.yaml"
15 changes: 15 additions & 0 deletions distributions/otelcol-otlp/otelcol-otlp.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[Unit]
Description=OpenTelemetry Collector OTLP
After=network.target

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

[Install]
WantedBy=multi-user.target
Loading

0 comments on commit 4800eb6

Please sign in to comment.