Skip to content

Commit 389fbb1

Browse files
authored
Package updates (open-telemetry#29)
* Fix deb filenames for publish * Update systemd env file for SPLUNK_BALLAST * Rename systemd environment file * Allow otelcol options to be configurable in env file
1 parent 1b20e2b commit 389fbb1

File tree

7 files changed

+30
-20
lines changed

7 files changed

+30
-20
lines changed

.circleci/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ commands:
1818
bin/otelcol_linux_arm64
1919
bin/otelcol_linux_amd64
2020
bin/otelcol_windows_amd64.exe
21-
dist/splunk-otel-collector_*.amd64.deb
22-
dist/splunk-otel-collector_*.arm64.deb
21+
dist/splunk-otel-collector_*_amd64.deb
22+
dist/splunk-otel-collector_*_arm64.deb
2323
dist/splunk-otel-collector-*.arm64.rpm
2424
dist/splunk-otel-collector-*.x86_64.rpm
2525
steps:

internal/buildscripts/packaging/fpm/common.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ SPLUNK_CONFIG_REPO_PATH="$REPO_DIR/cmd/otelcol/config/collector/splunk_config.ya
2525
SPLUNK_CONFIG_INSTALL_PATH="/etc/otel/collector/splunk_config.yaml"
2626
OTLP_CONFIG_REPO_PATH="$REPO_DIR/cmd/otelcol/config/collector/otlp_config.yaml"
2727
OTLP_CONFIG_INSTALL_PATH="/etc/otel/collector/otlp_config.yaml"
28-
SPLUNK_ENV_REPO_PATH="$REPO_DIR/internal/buildscripts/packaging/fpm/splunk_env.sh.example"
29-
SPLUNK_ENV_INSTALL_PATH="/etc/otel/collector/splunk_env.sh.example"
28+
SPLUNK_ENV_REPO_PATH="$FPM_DIR/splunk_env.example"
29+
SPLUNK_ENV_INSTALL_PATH="/etc/otel/collector/splunk_env.example"
3030

3131

3232
get_version() {
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
#!/bin/sh
22

33
if command -v systemctl >/dev/null 2>&1; then
4+
systemctl daemon-reload
45
systemctl enable splunk-otel-collector.service
56
# only start the service after package is installed if the environment file exists
6-
if [ -f /etc/otel/collector/splunk_env.sh ]; then
7+
if [ -f /etc/otel/collector/splunk_env ]; then
78
systemctl start splunk-otel-collector.service
89
fi
910
fi

internal/buildscripts/packaging/fpm/splunk-otel-collector.service

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ Description=Splunk OpenTelemetry Collector
33
After=network.target
44

55
[Service]
6-
EnvironmentFile=/etc/otel/collector/splunk_env.sh
7-
ExecStart=/usr/bin/otelcol --config /etc/otel/collector/splunk_config.yaml
6+
EnvironmentFile=/etc/otel/collector/splunk_env
7+
ExecStart=/usr/bin/otelcol $OTELCOL_OPTIONS
88
KillMode=mixed
99
Restart=on-failure
1010
Type=simple
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Sample environment file for passing variables to the splunk-otel-collector service.
2+
# See /etc/otel/collector/splunk_config.yaml for how these variables will be consumed.
3+
4+
# To use this file, update the values below appropriately,
5+
# and save the changes to "/etc/otel/collector/splunk_env".
6+
7+
# Then run the following commands to apply the changes and restart the service:
8+
# sudo systemctl daemon-reload
9+
# sudo systemctl restart splunk-otel-collector.service
10+
11+
# Command-line options for the splunk-otel-collector service. Run `/usr/bin/otelcol --help` to see all available options.
12+
OTELCOL_OPTIONS="--config /etc/otel/collector/splunk_config.yaml"
13+
14+
# Access token to authenticate requests.
15+
SPLUNK_ACCESS_TOKEN=12345
16+
17+
# Which realm to send the data to.
18+
SPLUNK_REALM=us0
19+
20+
# How much memory to allocate to the ballast. This should be set to 1/3 to 1/2 of configured memory.
21+
SPLUNK_BALLAST=683

internal/buildscripts/packaging/fpm/splunk_env.sh.example

Lines changed: 0 additions & 12 deletions
This file was deleted.

internal/buildscripts/packaging/fpm/test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ if $docker_exec systemctl --no-pager status $SERVICE_NAME; then
5050
fi
5151

5252
# start the service with the sample env file
53-
$docker_exec cp /etc/otel/collector/splunk_env.sh.example /etc/otel/collector/splunk_env.sh
53+
$docker_exec cp /etc/otel/collector/splunk_env.example /etc/otel/collector/splunk_env
5454
$docker_exec systemctl daemon-reload
5555
$docker_exec systemctl start splunk-otel-collector.service
5656

0 commit comments

Comments
 (0)