Skip to content

Emit RegistrationLatencySeconds metric from role::github_runner #271

Description

@akuzminsky

Context

terraform-aws-actions-runner is adding a dashboard and alarms for the
runner fleet (infrahouse/terraform-aws-actions-runner#93). One of the
highest-value missing signals is time-to-register — how long it takes
from an EC2 instance booting to that instance being available as a
registered GitHub Actions runner. That covers apt, Puppet, and
./config.sh in a single operator-facing number.

There is no CloudWatch metric for this today. This issue tracks adding it
on the instance side via Puppet.

Proposed change

In profile::github_runner::register, right after ./config.sh succeeds,
emit:

aws cloudwatch put-metric-data \
  --region "$AWS_REGION" \
  --namespace GitHubRunners \
  --metric-name RegistrationLatencySeconds \
  --dimensions asg_name=\$ASG_NAME \
  --unit Seconds \
  --value \"\$(awk '{print \$1}' /proc/uptime)\"
  • Measurement: instance uptime (/proc/uptime) at the moment
    registration completes. Captures apt + Puppet + ./config.sh in one
    operator-facing number.
  • Emission point: the instance itself, after ./config.sh.
  • Permissions: instance profile already provides general CloudWatch
    access; verify `cloudwatch:PutMetricData` is allowed before shipping.
    If not, add it to the role used by `role::github_runner`.
  • Namespace / dimensions: match the existing `GitHubRunners`
    namespace / `asg_name` dimension already used by the module's
    `record_metric` Lambda (BusyRunners / IdleRunners).

Why

  • Accurate — the moment we know the runner is live.
  • Simple — one `aws cloudwatch put-metric-data` call.
  • No new AWS infra (no Lambda, no EventBridge, no DynamoDB).

Follow-up (in terraform-aws-actions-runner)

Once this lands, a follow-up PR in the runner module will:

  1. Surface `RegistrationLatencySeconds` as a dashboard widget (p50 / p95).
  2. Add an alarm, e.g. p95 > 20 min sustained, so slow-boot regressions page.

The module's dashboard already includes a placeholder widget for this
metric in PR #93; it will show "No data" until this issue ships.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions