Skip to content

Commit

Permalink
Merge pull request #13 from axoflow/fluentforward_exporter
Browse files Browse the repository at this point in the history
feat(exporters): fluentforward
  • Loading branch information
OverOrion authored Apr 23, 2024
2 parents b055df7 + 7d1d6cb commit b48f6c6
Show file tree
Hide file tree
Showing 16 changed files with 68 additions and 65 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/ci-goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,12 @@ on:
branches: [main]
paths:
- ".goreleaser.yaml"
- "distributions/otelcol/manifest.yaml"
- "distributions/otelcol-contrib/manifest.yaml"
- "distributions/axoflow-otel-collector/manifest.yaml"
pull_request:
branches: [main]
paths:
- ".goreleaser.yaml"
- "distributions/otelcol/manifest.yaml"
- "distributions/otelcol-contrib/manifest.yaml"
- "distributions/axoflow-otel-collector/manifest.yaml"

jobs:
check-goreleaser:
Expand Down
20 changes: 10 additions & 10 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
project_name: opentelemetry-collector-releases
project_name: axoflow-otel-collector-releases
builds:
- id: otelcol-contrib
- id: axoflow-otel-collector
goos:
- linux
goarch:
- amd64
- arm64
dir: distributions/otelcol-contrib/_build
binary: otelcol-contrib
dir: distributions/axoflow-otel-collector/_build
binary: axoflow-otel-collector
ldflags:
- -s
- -w
Expand All @@ -16,21 +16,21 @@ builds:
env:
- CGO_ENABLED=0
archives:
- id: otelcol-contrib
- id: axoflow-otel-collector
builds:
- otelcol-contrib
- axoflow-otel-collector
name_template: '{{ .Binary }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}_{{ .Mips }}{{ end }}'
checksum:
name_template: '{{ .ProjectName }}_checksums.txt'
dockers:
- goos: linux
goarch: amd64
dockerfile: distributions/otelcol-contrib/Dockerfile
dockerfile: distributions/axoflow-otel-collector/Dockerfile
image_templates:
- ghcr.io/axoflow/axoflow-otel-collector/axoflow-otel-collector:{{ .Version }}-amd64
- ghcr.io/axoflow/axoflow-otel-collector/axoflow-otel-collector:latest-amd64
extra_files:
- configs/otelcol-contrib.yaml
- configs/axoflow-otel-collector.yaml
build_flag_templates:
- --pull
- --platform=linux/amd64
Expand All @@ -42,12 +42,12 @@ dockers:
use: buildx
- goos: linux
goarch: arm64
dockerfile: distributions/otelcol-contrib/Dockerfile
dockerfile: distributions/axoflow-otel-collector/Dockerfile
image_templates:
- ghcr.io/axoflow/axoflow-otel-collector/axoflow-otel-collector:{{ .Version }}-arm64
- ghcr.io/axoflow/axoflow-otel-collector/axoflow-otel-collector:latest-arm64
extra_files:
- configs/otelcol-contrib.yaml
- configs/axoflow-otel-collector.yaml
build_flag_templates:
- --pull
- --platform=linux/arm64
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ OTELCOL_BUILDER_VERSION ?= 0.97.0
OTELCOL_BUILDER_DIR ?= ${HOME}/bin
OTELCOL_BUILDER ?= ${OTELCOL_BUILDER_DIR}/ocb

DISTRIBUTIONS ?= "otelcol-contrib"
DISTRIBUTIONS ?= "axoflow-otel-collector"

ci: check build
check: ensure-goreleaser-up-to-date
Expand Down Expand Up @@ -64,7 +64,7 @@ goreleaser:
fi \
}

