Number of runners

Hi,
I have 2 questions:

  1. How can I know how many runners are connected to my drone server?
  2. How can I know Which runner was used in a specific build?

Thanks :slight_smile:

How can I know how many runners are connected to my drone server?

There is no precise way for Drone to answer this question 1) because runners can be added and removed on the fly and 2) because runners do not maintain a persistent connection to the server; the runners perform long polling which means they frequently connect and disconnect to avoid proxy timeouts.

Instead you should find another way to answer this question. For example, you can tag your runner instances, using instance tags or labels [1][2][3], which should allow you to filter and get a list of all runner instances.

[1] https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html
[2] https://cloud.google.com/compute/docs/labeling-resources
[3] https://www.digitalocean.com/docs/droplets/how-to/tag/

How can I know Which runner was used in a specific build?

You can determine which runner processed a pipeline stage by looking at the machine parameter that is returned by our API. See docs.drone.io/api/builds/build_info/. Note that you can also name your runners so that they are more easily identifiable, see https://docs.drone.io/runner/docker/configuration/reference/drone-runner-name/.