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

Change installer flag to use --with[out]-instrumentation-sdk #3841

Merged
merged 14 commits into from
Oct 30, 2023
Merged
Show file tree
Hide file tree
Changes from 4 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
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@
the `libsplunk.so` shared object library (default: `--without-systemd-instrumentation`)
- Initial support for [Splunk OpenTelemetry Auto Instrumentation for Node.js](https://github.com/signalfx/splunk-otel-js):
- Activated by default if the `--with-instrumentation` or `--with-systemd-instrumentation` option is specified.
- Use the `--without-node-instrumentation` option to explicitly skip Node.js.
- Use the `--without-instrumentation-sdk node` option to explicitly skip Node.js.
- `npm` is required to install the Node.js Auto Instrumentation package. If the `npm` is not installed, Node.js will
be skipped automatically.
- By default, the Node.js Auto Instrumentation package is installed with the `npm install --global` command. Use the
`--npm-command "<command>"` option to specify a custom command.
- Auto Instrumentation for Java is also activated by default if the `--with-instrumentation` or
`--with-systemd-instrumentation` option is specified. Use the `--without-java-instrumentation` option to skip Java.
`--with-systemd-instrumentation` option is specified. Use the `--without-instrumentation-sdk java` option to skip Java.
- `--otlp-endpoint host:port`: Set the OTLP gRPC endpoint for captured traces (default: `http://LISTEN_INTERFACE:4317`
where `LISTEN_INTERFACE` is the value from the `--listen-interface` option if specified, or `127.0.0.1` otherwise)
- See [Linux Installer Script](https://github.com/signalfx/splunk-otel-collector/blob/main/docs/getting-started/linux-installer.md)
Expand Down
6 changes: 3 additions & 3 deletions docs/getting-started/linux-installer.md
Original file line number Diff line number Diff line change
Expand Up @@ -332,11 +332,11 @@ of the following options:

By default, both the Java and Node.js Auto Instrumentation agents will be
installed and activated. Run the installer script with either the
`--without-java-instrumentation` or `--without-node-instrumentation` option to
`--without-instrumentation-sdk java` or `--without-instrumentation-sdk node` option to
skip installation and activation of the respective agent. For example:
```sh
curl -sSL https://dl.signalfx.com/splunk-otel-collector.sh > /tmp/splunk-otel-collector.sh && \
sudo sh /tmp/splunk-otel-collector.sh --with-instrumentation --without-node-instrumentation --realm SPLUNK_REALM -- SPLUNK_ACCESS_TOKEN
sudo sh /tmp/splunk-otel-collector.sh --with-instrumentation --without-instrumentation-sdk node --realm SPLUNK_REALM -- SPLUNK_ACCESS_TOKEN
```

Additional options include:
Expand All @@ -363,7 +363,7 @@ following are required:
`npm` is not installed or not found in the user's default `PATH`, the
installer script will automatically skip installation and configuration of
the Node.js agent. Run the installer script with the
`--without-node-instrumentation` option to explicitly skip Node.js.
`--without-instrumentation-sdk node` option to explicitly skip Node.js.
- By default, the Node.js Auto Instrumentation package will be installed with
the `npm install --global` command. Run the installer script with the
`--npm-command "<command>"` option to specify a custom command (wrapped in
Expand Down
45 changes: 29 additions & 16 deletions internal/buildscripts/packaging/installer/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -871,12 +871,11 @@ Auto Instrumentation:
applications running as systemd services.
Cannot be combined with the '--with-instrumentation' option.
(default: --without-systemd-instrumentation)
--with[out]-java-instrumentation Whether to enable Auto Instrumentation for Java.
(default: --with-java-instrumentation if --with-instrumentation or
--with[out]-instrumentation-sdk "<s>" Whether to enable Auto Instrumentation for a specific language. This option
atoulme marked this conversation as resolved.
Show resolved Hide resolved
takes a comma separated set of values representing supported
auto-instrumentation SDKs. Currently supported: java,node.
atoulme marked this conversation as resolved.
Show resolved Hide resolved
(default: --with-instrumentation-sdk "java,node" if --with-instrumentation or
--with-systemd-instrumentation is also specified)
atoulme marked this conversation as resolved.
Show resolved Hide resolved
--with[out]-node-instrumentation Whether to enable Auto Instrumentation for Node.js.
(default: --with-node-instrumentation if --with-instrumentation or
--with-systemd-instrumentation' is also specified)
--npm-command "<command>" If Auto Instrumentation for Node.js is enabled, npm is required to install the
included Splunk OpenTelemetry Auto Instrumentation for Node.js package with the
following command:
Expand Down Expand Up @@ -1196,17 +1195,31 @@ parse_args_and_install() {
--without-systemd-instrumentation)
with_systemd_instrumentation="false"
;;
--with-java-instrumentation)
with_java_instrumentation="true"
;;
--without-java-instrumentation)
--with-instrumentation-sdk)
with_java_instrumentation="false"
;;
--with-node-instrumentation)
with_node_instrumentation="true"
;;
--without-node-instrumentation)
with_node_instrumentation="false"
echo "$2" | tr ',' '\n' | while read lang; do
atoulme marked this conversation as resolved.
Show resolved Hide resolved
if [[ "$lang" -eq "java" ]]; then
with_java_instrumentation="true"
elif [[ "$lang" -eq "node" ]]; then
atoulme marked this conversation as resolved.
Show resolved Hide resolved
with_node_instrumentation="true"
else
echo "Unknown instrumentation SDK $1" >&2
usage
jinja2 marked this conversation as resolved.
Show resolved Hide resolved
atoulme marked this conversation as resolved.
Show resolved Hide resolved
fi
done
atoulme marked this conversation as resolved.
Show resolved Hide resolved
;;
--without-instrumentation-sdk)
echo "$2" | tr ',' '\n' | while read lang; do
atoulme marked this conversation as resolved.
Show resolved Hide resolved
if [[ "$lang" -eq "java" ]]; then
with_java_instrumentation="false"
elif [[ "$lang" -eq "node" ]]; then
atoulme marked this conversation as resolved.
Show resolved Hide resolved
with_node_instrumentation="false"
else
echo "Unknown instrumentation SDK $1" >&2
usage
atoulme marked this conversation as resolved.
Show resolved Hide resolved
fi
done
atoulme marked this conversation as resolved.
Show resolved Hide resolved
;;
--npm-command)
npm_command="$2"
Expand Down Expand Up @@ -1296,13 +1309,13 @@ parse_args_and_install() {

if [ "$with_instrumentation" = "true" ]; then
if [ "$with_java_instrumentation" = "false" ] && [ "$with_node_instrumentation" = "false" ]; then
echo "[ERROR] The --with-instrumentation option was specified, but both --without-java-instrumentation and --without-node-instrumentation options were also specified." >&2
echo "[ERROR] The --with-instrumentation option was specified, but --without-instrumentation-sdk java,node was also specified." >&2
echo "[ERROR] At least one language must be enabled for auto instrumentation" >&2
exit 1
fi
elif [ "$with_systemd_instrumentation" = "true" ]; then
if [ "$with_java_instrumentation" = "false" ] && [ "$with_node_instrumentation" = "false" ]; then
echo "[ERROR] The --with-systemd-instrumentation option was specified, but both --without-java-instrumentation and --without-node-instrumentation options were also specified." >&2
echo "[ERROR] The --with-systemd-instrumentation option was specified, but --without-instrumentation-sdk java,node was also specified." >&2
echo "[ERROR] At least one language must be enabled for auto instrumentation" >&2
exit 1
fi
Expand Down
Loading