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 AIX Support to the collector #1652

Open
wants to merge 13 commits into
base: release/v1.63.0
Choose a base branch
from
Open
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
50 changes: 38 additions & 12 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,29 @@ builds:
tags:
- bindplane
goos:
- windows
- linux
- aix
- darwin
- linux
- windows
goarch:
- amd64
- arm64
- arm
- ppc64
- ppc64le
ignore:
- goos: aix
goarch: arm64
- goos: aix
goarch: arm
- goos: aix
goarch: amd64
- goos: aix
goarch: ppc64le
- goos: darwin
goarch: ppc64
- goos: darwin
goarch: ppc64le
- goos: windows
goarch: arm
- goos: windows
Expand All @@ -35,10 +48,6 @@ builds:
goarch: ppc64
- goos: windows
goarch: ppc64le
- goos: darwin
goarch: ppc64
- goos: darwin
goarch: ppc64le
ldflags:
- -s -w
- -X github.com/observiq/bindplane-agent/internal/version.version=v{{ .Version }}
Expand All @@ -53,16 +62,29 @@ builds:
- CGO_ENABLED=0
mod_timestamp: "{{ .CommitTimestamp }}"
goos:
- windows
- linux
- aix
- darwin
- linux
- windows
goarch:
- amd64
- arm64
- arm
- ppc64
- ppc64le
ignore:
- goos: aix
goarch: arm64
- goos: aix
goarch: arm
- goos: aix
goarch: amd64
- goos: aix
goarch: ppc64le
- goos: darwin
goarch: ppc64
- goos: darwin
goarch: ppc64le
- goos: windows
goarch: arm
- goos: windows
Expand All @@ -71,10 +93,6 @@ builds:
goarch: ppc64
- goos: windows
goarch: ppc64le
- goos: darwin
goarch: ppc64
- goos: darwin
goarch: ppc64le
ldflags:
- -s -w
- -X github.com/observiq/bindplane-agent/updater/internal/version.version=v{{ .Version }}
Expand Down Expand Up @@ -118,6 +136,9 @@ archives:
- src: release_deps/sysconfig/observiq-otel-collector
dst: "install/sysconfig"
strip_parent: true
- src: release_deps/observiq-otel-collector.aix.env
dst: "install"
strip_parent: true
format_overrides:
- goos: windows
format: zip
Expand Down Expand Up @@ -206,13 +227,17 @@ nfpms:
mode: 0644
owner: root
group: root
# This file will be unused on modern systemd Linux
# The postinstall.sh file removes this if it isn't needed
- src: service/observiq-otel-collector
dst: /etc/init.d/observiq-otel-collector
type: config|noreplace
file_info:
mode: 0755
owner: root
group: root
# This file will be unused on modern systemd Linux
# The postinstall.sh file removes this if it isn't needed
- src: service/sysconfig/observiq-otel-collector
dst: /etc/sysconfig/observiq-otel-collector
type: config
Expand Down Expand Up @@ -636,6 +661,7 @@ release:

# https://goreleaser.com/customization/changelog/
changelog:
disable: false
use: github
sort: asc
groups:
Expand Down
13 changes: 12 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,17 @@ updater:
build-binaries: agent updater

.PHONY: build-all
build-all: build-linux build-darwin build-windows
build-all: build-linux build-unix build-windows

.PHONY: build-linux
build-linux: build-linux-amd64 build-linux-arm64 build-linux-arm build-linux-ppc64 build-linux-ppc64le

.PHONY: build-unix
build-unix: build-darwin build-aix

.PHONY: build-aix
build-aix: build-aix-ppc64

.PHONY: build-darwin
build-darwin: build-darwin-amd64 build-darwin-arm64

Expand All @@ -75,6 +81,10 @@ build-linux-arm64:
build-linux-arm:
GOOS=linux GOARCH=arm $(MAKE) build-binaries -j2

.PHONY: build-aix-ppc64
build-aix-ppc64:
GOOS=aix GOARCH=ppc64 $(MAKE) build-binaries -j2

