Skip to content

Commit 599b327

Browse files
authored
feat(snap): add off-cpu-threshold option (#3069)
Adds an `off-cpu-threshold` option to the Snap package, which defaults to `0`.
2 parents e173f4e + 95dd2d3 commit 599b327

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

snap/hooks/configure

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,10 @@ fi
6464
config_path="$(snapctl get config-path)"
6565
if [[ -z "$config_path" ]]; then
6666
snapctl set config-path=""
67-
fi
67+
fi
68+
69+
# Set off-cpu threshold
70+
off_cpu_threshold="$(snapctl get off-cpu-threshold)"
71+
if [[ -z "$off_cpu_threshold" ]]; then
72+
snapctl set off-cpu-threshold="0"
73+
fi

snap/local/parca-agent-wrapper

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ insecure="$(snapctl get remote-store-insecure)"
2727
token="$(snapctl get remote-store-bearer-token)"
2828
metadata_external_labels="$(snapctl get metadata-external-labels)"
2929
config_path="$(snapctl get config-path)"
30+
off_cpu_threshold="$(snapctl get off-cpu-threshold)"
3031

3132
# Start building an array of command line options
3233
opts=(
@@ -37,6 +38,7 @@ opts=(
3738
"--remote-store-insecure=${insecure}"
3839
"--metadata-external-labels=${metadata_external_labels}"
3940
"--config-path=${config_path}"
41+
"--off-cpu-threshold=${off_cpu_threshold}"
4042
)
4143

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

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

0 commit comments

Comments
 (0)