Skip to content

Commit

Permalink
Logz.io Agent v1.1.25
Browse files Browse the repository at this point in the history
- Added ARM64 support for linux and macOs
  - yq, jq , otel, eksctl
- Upgraded jqbinary to v1.7.1
- Upgraded yqbinary to v4.40.5
- Added exclusion of launcher process metrics as temp solution due to errors (hostmetrics.yaml)
    - error reading command for process \"launcher\
    - error reading memory info for process \"launcher\" (pid 765): no such process; error reading cpu times for process
- Created a common function for downloading binaries
  - Helper functions for binary permissions, moving binary, direct download, tar.gz files download support & detect cpu arch to use correct download url.
- Created a common function to check if a binary with same version exists before download - if it does then copy it to binary path.
  • Loading branch information
ralongit committed Jan 4, 2024
1 parent 964fe41 commit 003183c
Show file tree
Hide file tree
Showing 12 changed files with 1,163 additions and 230 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,37 +127,11 @@ function get_is_fargate_was_selected {
# Eksctl binary file in Logz.io temp directory
function download_eksctl {
local func_name="${FUNCNAME[0]}"
local binary_name="eksctl"
local download_url=$(get_arch_specific_url "$EKSCTL_URL_DOWNLOAD" "$EKSCTL_ARM_URL_DOWNLOAD")
local binary_path="$LOGZIO_TEMP_DIR/$binary_name"

local message='Downloading eksctl ...'
send_log_to_logzio "$LOG_LEVEL_DEBUG" "$message" "$LOG_STEP_INSTALLATION" "$LOG_SCRIPT_INSTALLER" "$func_name" "$AGENT_ID" "$PLATFORM" "$SUB_TYPE" "$CURRENT_DATA_SOURCE"
write_log "$LOG_LEVEL_DEBUG" "$message"

curl -fsSL "$EKSCTL_URL_DOWNLOAD" >"$LOGZIO_TEMP_DIR/eksctl.tar.gz" 2>"$TASK_ERROR_FILE"
if [[ $? -ne 0 ]]; then
message="installer.bash ($EXIT_CODE): $(get_task_error_message)"
send_log_to_logzio "$LOG_LEVEL_ERROR" "$message" "$LOG_STEP_INSTALLATION" "$LOG_SCRIPT_INSTALLER" "$func_name" "$AGENT_ID" "$PLATFORM" "$SUB_TYPE" "$CURRENT_DATA_SOURCE"
write_task_post_run "write_error \"$message\""

return $EXIT_CODE
fi

tar -zxf "$LOGZIO_TEMP_DIR/eksctl.tar.gz" --directory "$LOGZIO_TEMP_DIR" 2>"$TASK_ERROR_FILE"
if [[ $? -ne 0 ]]; then
message="installer.bash ($EXIT_CODE): error extracting files from eksctl.tar.gz: $(get_task_error_message)"
send_log_to_logzio "$LOG_LEVEL_ERROR" "$message" "$LOG_STEP_INSTALLATION" "$LOG_SCRIPT_INSTALLER" "$func_name" "$AGENT_ID" "$PLATFORM" "$SUB_TYPE" "$CURRENT_DATA_SOURCE"
write_task_post_run "write_error \"$message\""

return $EXIT_CODE
fi

chmod +x "$EKSCTL_BIN" 2>"$TASK_ERROR_FILE"
if [[ $? -ne 0 ]]; then
message="installer.bash ($EXIT_CODE): error giving execute premissions to '$EKSCTL_BIN': $(get_task_error_message)"
send_log_to_logzio "$LOG_LEVEL_ERROR" "$message" "$LOG_STEP_INSTALLATION" "$LOG_SCRIPT_INSTALLER" "$func_name" "$AGENT_ID" "$PLATFORM" "$SUB_TYPE" "$CURRENT_DATA_SOURCE"
write_task_post_run "write_error \"$message\""

return $EXIT_CODE
fi
download_binary "$download_url" "$binary_name" "$binary_path"
}

# Creates Fargate profile with monitoring namespace on Kubernetes cluster
Expand Down
35 changes: 5 additions & 30 deletions datasources/mac/kubernetes/eks/kubernetes/installer/functions.bash
Original file line number Diff line number Diff line change
Expand Up @@ -127,39 +127,14 @@ function get_is_fargate_was_selected {
# Eksctl binary file in Logz.io temp directory
function download_eksctl {
local func_name="${FUNCNAME[0]}"
local binary_name="eksctl"
local download_url=$(get_arch_specific_url "$EKSCTL_URL_DOWNLOAD" "$EKSCTL_ARM_URL_DOWNLOAD")
local binary_path="$LOGZIO_TEMP_DIR/$binary_name"

local message='Downloading eksctl ...'
send_log_to_logzio "$LOG_LEVEL_DEBUG" "$message" "$LOG_STEP_INSTALLATION" "$LOG_SCRIPT_INSTALLER" "$func_name" "$AGENT_ID" "$PLATFORM" "$SUB_TYPE" "$CURRENT_DATA_SOURCE"
write_log "$LOG_LEVEL_DEBUG" "$message"

curl -fsSL "$EKSCTL_URL_DOWNLOAD" >"$LOGZIO_TEMP_DIR/eksctl.tar.gz" 2>"$TASK_ERROR_FILE"
if [[ $? -ne 0 ]]; then
message="installer.bash ($EXIT_CODE): $(get_task_error_message)"
send_log_to_logzio "$LOG_LEVEL_ERROR" "$message" "$LOG_STEP_INSTALLATION" "$LOG_SCRIPT_INSTALLER" "$func_name" "$AGENT_ID" "$PLATFORM" "$SUB_TYPE" "$CURRENT_DATA_SOURCE"
write_task_post_run "write_error \"$message\""

return $EXIT_CODE
fi

tar -zxf "$LOGZIO_TEMP_DIR/eksctl.tar.gz" --directory "$LOGZIO_TEMP_DIR" 2>"$TASK_ERROR_FILE"
if [[ $? -ne 0 ]]; then
message="installer.bash ($EXIT_CODE): error extracting files from eksctl.tar.gz: $(get_task_error_message)"
send_log_to_logzio "$LOG_LEVEL_ERROR" "$message" "$LOG_STEP_INSTALLATION" "$LOG_SCRIPT_INSTALLER" "$func_name" "$AGENT_ID" "$PLATFORM" "$SUB_TYPE" "$CURRENT_DATA_SOURCE"
write_task_post_run "write_error \"$message\""

return $EXIT_CODE
fi

chmod +x "$EKSCTL_BIN" 2>"$TASK_ERROR_FILE"
if [[ $? -ne 0 ]]; then
message="installer.bash ($EXIT_CODE): error giving execute premissions to '$EKSCTL_BIN': $(get_task_error_message)"
send_log_to_logzio "$LOG_LEVEL_ERROR" "$message" "$LOG_STEP_INSTALLATION" "$LOG_SCRIPT_INSTALLER" "$func_name" "$AGENT_ID" "$PLATFORM" "$SUB_TYPE" "$CURRENT_DATA_SOURCE"
write_task_post_run "write_error \"$message\""

return $EXIT_CODE
fi
download_binary "$download_url" "$binary_name" "$binary_path"
}


# Creates Fargate profile with monitoring namespace on Kubernetes cluster
# Input:
# ---
Expand Down
36 changes: 4 additions & 32 deletions resources-linux/otel/subtype_installer_utils.bash
Original file line number Diff line number Diff line change
Expand Up @@ -79,39 +79,11 @@ function remove_logzio_otel_collector_service {
# OTEL collector exe in Logz.io temp directory
function download_otel_collector_binary {
local func_name="${FUNCNAME[0]}"
local binary_name="$OTEL_COLLECTOR_BIN_NAME"
local download_url=$(get_arch_specific_url "$OTEL_COLLECTOR_URL_DOWNLOAD" "$OTEL_COLLECTOR_ARM_URL_DOWNLOAD")
local binary_path="$LOGZIO_TEMP_DIR/$binary_name"

local message='Downloading OTEL collector binary ...'
send_log_to_logzio "$LOG_LEVEL_DEBUG" "$message" "$LOG_STEP_PRE_INSTALLATION" "$LOG_SCRIPT_INSTALLER" "$func_name" "$AGENT_ID" "$PLATFORM" "$SUB_TYPE"
write_log "$LOG_LEVEL_DEBUG" "$message"

if [[ ! -z "$PROXY" ]]; then
curl --proxy "$PROXY" -fsSL "$OTEL_COLLECTOR_URL_DOWNLOAD" >"$LOGZIO_TEMP_DIR/otelcol-contrib.tar.gz" 2>"$TASK_ERROR_FILE"
if [[ $? -ne 0 ]]; then
message="installer.bash ($EXIT_CODE): error downloading otelcol-logzio.tar.gz: $(get_task_error_message)"
send_log_to_logzio "$LOG_LEVEL_ERROR" "$message" "$LOG_STEP_PRE_INSTALLATION" "$LOG_SCRIPT_INSTALLER" "$func_name" "$AGENT_ID" "$PLATFORM" "$SUB_TYPE"
write_task_post_run "write_error \"$message\""

return $EXIT_CODE
fi
else
curl -fsSL "$OTEL_COLLECTOR_URL_DOWNLOAD" >"$LOGZIO_TEMP_DIR/otelcol-contrib.tar.gz" 2>"$TASK_ERROR_FILE"
if [[ $? -ne 0 ]]; then
message="installer.bash ($EXIT_CODE): error downloading otelcol-logzio.tar.gz: $(get_task_error_message)"
send_log_to_logzio "$LOG_LEVEL_ERROR" "$message" "$LOG_STEP_PRE_INSTALLATION" "$LOG_SCRIPT_INSTALLER" "$func_name" "$AGENT_ID" "$PLATFORM" "$SUB_TYPE"
write_task_post_run "write_error \"$message\""

return $EXIT_CODE
fi
fi

tar -zxf "$LOGZIO_TEMP_DIR/otelcol-contrib.tar.gz" --directory "$LOGZIO_TEMP_DIR" 'otelcol-contrib' 2>"$TASK_ERROR_FILE"
if [[ $? -ne 0 ]]; then
message="installer.bash ($EXIT_CODE): error extracting files from otelcol-contrib.tar.gz: $(get_task_error_message)"
send_log_to_logzio "$LOG_LEVEL_ERROR" "$message" "$LOG_STEP_PRE_INSTALLATION" "$LOG_SCRIPT_INSTALLER" "$func_name" "$AGENT_ID" "$PLATFORM" "$SUB_TYPE"
write_task_post_run "write_error \"$message\""

return $EXIT_CODE
fi
download_binary "$download_url" "$binary_name" "$binary_path"
}

# Creates Logz.io opt subdirectory
Expand Down
25 changes: 4 additions & 21 deletions resources-mac/otel/subtype_installer_utils.bash
Original file line number Diff line number Diff line change
Expand Up @@ -71,28 +71,11 @@ function remove_logzio_otel_collector_service {
# OTEL collector exe in Logz.io temp directory
function download_otel_collector_binary {
local func_name="${FUNCNAME[0]}"
local binary_name="$OTEL_COLLECTOR_BIN_NAME"
local download_url=$(get_arch_specific_url "$OTEL_COLLECTOR_URL_DOWNLOAD" "$OTEL_COLLECTOR_ARM_URL_DOWNLOAD")
local binary_path="$LOGZIO_TEMP_DIR/$binary_name"

local message='Downloading OTEL collector binary ...'
send_log_to_logzio "$LOG_LEVEL_DEBUG" "$message" "$LOG_STEP_PRE_INSTALLATION" "$LOG_SCRIPT_INSTALLER" "$func_name" "$AGENT_ID" "$PLATFORM" "$SUB_TYPE"
write_log "$LOG_LEVEL_DEBUG" "$message"

curl -fsSL "$OTEL_COLLECTOR_URL_DOWNLOAD" >"$LOGZIO_TEMP_DIR/otelcol-logzio.tar.gz" 2>"$TASK_ERROR_FILE"
if [[ $? -ne 0 ]]; then
message="installer.bash ($EXIT_CODE): error downloading otelcol-logzio.tar.gz: $(get_task_error_message)"
send_log_to_logzio "$LOG_LEVEL_ERROR" "$message" "$LOG_STEP_PRE_INSTALLATION" "$LOG_SCRIPT_INSTALLER" "$func_name" "$AGENT_ID" "$PLATFORM" "$SUB_TYPE"
write_task_post_run "write_error \"$message\""

return $EXIT_CODE
fi

tar -zxf "$LOGZIO_TEMP_DIR/otelcol-logzio.tar.gz" --directory "$LOGZIO_TEMP_DIR" 2>"$TASK_ERROR_FILE"
if [[ $? -ne 0 ]]; then
message="installer.bash ($EXIT_CODE): error extracting files from otelcol-logzio.tar.gz: $(get_task_error_message)"
send_log_to_logzio "$LOG_LEVEL_ERROR" "$message" "$LOG_STEP_PRE_INSTALLATION" "$LOG_SCRIPT_INSTALLER" "$func_name" "$AGENT_ID" "$PLATFORM" "$SUB_TYPE"
write_task_post_run "write_error \"$message\""

return $EXIT_CODE
fi
download_binary "$download_url" "$binary_name" "$binary_path"
}

# Creates Logz.io opt subdirectory
Expand Down
3 changes: 3 additions & 0 deletions resources/otel/receivers/hostmetrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ receiver:
network:
paging:
process:
exclude:
names: ['launcher']
match_type: strict
mute_process_name_error: true
mute_process_exe_error: true
mute_process_io_error: true
Loading

0 comments on commit 003183c

Please sign in to comment.