REMOTE?[email protected]:axoflow/opentelemetry-collector-releases.git
REMOTE?[email protected]:axoflow/axoflow-otel-collector-releases.git
.PHONY: push-tags
push-tags:
@[ "${TAG}" ] || ( echo ">> env var TAG is not set"; exit 1 )
Expand Down
4 changes: 2 additions & 2 deletions cmd/goreleaser/internal/configure.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ var (

func Generate(imagePrefixes []string, dists []string) config.Project {
return config.Project{
ProjectName: "opentelemetry-collector-releases",
ProjectName: "axoflow-otel-collector-releases",
Checksum: config.Checksum{
NameTemplate: "{{ .ProjectName }}_checksums.txt",
},
Expand Down Expand Up @@ -233,7 +233,7 @@ func DockerManifest(prefix, version, dist string) config.DockerManifest {

// imageName translates a distribution name to a container image name.
func imageName(dist string) string {
return strings.Replace(dist, "otelcol", "opentelemetry-collector", 1)
return strings.Replace(dist, "otelcol", "axoflow-otel-collector", 1)
}

// archName translates architecture to docker platform names.
Expand Down
File renamed without changes.
14 changes: 14 additions & 0 deletions distributions/axoflow-otel-collector/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM alpine:3.16 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 axoflow-otel-collector /axoflow-otel-collector
COPY configs/axoflow-otel-collector.yaml /etc/axoflow-otel-collector/config.yaml
ENTRYPOINT ["/axoflow-otel-collector"]
CMD ["--config", "/etc/axoflow-otel-collector/config.yaml"]
EXPOSE 4317 55678 55679
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
dist:
module: github.com/open-telemetry/opentelemetry-collector-releases/contrib
name: otelcol-contrib
description: OpenTelemetry Collector Contrib
module: github.com/axoflow/axoflow-otel-collector-releases
name: axoflow-otel-collector
description: Axoflow Distribution for OpenTelemetry Collector
version: 0.97.0
output_path: ./_build
otelcol_version: 0.97.0
Expand Down Expand Up @@ -79,6 +79,7 @@ exporters:
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/syslogexporter v0.97.0
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/tencentcloudlogserviceexporter v0.97.0
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/zipkinexporter v0.97.0
- gomod: github.com/axoflow/fluentforwardexporter v0.0.2

processors:
- gomod: go.opentelemetry.io/collector/processor/batchprocessor v0.97.0
Expand All @@ -97,7 +98,8 @@ processors:
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/remotetapprocessor v0.97.0
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.97.0
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourceprocessor v0.97.0
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/routingprocessor v0.97.0
# TODO: check if can be reenabled
# - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/routingprocessor v0.97.0
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/spanprocessor v0.97.0
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/sumologicprocessor v0.97.0
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/tailsamplingprocessor v0.97.0
Expand Down Expand Up @@ -133,7 +135,7 @@ receivers:
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/filelogreceiver v0.97.0
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/filestatsreceiver v0.97.0
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/flinkmetricsreceiver v0.97.0
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/fluentforwardreceiver v0.97.0
# - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/fluentforwardreceiver v0.97.0
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/googlecloudpubsubreceiver v0.97.0
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/googlecloudspannerreceiver v0.97.0
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/haproxyreceiver v0.97.0
Expand All @@ -144,7 +146,8 @@ receivers:
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/jaegerreceiver v0.97.0
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/jmxreceiver v0.97.0
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/journaldreceiver v0.97.0
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/k8sclusterreceiver v0.97.0
# TODO: check if can be reenabled
# - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/k8sclusterreceiver v0.97.0
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/k8seventsreceiver v0.97.0
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/k8sobjectsreceiver v0.97.0
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/kafkametricsreceiver v0.97.0
Expand Down Expand Up @@ -199,7 +202,8 @@ connectors:
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/connector/countconnector v0.97.0
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/connector/datadogconnector v0.97.0
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/connector/routingconnector v0.97.0
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/connector/servicegraphconnector v0.97.0
# TODO: check if can be reenabled
# - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/connector/servicegraphconnector v0.97.0
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/connector/spanmetricsconnector v0.97.0

# When adding a replace, add a comment before it to document why it's needed and when it can be removed
Expand All @@ -212,3 +216,4 @@ replaces:
- github.com/mattn/go-ieproxy => github.com/mattn/go-ieproxy v0.0.1
# see https://github.com/openshift/api/pull/1515
- github.com/openshift/api => github.com/openshift/api v0.0.0-20230726162818-81f778f3b3ec
- github.com/IBM/fluent-forward-go => github.com/IBM/fluent-forward-go v0.2.3-0.20240418091724-720f8df4306a
5 changes: 5 additions & 0 deletions distributions/axoflow-otel-collector/otelcol-contrib.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Systemd environment file for the axoflow-otel-collector service

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

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

[Install]
WantedBy=multi-user.target
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
# 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
systemctl enable axoflow-otel-collector.service
if [ -f /etc/axoflow-otel-collector/config.yaml ]; then
systemctl start axoflow-otel-collector.service
fi
fi
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
# 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
getent passwd axoflow-otel-collector >/dev/null || useradd --system --user-group --no-create-home --shell /sbin/nologin axoflow-otel-collector
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
# limitations under the License.

if command -v systemctl >/dev/null 2>&1; then
systemctl stop otelcol-contrib.service
systemctl disable otelcol-contrib.service
systemctl stop axoflow-otel-collector.service
systemctl disable axoflow-otel-collector.service
fi
14 changes: 0 additions & 14 deletions distributions/otelcol-contrib/Dockerfile

This file was deleted.

5 changes: 0 additions & 5 deletions distributions/otelcol-contrib/otelcol-contrib.conf

This file was deleted.

15 changes: 0 additions & 15 deletions distributions/otelcol-contrib/otelcol-contrib.service

This file was deleted.

0 comments on commit b48f6c6

Please sign in to comment.