diff --git a/snap/hooks/configure b/snap/hooks/configure index 23de767170..74dcaea6c4 100644 --- a/snap/hooks/configure +++ b/snap/hooks/configure @@ -64,4 +64,10 @@ fi config_path="$(snapctl get config-path)" if [[ -z "$config_path" ]]; then snapctl set config-path="" -fi \ No newline at end of file +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 diff --git a/snap/local/parca-agent-wrapper b/snap/local/parca-agent-wrapper index 6fe46443bc..5bf615ac31 100644 --- a/snap/local/parca-agent-wrapper +++ b/snap/local/parca-agent-wrapper @@ -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=( @@ -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 @@ -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" \ No newline at end of file +exec "${SNAP}/parca-agent" "${opts[@]}" 2>&1 | tee -a "$SNAP_COMMON/parca-agent.log"