.PHONY: build-darwin-amd64
build-darwin-amd64:
GOOS=darwin GOARCH=amd64 $(MAKE) build-binaries -j2
Expand Down Expand Up @@ -224,6 +234,7 @@ release-prep:
@jq ".files[] | select(.service != null)" windows/wix.json >> release_deps/windows_service.json
@cp service/observiq-otel-collector.service release_deps/observiq-otel-collector.service
@cp service/observiq-otel-collector release_deps/observiq-otel-collector
@cp service/observiq-otel-collector.aix.env release_deps/observiq-otel-collector.aix.env
@cp -r ./service/sysconfig release_deps/

# Build and sign, skip release and ignore dirty git tree
Expand Down
2 changes: 2 additions & 0 deletions factories/exporters.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build !aix

package factories

import (
Expand Down
36 changes: 36 additions & 0 deletions factories/exporters_aix.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// Copyright observIQ, Inc.
//
// 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.

//go:build aix

package factories

import (
"github.com/open-telemetry/opentelemetry-collector-contrib/exporter/fileexporter"
"go.opentelemetry.io/collector/exporter"
"go.opentelemetry.io/collector/exporter/loggingexporter"
"go.opentelemetry.io/collector/exporter/nopexporter"
"go.opentelemetry.io/collector/exporter/otlpexporter"
"go.opentelemetry.io/collector/exporter/otlphttpexporter"
)

// Restricted to a small subset of debugging exporters plus OTLP
// Many exporters aren't compatible with AIX
var defaultExporters = []exporter.Factory{
fileexporter.NewFactory(),
loggingexporter.NewFactory(),
nopexporter.NewFactory(),
otlpexporter.NewFactory(),
otlphttpexporter.NewFactory(),
}
2 changes: 2 additions & 0 deletions factories/processors.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build !aix

package factories

import (
Expand Down
36 changes: 36 additions & 0 deletions factories/processors_aix.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// Copyright observIQ, Inc.
//
// 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.

Dylan-M marked this conversation as resolved.
Show resolved Hide resolved
//go:build aix

package factories

import (
"github.com/open-telemetry/opentelemetry-collector-contrib/processor/attributesprocessor"
"github.com/open-telemetry/opentelemetry-collector-contrib/processor/groupbytraceprocessor"
"github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor"
"github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor"
"go.opentelemetry.io/collector/processor"
"go.opentelemetry.io/collector/processor/batchprocessor"
"go.opentelemetry.io/collector/processor/processortest"
)

var defaultProcessors = []processor.Factory{
attributesprocessor.NewFactory(),
batchprocessor.NewFactory(),
processortest.NewNopFactory(),
groupbytraceprocessor.NewFactory(),
resourcedetectionprocessor.NewFactory(),
transformprocessor.NewFactory(),
}
2 changes: 2 additions & 0 deletions factories/receivers.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build !aix

package factories

import (
Expand Down
47 changes: 47 additions & 0 deletions factories/receivers_aix.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// Copyright observIQ, Inc.
Dylan-M marked this conversation as resolved.
Show resolved Hide resolved
//
// 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.

//go:build aix

package factories

import (
Dylan-M marked this conversation as resolved.
Show resolved Hide resolved
"github.com/observiq/bindplane-agent/receiver/pluginreceiver"
"github.com/observiq/bindplane-agent/receiver/sapnetweaverreceiver"
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/collectdreceiver"
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/filelogreceiver"
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver"
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/jmxreceiver"
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/saphanareceiver"
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/statsdreceiver"
"go.opentelemetry.io/collector/receiver"
"go.opentelemetry.io/collector/receiver/otlpreceiver"
"go.opentelemetry.io/collector/receiver/receivertest"
)

// Restricted list. Many receivers aren't supported on AIX.
// Additionally, we're only including those that make sense for
// An "unmanaged" config.
var defaultReceivers = []receiver.Factory{
collectdreceiver.NewFactory(),
filelogreceiver.NewFactory(),
hostmetricsreceiver.NewFactory(),
jmxreceiver.NewFactory(),
otlpreceiver.NewFactory(),
pluginreceiver.NewFactory(),
receivertest.NewNopFactory(),
saphanareceiver.NewFactory(),
sapnetweaverreceiver.NewFactory(),
statsdreceiver.NewFactory(),
}
Loading
Loading