File tree Expand file tree Collapse file tree 3 files changed +32
-2
lines changed
Expand file tree Collapse file tree 3 files changed +32
-2
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,8 @@ RUN apt-get update && \
2121 curl \
2222 procps \
2323 ruby \
24- ruby-json && \
24+ ruby-json \
25+ jq && \
2526 apt-get clean && \
2627 rm -rf /var/lib/apt/lists/*
2728
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ RUN mkdir -p /versions/0-default \
3434# Set environment variables
3535ENV BASE_URL=https://telemetry.betterstack.com
3636ENV CLUSTER_COLLECTOR=false
37- ENV COLLECTOR_VERSION=1.1.6
37+ ENV COLLECTOR_VERSION=1.1.7
3838ENV VECTOR_VERSION=0.47.0
3939ENV BEYLA_VERSION=2.7.5
4040ENV CLUSTER_AGENT_VERSION=1.2.4
Original file line number Diff line number Diff line change @@ -221,6 +221,35 @@ for i in $(seq 0 $((FILES_COUNT - 1))); do
221221 log_info " Saved to: $DEST_FILE "
222222done
223223
224+ # Step 4: Download topology configuration (optional, with retries)
225+ log_info " Downloading topology configuration..."
226+ TOPOLOGY_URL=" $BASE_URL /api/collector/configuration-file?collector_secret=$( printf %s " $COLLECTOR_SECRET " | jq -sRr @uri) &configuration_version=latest&file=topology.json"
227+ TOPOLOGY_FILE=" $MANIFEST_DIR /topology.json"
228+ TOPOLOGY_MAX_ATTEMPTS=3
229+ TOPOLOGY_ATTEMPT=1
230+ TOPOLOGY_SUCCESS=false
231+
232+ while [ " $TOPOLOGY_ATTEMPT " -le " $TOPOLOGY_MAX_ATTEMPTS " ]; do
233+ TEMP_TOPOLOGY=$( mktemp)
234+ if make_api_request " $TOPOLOGY_URL " " $TEMP_TOPOLOGY " ; then
235+ mv " $TEMP_TOPOLOGY " " $TOPOLOGY_FILE "
236+ log_info " Topology configuration saved to: $TOPOLOGY_FILE "
237+ TOPOLOGY_SUCCESS=true
238+ break
239+ else
240+ rm -f " $TEMP_TOPOLOGY "
241+ if [ " $TOPOLOGY_ATTEMPT " -lt " $TOPOLOGY_MAX_ATTEMPTS " ]; then
242+ log_warn " Failed to download topology configuration (attempt $TOPOLOGY_ATTEMPT /$TOPOLOGY_MAX_ATTEMPTS , retrying...)"
243+ sleep 2
244+ fi
245+ TOPOLOGY_ATTEMPT=$(( TOPOLOGY_ATTEMPT + 1 ))
246+ fi
247+ done
248+
249+ if [ " $TOPOLOGY_SUCCESS " = false ]; then
250+ log_warn " Failed to download topology configuration after $TOPOLOGY_MAX_ATTEMPTS attempts (continuing anyway)"
251+ fi
252+
224253log_info " Bootstrap completed successfully!"
225254log_info " Manifest version: $MANIFEST_VERSION "
226255log_info " Files downloaded: $FILES_COUNT "
You can’t perform that action at this time.
0 commit comments