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 otelcol-contrib release #43

Merged
merged 3 commits into from
Dec 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion .github/workflows/ci-goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ jobs:
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: --snapshot --rm-dist
args: --snapshot --rm-dist --timeout 1h
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
74 changes: 69 additions & 5 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is auto-generated.

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"
Expand All @@ -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:
Expand All @@ -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"
Expand All @@ -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 <[email protected]>
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 <[email protected]>
formats:
- apk
- deb
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
55 changes: 55 additions & 0 deletions configs/otelcol-contrib.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
extensions:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a copy from the core's config. We do not currently ship contrib with a default config file, and I think this is a good opportunity to fix that.

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]
20 changes: 20 additions & 0 deletions distributions/otelcol-contrib/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions distributions/otelcol-contrib/distribution.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CONTAINER_BASE_NAME=otel/opentelemetry-collector-contrib
119 changes: 119 additions & 0 deletions distributions/otelcol-contrib/manifest.yaml
Original file line number Diff line number Diff line change
@@ -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
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The components were obtained by a mix of sed and awk commands and I verified manually by counting the number of components. An extra pair of eyes won't hurt though.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any thoughts on how to keep this list up to date in the future?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Manually reviewed the list and it looks good 👍

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are not going to have a components.go in the contrib anymore, so, changing the documentation to point to this instead of that would represent the current status. But the current status isn't good enough: I think we do have components that are ready but not included in the distribution.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. It's confusing to have components in the repo, but not in the release without a more clear signal as to why that is... maybe we could start adding all components in this manifest, with the components that are not "ready" in a commented out section? This would at least give users looking for specific components a chance to discover why the component is not there themselves.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May I do this in a follow-up PR, if there are no other concerns?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

works for me.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's the list of missing components:


Extensions
- github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/dockerobserver
- github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/ecsobserver
- github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/ecstaskobserver

Exporters
- github.com/open-telemetry/opentelemetry-collector-contrib/exporter/awscloudwatchlogsexporter
- github.com/open-telemetry/opentelemetry-collector-contrib/exporter/coralogixexporter
- github.com/open-telemetry/opentelemetry-collector-contrib/exporter/elasticsearchexporter
- github.com/open-telemetry/opentelemetry-collector-contrib/exporter/googlecloudpubsubexporter
- github.com/open-telemetry/opentelemetry-collector-contrib/exporter/observiqexporter

Processors
- github.com/open-telemetry/opentelemetry-collector-contrib/processor/redactionprocessor

Receivers
- github.com/open-telemetry/opentelemetry-collector-contrib/receiver/apachereceiver
- github.com/open-telemetry/opentelemetry-collector-contrib/receiver/cloudfoundryreceiver
- github.com/open-telemetry/opentelemetry-collector-contrib/receiver/googlecloudpubsubreceiver
- github.com/open-telemetry/opentelemetry-collector-contrib/receiver/k8seventsreceiver
- github.com/open-telemetry/opentelemetry-collector-contrib/receiver/mysqlreceiver
- github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nginxreceiver
- github.com/open-telemetry/opentelemetry-collector-contrib/receiver/postgresqlreceiver

- 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
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only component that deviates from the standards, and the builder was able to accommodate it.


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
5 changes: 5 additions & 0 deletions distributions/otelcol-contrib/otelcol-contrib.conf
Original file line number Diff line number Diff line change
@@ -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"
15 changes: 15 additions & 0 deletions distributions/otelcol-contrib/otelcol-contrib.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[Unit]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested installing the RPM on a fresh Fedora 34 and verified that the systemd service was up and running.

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
22 changes: 22 additions & 0 deletions distributions/otelcol-contrib/postinstall.sh
Original file line number Diff line number Diff line change
@@ -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
17 changes: 17 additions & 0 deletions distributions/otelcol-contrib/preinstall.sh
Original file line number Diff line number Diff line change
@@ -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
Loading