-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add otelcol-sampling distribution (#67)
Signed-off-by: Juraci Paixão Kröhling <juraci@kroehling.de>
- Loading branch information
1 parent
337a26e
commit e2fdfc3
Showing
10 changed files
with
326 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
project_name: otelcol-sampling | ||
builds: | ||
- id: otelcol-sampling | ||
goos: | ||
- darwin | ||
- linux | ||
- windows | ||
goarch: | ||
- "386" | ||
- amd64 | ||
- arm64 | ||
- ppc64le | ||
ignore: | ||
- goos: darwin | ||
goarch: "386" | ||
- goos: windows | ||
goarch: arm64 | ||
dir: _build | ||
binary: otelcol-sampling | ||
ldflags: | ||
- -s | ||
- -w | ||
flags: | ||
- -trimpath | ||
env: | ||
- CGO_ENABLED=0 | ||
archives: | ||
- id: otelcol-sampling | ||
builds: | ||
- otelcol-sampling | ||
name_template: '{{ .Binary }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}_{{ .Mips }}{{ end }}' | ||
nfpms: | ||
- package_name: otelcol-sampling | ||
contents: | ||
- src: otelcol-sampling.service | ||
dst: /lib/systemd/system/otelcol-sampling.service | ||
- src: otelcol-sampling.conf | ||
dst: /etc/otelcol-sampling/otelcol-sampling.conf | ||
type: config|noreplace | ||
- src: otelcol.yaml | ||
dst: /etc/otelcol-sampling/config.yaml | ||
type: config | ||
scripts: | ||
preinstall: preinstall.sh | ||
postinstall: postinstall.sh | ||
preremove: preremove.sh | ||
id: otelcol-sampling | ||
builds: | ||
- otelcol-sampling | ||
formats: | ||
- apk | ||
- deb | ||
- rpm | ||
maintainer: Juraci Paixão Kröhling <distributions@kroehling.de> | ||
description: otelcol-sampling distribution of the OpenTelemetry Collector | ||
license: Apache 2.0 | ||
checksum: | ||
name_template: '{{ .ProjectName }}_checksums.txt' | ||
dockers: | ||
- goos: linux | ||
goarch: "386" | ||
dockerfile: Dockerfile | ||
image_templates: | ||
- ghcr.io/jpkrohling/otelcol-distributions/otelcol-sampling:{{ .Version }}-386 | ||
extra_files: | ||
- otelcol.yaml | ||
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}} | ||
use: buildx | ||
- goos: linux | ||
goarch: amd64 | ||
dockerfile: Dockerfile | ||
image_templates: | ||
- ghcr.io/jpkrohling/otelcol-distributions/otelcol-sampling:{{ .Version }}-amd64 | ||
extra_files: | ||
- otelcol.yaml | ||
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}} | ||
use: buildx | ||
- goos: linux | ||
goarch: arm64 | ||
dockerfile: Dockerfile | ||
image_templates: | ||
- ghcr.io/jpkrohling/otelcol-distributions/otelcol-sampling:{{ .Version }}-arm64 | ||
extra_files: | ||
- otelcol.yaml | ||
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}} | ||
use: buildx | ||
- goos: linux | ||
goarch: ppc64le | ||
dockerfile: Dockerfile | ||
image_templates: | ||
- ghcr.io/jpkrohling/otelcol-distributions/otelcol-sampling:{{ .Version }}-ppc64le | ||
extra_files: | ||
- otelcol.yaml | ||
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}} | ||
use: buildx | ||
docker_manifests: | ||
- name_template: ghcr.io/jpkrohling/otelcol-distributions/otelcol-sampling:{{ .Version }} | ||
image_templates: | ||
- ghcr.io/jpkrohling/otelcol-distributions/otelcol-sampling:{{ .Version }}-386 | ||
- ghcr.io/jpkrohling/otelcol-distributions/otelcol-sampling:{{ .Version }}-amd64 | ||
- ghcr.io/jpkrohling/otelcol-distributions/otelcol-sampling:{{ .Version }}-arm64 | ||
- ghcr.io/jpkrohling/otelcol-distributions/otelcol-sampling:{{ .Version }}-ppc64le | ||
sboms: | ||
- id: archive | ||
artifacts: archive | ||
- id: package | ||
artifacts: package |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
FROM alpine:latest | ||
|
||
ARG USER_UID=10001 | ||
USER ${USER_UID} | ||
|
||
COPY otelcol-sampling /otelcol-sampling | ||
COPY otelcol.yaml /etc/otelcol-sampling/config.yaml | ||
ENTRYPOINT ["/otelcol-sampling"] | ||
CMD ["--config", "/etc/otelcol-sampling/config.yaml"] | ||
EXPOSE 4317 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
dist: | ||
module: github.com/jpkrohling/otelcol-distributions/otelcol-sampling | ||
name: otelcol | ||
description: OpenTelemetry Collector distribution with sampling processors | ||
version: 0.101.0 | ||
output_path: ./_build | ||
otelcol_version: 0.101.0 | ||
|
||
extensions: | ||
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/healthcheckextension v0.101.0 | ||
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/pprofextension v0.101.0 | ||
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/basicauthextension v0.101.0 | ||
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/bearertokenauthextension v0.101.0 | ||
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/oauth2clientauthextension v0.101.0 | ||
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/oidcauthextension v0.101.0 | ||
receivers: | ||
- gomod: go.opentelemetry.io/collector/receiver/otlpreceiver v0.101.0 | ||
exporters: | ||
- gomod: go.opentelemetry.io/collector/exporter/nopexporter v0.101.0 | ||
- gomod: go.opentelemetry.io/collector/exporter/otlpexporter v0.101.0 | ||
- gomod: go.opentelemetry.io/collector/exporter/otlphttpexporter v0.101.0 | ||
processors: | ||
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/tailsamplingprocessor v0.101.0 | ||
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/probabilisticsamplerprocessor v0.101.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Systemd environment file for the otelcol-sampling service | ||
|
||
# Command-line options for the otelcol-sampling service. | ||
# Run `/usr/bin/otelcol-sampling --help` to see all available options. | ||
OTELCOL_OPTIONS="--config=/etc/otelcol-sampling/config.yaml" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[Unit] | ||
Description=OpenTelemetry Collector distribution with sampling processors | ||
After=network.target | ||
|
||
[Service] | ||
EnvironmentFile=/etc/otelcol-sampling/otelcol-sampling.conf | ||
ExecStart=/usr/bin/otelcol-sampling $OTELCOL_OPTIONS | ||
KillMode=mixed | ||
Restart=on-failure | ||
Type=simple | ||
User=otelcol-sampling | ||
Group=otelcol-sampling | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
extensions: | ||
health_check: {} | ||
pprof: {} | ||
|
||
receivers: | ||
otlp: | ||
protocols: | ||
grpc: {} | ||
|
||
exporters: | ||
nop: | ||
otlp: | ||
endpoint: otlp.example.com:4317 | ||
otlphttp: | ||
endpoint: https://otlp.example.com/otlp | ||
|
||
processors: | ||
tail_sampling: | ||
decision_wait: 10s | ||
num_traces: 100 | ||
expected_new_traces_per_sec: 10 | ||
policies: | ||
[ | ||
{ | ||
name: test-policy-1, | ||
type: always_sample | ||
}, | ||
] | ||
|
||
probabilistic_sampler: | ||
sampling_percentage: 100 | ||
|
||
service: | ||
extensions: [ health_check, pprof ] | ||
pipelines: | ||
traces: | ||
receivers: [ otlp ] | ||
processors: [ probabilistic_sampler, tail_sampling ] | ||
exporters: [ nop, otlp, otlphttp ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
extensions: | ||
health_check: {} | ||
pprof: {} | ||
|
||
receivers: | ||
otlp: | ||
protocols: | ||
grpc: {} | ||
|
||
exporters: | ||
nop: | ||
otlp: | ||
endpoint: otlp.example.com:4317 | ||
otlphttp: | ||
endpoint: https://otlp.example.com/otlp | ||
|
||
processors: | ||
tail_sampling: | ||
decision_wait: 10s | ||
num_traces: 100 | ||
expected_new_traces_per_sec: 10 | ||
policies: | ||
[ | ||
{ | ||
name: test-policy-1, | ||
type: always_sample | ||
}, | ||
] | ||
|
||
probabilistic_sampler: | ||
sampling_percentage: 100 | ||
|
||
service: | ||
extensions: [ health_check, pprof ] | ||
pipelines: | ||
traces: | ||
receivers: [ otlp ] | ||
processors: [ probabilistic_sampler, tail_sampling ] | ||
exporters: [ nop, otlp, otlphttp ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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-sampling.service | ||
if [ -f /etc/otelcol-sampling/config.yaml ]; then | ||
systemctl start otelcol-sampling.service | ||
fi | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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-sampling >/dev/null || useradd --system --user-group --no-create-home --shell /sbin/nologin otelcol-sampling |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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-sampling.service | ||
systemctl disable otelcol-sampling.service | ||
fi |