Skip to content
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
18 changes: 18 additions & 0 deletions .chloggen/remove_fluentd_installer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: breaking

# The name of the component, or a single word describing the area of concern, (e.g. crosslink)
component: installer

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Remove FluentD support

# One or more tracking issues related to the change
issues: [7123]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext: |
Remove FluentD support from the installer.
Please use native OTel receivers instead (e.g. the filelog receiver).
197 changes: 7 additions & 190 deletions packaging/installer/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,6 @@ debian_gpg_key_url="${deb_repo_base}/splunk-B3CD4420.gpg"
rpm_repo_base="${repo_base}/otel-collector-rpm"
yum_gpg_key_url="${rpm_repo_base}/splunk-B3CD4420.pub"

fluent_capng_c_version="0.2.2"
fluent_config_dir="${collector_config_dir}/fluentd"
fluent_config_path="${fluent_config_dir}/fluent.conf"
fluent_plugin_systemd_version="1.0.1"
journald_config_path="${fluent_config_dir}/conf.d/journald.conf"

td_agent_repo_base="https://packages.treasuredata.com"
td_agent_gpg_key_url="${td_agent_repo_base}/GPG-KEY-td-agent"

default_stage="release"
default_realm="us0"
default_memory_size="512"
Expand Down Expand Up @@ -301,10 +292,9 @@ install_yum_package() {
}

