Terraform Cloud Agent Pool Autoscaling

Not sure if this is a good idea, I am looking for a solution for agent pool autoscaling.

What I am planning to do is use AKS host agents and utilize KEDA to do event-driven autoscaling, but it seems like there is no direct metric to tell if a new agent is required.

Few things I can think of:

  1. comparing the size of the agent pool size and the number of busy agents, but KEDA doesn’t support this use case.
  2. monitoring the queue of pending runs, not sure if there is such thing.

Any suggestions?