Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion snap/hooks/configure
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,10 @@ fi
config_path="$(snapctl get config-path)"
if [[ -z "$config_path" ]]; then
snapctl set config-path=""
fi
fi

# Set off-cpu threshold
off_cpu_threshold="$(snapctl get off-cpu-threshold)"
if [[ -z "$off_cpu_threshold" ]]; then
snapctl set off-cpu-threshold="0"
fi
4 changes: 3 additions & 1 deletion snap/local/parca-agent-wrapper
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ insecure="$(snapctl get remote-store-insecure)"
token="$(snapctl get remote-store-bearer-token)"
metadata_external_labels="$(snapctl get metadata-external-labels)"
config_path="$(snapctl get config-path)"
off_cpu_threshold="$(snapctl get off-cpu-threshold)"

# Start building an array of command line options
opts=(
Expand All @@ -37,6 +38,7 @@ opts=(
"--remote-store-insecure=${insecure}"
"--metadata-external-labels=${metadata_external_labels}"
"--config-path=${config_path}"
"--off-cpu-threshold=${off_cpu_threshold}"
)

# If the token has been changed from empty, append it to the command line args
Expand All @@ -45,4 +47,4 @@ if [[ -n "${token}" ]]; then
fi

# Run parca-agent with the gathered arguments
exec "${SNAP}/parca-agent" "${opts[@]}" 2>&1 | tee -a "$SNAP_COMMON/parca-agent.log"
exec "${SNAP}/parca-agent" "${opts[@]}" 2>&1 | tee -a "$SNAP_COMMON/parca-agent.log"