ensure_not_installed() {
local with_fluentd="$1"
local with_instrumentation="$2"
local with_systemd_instrumentation="$3"
local npm_path="$4"
local with_instrumentation="$1"
local with_systemd_instrumentation="$2"
local npm_path="$3"
local otelcol_path=$( command -v otelcol 2>/dev/null || true )
local td_agent_path=$( command -v td-agent 2>/dev/null || true )

Expand All @@ -314,12 +304,6 @@ ensure_not_installed() {
exit 1
fi

if [ "$with_fluentd" = "true" ] && [ -n "$td_agent_path" ]; then
echo "$td_agent_path already exists which implies that fluentd/td-agent is already installed." >&2
echo "Please uninstall fluentd/td-agent, or try running this script with the '--uninstall' option." >&2
exit 1
fi

if [ "$with_instrumentation" = "true" ] || [ "$with_systemd_instrumentation" = "true" ]; then
if [ -f "$instrumentation_so_path" ]; then
echo "$instrumentation_so_path already exists which implies that auto instrumentation is already installed." >&2
Expand Down Expand Up @@ -401,42 +385,6 @@ install_fluent_plugin() {
fi
}

configure_fluentd() {
local override_src_path="$fluent_config_dir/splunk-otel-collector.conf"
local override_dest_path="/etc/systemd/system/td-agent.service.d/splunk-otel-collector.conf"

if [ -f "$override_src_path" ]; then
systemctl stop td-agent
mkdir -p $(dirname $override_dest_path)
cp -f $override_src_path $override_dest_path
chown root:root $override_dest_path
chmod 644 $override_dest_path
systemctl daemon-reload

# ensure the td-agent user has access to the config dir
chown -R td-agent:td-agent "$fluent_config_dir"

# configure permissions/capabilities
if [ -f /opt/td-agent/bin/fluent-cap-ctl ]; then
if ! fluent_plugin_installed "capng_c"; then
install_fluent_plugin "capng_c" "$fluent_capng_c_version"
fi
/opt/td-agent/bin/fluent-cap-ctl --add "dac_override,dac_read_search" -f /opt/td-agent/bin/ruby
else
if getent group adm >/dev/null 2>&1; then
usermod -a -G adm td-agent
fi
if getent group systemd-journal 2>&1; then
usermod -a -G systemd-journal td-agent
fi
fi

if ! fluent_plugin_installed "fluent-plugin-systemd"; then
install_fluent_plugin "fluent-plugin-systemd" "$fluent_plugin_systemd_version"
fi
fi
}

backup_file() {
local path="$1"

Expand Down Expand Up @@ -725,8 +673,7 @@ install() {
local collector_version="$2"
local td_agent_version="$3"
local skip_collector_repo="$4"
local skip_fluentd_repo="$5"
local instrumentation_version="$6"
local instrumentation_version="$5"

case "$distro" in
ubuntu|debian)
Expand All @@ -741,16 +688,6 @@ install() {
fi
apt-get -y update
install_apt_package "splunk-otel-collector" "$collector_version"
if [ -n "$td_agent_version" ]; then
td_agent_version="${td_agent_version}-1"
if [ "$skip_fluentd_repo" = "false" ]; then
install_td_agent_apt_repo "$td_agent_version"
fi
apt-get -y update
install_apt_package "td-agent" "$td_agent_version"
apt-get -y install build-essential libcap-ng0 libcap-ng-dev pkg-config
systemctl stop td-agent
fi
if [ -n "$instrumentation_version" ]; then
install_apt_package "splunk-otel-auto-instrumentation" "$instrumentation_version"
fi
Expand All @@ -765,21 +702,6 @@ install() {
install_collector_yum_repo "$stage"
fi
install_yum_package "splunk-otel-collector" "$collector_version"
if [ -n "$td_agent_version" ]; then
if [ "$skip_fluentd_repo" = "false" ]; then
install_td_agent_yum_repo "$td_agent_version"
fi
install_yum_package "td-agent" "$td_agent_version"
if command -v yum >/dev/null 2>&1; then
yum group install -y 'Development Tools'
else
dnf group install -y 'Development Tools'
fi
for pkg in libcap-ng libcap-ng-devel pkgconfig; do
install_yum_package "$pkg" ""
done
systemctl stop td-agent
fi
if [ -n "$instrumentation_version" ]; then
install_yum_package "splunk-otel-auto-instrumentation" "$instrumentation_version"
fi
Expand Down Expand Up @@ -931,15 +853,6 @@ Collector:
target system that provides the 'splunk-otel-collector' deb/rpm package.
--test Use the test package repo instead of the primary.

Fluentd [DEPRECATED]:
--with[out]-fluentd Whether to install and configure fluentd to forward log events to the collector.
(default: --without-fluentd)
--skip-fluentd-repo By default, a apt/yum repo definition file will be created to download the
fluentd deb/rpm package from $td_agent_repo_base.
Specify this option to skip this step and use a pre-configured repo on the
target system that provides the 'td-agent' deb/rpm package.
Only applicable if the '--with-fluentd' is also specified.

Auto Instrumentation:
--with[out]-instrumentation Whether to install the splunk-otel-auto-instrumentation package and add the
libsplunk.so shared object library to /etc/ld.so.preload to enable auto
Expand Down Expand Up @@ -1011,7 +924,7 @@ Auto Instrumentation:
(default: $default_instrumentation_version)

Uninstall:
--uninstall Removes the Splunk OpenTelemetry Collector for Linux, Fluentd, and Splunk
--uninstall Removes the Splunk OpenTelemetry Collector for Linux and Splunk
OpenTelemetry Auto Instrumentation packages, if installed.

EOH
Expand Down Expand Up @@ -1069,36 +982,6 @@ arch_supported() {
esac
}

fluentd_supported() {
case "$distro" in
amzn)
if [ "$distro_version" != "2" ]; then
return 1
fi
;;
sles|opensuse*)
return 1
;;
debian)
if [ "$distro_version" = "9" ] && [ "$distro_arch" = "aarch64" ]; then
return 1
elif [ "$distro_version" = "12" ]; then
return 1
fi
;;
ubuntu)
if [ "$distro_version" = "16.04" ] && [ "$distro_arch" = "aarch64" ]; then
return 1
fi
if [ "$distro_version" = "24.04" ]; then
return 1
fi
;;
esac

return 0
}

version_supported() {
local min="$1"
local desired="$2"
Expand Down Expand Up @@ -1234,10 +1117,8 @@ parse_args_and_install() {
local td_agent_version="$default_td_agent_version"
local uninstall="false"
local mode="agent"
local with_fluentd="false"
local collector_config_path=
local skip_collector_repo="false"
local skip_fluentd_repo="false"
local with_instrumentation="false"
local with_systemd_instrumentation="false"
local instrumentation_version="$default_instrumentation_version"
Expand Down Expand Up @@ -1323,25 +1204,12 @@ parse_args_and_install() {
--skip-collector-repo)
skip_collector_repo="true"
;;
--skip-fluentd-repo)
skip_fluentd_repo="true"
;;
--test)
stage="test"
;;
--uninstall)
uninstall="true"
;;
--with-fluentd)
with_fluentd="true"
echo "[WARNING] Fluentd support has been deprecated and will be removed in a future release. Please use native OTel receivers instead (e.g. the filelog receiver)." >&2
if ! fluentd_supported; then
echo "[WARNING] Ignoring the --with-fluentd option since fluentd is currently not supported for ${distro}:${distro_version} ${distro_arch}." >&2
fi
;;
--without-fluentd)
with_fluentd="false"
;;
--with-instrumentation)
with_instrumentation="true"
;;
Expand Down Expand Up @@ -1483,10 +1351,6 @@ parse_args_and_install() {
hec_url="${ingest_url}/v1/log"
fi

if [ "$with_fluentd" != "true" ] || ! fluentd_supported; then
td_agent_version=""
fi

check_support

# check auto instrumentation options
Expand Down Expand Up @@ -1557,7 +1421,7 @@ parse_args_and_install() {
fi
fi

ensure_not_installed "$with_fluentd" "$with_instrumentation" "$with_systemd_instrumentation" "$npm_path"
ensure_not_installed "$with_instrumentation" "$with_systemd_instrumentation" "$npm_path"

echo "Splunk OpenTelemetry Collector Version: ${collector_version}"
echo "Memory Size in MIB: $memory"
Expand All @@ -1570,9 +1434,6 @@ parse_args_and_install() {
echo "API Endpoint: $api_url"
echo "HEC Endpoint: $hec_url"
echo "GODEBUG: $godebug"
if [ -n "$td_agent_version" ]; then
echo "TD Agent (Fluentd) Version: $td_agent_version"
fi
if [ -n "$sdks_to_enable" ]; then
echo "Splunk OpenTelemetry Auto Instrumentation Version: $instrumentation_version"
echo " Supported Auto Instrumentation SDK(s) to activate: $sdks_to_enable"
Expand Down Expand Up @@ -1602,7 +1463,7 @@ parse_args_and_install() {
exit 1
fi

install "$stage" "$collector_version" "$td_agent_version" "$skip_collector_repo" "$skip_fluentd_repo" "$instrumentation_version"
install "$stage" "$collector_version" "$td_agent_version" "$skip_collector_repo" "$instrumentation_version"

if [ "$with_instrumentation" = "true" ]; then
if item_in_list "java" "$sdks_to_enable"; then
Expand Down Expand Up @@ -1746,20 +1607,6 @@ parse_args_and_install() {
systemctl daemon-reload
systemctl restart splunk-otel-collector

if [ -n "$td_agent_version" ]; then
# only start fluentd with our custom config to avoid port conflicts within the default config
systemctl stop td-agent
if [ -f "$fluent_config_path" ]; then
configure_fluentd
systemctl restart td-agent
else
if [ -f /etc/td-agent/td-agent.conf ]; then
mv -f /etc/td-agent/td-agent.conf /etc/td-agent/td-agent.conf.bak
fi
systemctl disable td-agent
fi
fi

echo
cat <<EOH
The Splunk OpenTelemetry Collector for Linux has been successfully installed.
Expand All @@ -1776,30 +1623,6 @@ must be restarted to apply the changes by running the following command as root:

EOH

if [ -n "$td_agent_version" ] && [ -f "$fluent_config_path" ]; then
cat <<EOH
Fluentd has been installed and configured to forward log events to the Splunk OpenTelemetry Collector.
By default, all log events with the @SPLUNK label will be forwarded to the collector.

The main fluentd configuration file is located at $fluent_config_path.
Custom input sources and configurations can be added to the ${fluent_config_dir}/conf.d/ directory.
All files with the .conf extension in this directory will automatically be included by fluentd.

Note: The fluentd service runs as the "td-agent" user. When adding new input sources or configuration
files to the ${fluent_config_dir}/conf.d/ directory, ensure that the "td-agent" user has permissions
to access the new config files and the paths defined within.

By default, fluentd has been configured to collect systemd journal log events from /var/log/journal.
See $journald_config_path for the default source configuration.

If the fluentd configuration is modified or new config files are added, the fluentd service must be
restarted to apply the changes by running the following command as root:

systemctl restart td-agent

EOH
fi

if [ -n "$sdks_to_enable" ]; then
if [ -n "$sdks_enabled" ]; then
if [ "$with_instrumentation" = "true" ]; then
Expand Down Expand Up @@ -1847,12 +1670,6 @@ EOH
fi
fi

if [ "$with_fluentd" = "true" ] && ! fluentd_supported; then
cat <<EOH >&2
[WARNING] Fluentd was not installed since it is currently not supported for ${distro}:${distro_version} ${distro_arch}
EOH
fi

if [ -z "$listen_interface" ] && [ "$mode" = "agent" ]; then
echo "[NOTICE] Starting with version 0.86.0, the collector installer changed its default network listening interface from 0.0.0.0 to 127.0.0.1 for agent mode with default configuration. Please consult the release notes for more information and configuration options."
fi
Expand Down
Loading
Loading