Skip to content

Job-level kill switch should fall back to a repository variable when the input is unset #3877

Description

@plengauer

Currently the kill switch for job-level instrumentation is controlled solely by the internal __kill_switch input in actions/instrument/job/action.yml, which defaults to '':

  __kill_switch:
    description: 'INTERNAL ONLY - DO NOT SET MANUALLY' # 'Set OTEL_GITHUB_KILL_SWITCH variable for the repository or organization to any non-empty value to disable all monitoring in case of an emergency. DO NOT SET MANUALLY.'
    default: '' # '${{ vars.OTEL_GITHUB_KILL_SWITCH }}'

The commented-out default shows an earlier attempt to source this from a repository/org variable, but it's currently inert — the live default is just ''. Downstream, config_validation.sh only ever sees INPUT___KILL_SWITCH (the env var GitHub Actions derives from the input):

if [ -n "${INPUT___KILL_SWITCH:-}" ]; then
  echo "::warning ::OpenTelemetry for GitHub actions disabled by kill switch!" && exit 0
fi

Request: more generally, allow configuration to be sourced from repository variables when the corresponding input isn't explicitly set — starting with this kill switch as the concrete case:

  • If the __kill_switch input is set (non-empty) → unchanged, kill switch is active.
  • If the input is not set (empty/default) → check the repository variable OTEL_KILL_SWITCH. If it exists and is non-empty → treat it the same as if the input had been set to a non-empty value (kill switch active).
  • If the variable doesn't exist or is empty → unchanged, kill switch inactive.

Naming to confirm: the ask above uses OTEL_KILL_SWITCH, but note the existing commented-out line references OTEL_GITHUB_KILL_SWITCH instead. Worth deciding which name is canonical before implementing, since it's a repo/org-facing setting.

Related: actions/instrument/workflow/action.yml has the identical commented-out pattern for its own __kill_switch input, while actions/instrument/checksuite/action.yml doesn't reference a variable at all yet. Flagging in case the fix should be applied consistently across all three, even though this issue is scoped to the job-level action.

Metadata

Metadata

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions