Skip to content

Commit 02ede45

Browse files
authored
Allow positively overriding hostname (#88)
1 parent 3c484f2 commit 02ede45

File tree

7 files changed

+22
-3
lines changed

7 files changed

+22
-3
lines changed

beyla/run_supervisord.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,11 @@ if [ ! -f "$SUPERVISORD_CONF" ]; then
1313
echo "Copied bootstrap supervisord config to $SUPERVISORD_CONF"
1414
fi
1515

16+
# Ensure HOSTNAME is set (use hostname command as fallback)
17+
if [ -z "$HOSTNAME" ]; then
18+
HOSTNAME=$(hostname)
19+
export HOSTNAME
20+
fi
21+
1622
# Start supervisord
1723
exec /usr/bin/supervisord -c "$SUPERVISORD_CONF"

collector/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ RUN mkdir -p /versions/0-default \
3434
# Set environment variables
3535
ENV BASE_URL=https://telemetry.betterstack.com
3636
ENV CLUSTER_COLLECTOR=false
37-
ENV COLLECTOR_VERSION=1.1.7
37+
ENV COLLECTOR_VERSION=1.1.8
3838
ENV VECTOR_VERSION=0.47.0
3939
ENV BEYLA_VERSION=2.7.5
4040
ENV CLUSTER_AGENT_VERSION=1.2.4

collector/run_supervisord.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,11 @@ if [ ! -f "$SUPERVISORD_CONF" ]; then
1313
echo "Copied bootstrap supervisord config to $SUPERVISORD_CONF"
1414
fi
1515

16+
# Ensure HOSTNAME is set (use hostname command as fallback)
17+
if [ -z "$HOSTNAME" ]; then
18+
HOSTNAME=$(hostname)
19+
export HOSTNAME
20+
fi
21+
1622
# Start supervisord
1723
exec /usr/bin/supervisord -c "$SUPERVISORD_CONF"

docker-compose.seccomp.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ services:
66
image: betterstack/collector:latest
77
container_name: better-stack-collector
88
restart: always
9+
uts: host
910
security_opt:
1011
- seccomp=collector-seccomp.json
1112
healthcheck:
@@ -41,6 +42,7 @@ services:
4142
stop_grace_period: 90s
4243
privileged: true
4344
pid: host
45+
uts: host
4446
network_mode: host
4547
mem_limit: 1536m
4648
healthcheck:

docker-compose.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ services:
66
image: betterstack/collector:latest
77
container_name: better-stack-collector
88
restart: always
9+
uts: host
910
healthcheck:
1011
test: ["CMD-SHELL", "if [ -x /var/lib/better-stack/collector/healthcheck.sh ]; then /var/lib/better-stack/collector/healthcheck.sh; else exit 0; fi"]
1112
interval: 60s
@@ -39,6 +40,7 @@ services:
3940
stop_grace_period: 90s
4041
privileged: true
4142
pid: host
43+
uts: host
4244
network_mode: host
4345
mem_limit: 1536m
4446
healthcheck:

install.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,10 @@ if [ -n "$PROXY_PORT" ]; then
8989
fi
9090
fi
9191

92-
# Set hostname if not provided
93-
HOSTNAME="${HOSTNAME:-$(hostname)}"
92+
# Set hostname if not provided (use empty string HOSTNAME="" to trigger runtime detection via uts:host)
93+
if [ -z "${HOSTNAME+x}" ]; then
94+
HOSTNAME=$(hostname)
95+
fi
9496

9597
# Set default values for environment variables
9698
BASE_URL="${BASE_URL:-https://telemetry.betterstack.com}"

swarm/docker-compose.swarm-beyla.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ services:
1818
stop_grace_period: 90s
1919
privileged: true
2020
pid: host
21+
uts: host
2122
network_mode: host
2223
mem_limit: 1536m
2324
healthcheck:

0 commit comments

Comments
 (0)