Skip to content

Commit

Permalink
Change installer flag to use --with[out]-instrumentation-sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
atoulme committed Oct 24, 2023
1 parent 640b931 commit 5aee1b4
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 21 deletions.
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
takes a comma separated set of values representing supported
auto-instrumentation SDKs. Currently supported: java,node.
(default: --with-instrumentation-sdk "java,node" if --with-instrumentation or
--with-systemd-instrumentation is also specified)
--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
if [[ "$lang" -eq "java" ]]; then
with_java_instrumentation="true"
elif [[ "$lang" -eq "node" ]]; then
with_node_instrumentation="true"
else then
echo "Unknown instrumentation SDK $1" >&2
usage
fi
done
;;
--without-instrumentation-sdk)
echo "$2" | tr ',' '\n' | while read lang; do
if [[ "$lang" -eq "java" ]]; then
with_java_instrumentation="false"
elif [[ "$lang" -eq "node" ]]; then
with_node_instrumentation="false"
else then
echo "Unknown instrumentation SDK $1" >&2
usage
fi
done
;;
--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 options 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 both --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

0 comments on commit 5aee1b4

Please sign in to comment.