Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Number of Jobs in queue (waiting for free agents) in Agent Pool #17

Closed
AlbMor opened this issue Nov 17, 2019 · 6 comments
Closed

Number of Jobs in queue (waiting for free agents) in Agent Pool #17

AlbMor opened this issue Nov 17, 2019 · 6 comments
Labels
enhancement New feature or request

Comments

@AlbMor
Copy link

AlbMor commented Nov 17, 2019

Hi

We started to use this Azure DevOps exporter and it is working really well.

We need to have the information on how many jobs are in queue in real time (waiting for a free Agent) per Agent Pool.

We looked to get it but we did not find a way also combining different others metrics

Is it possible to get this metric?

Could you help us on that?

Thanks

Alberto

@mblaschke
Copy link
Member

Hm.. is there an rest api for that?
There are a lot of APIs which Azure DevOps uses but they are closed and not documented :(

@AlbMor
Copy link
Author

AlbMor commented Nov 17, 2019

Hi

I am not aware of such Rest API

Maybe we can extrapolate the number of waiting for Agent with a formula

Number of jobs Wating for Agent in a Pool= Number of Jobs requests in the Pool - Number of Agents in the Pool

So We just need

Number of Jobs requests in the Pool

and

Number of Agents in the Pool

Do we have such a metrics now?

I think Number of Agents in the Pool is the azure_devops_agentpool_size

but do we have Number of Jobs requests in the Pool metric?

Please let me know if you have some ideas

Thanks

@AlbMor
Copy link
Author

AlbMor commented Nov 18, 2019

Hi Again,

I found this Rest API

https://{organization}.visualstudio.com/_apis/distributedtask/pools/{poolid}/jobrequests

is returning the jobrequests for specific pool in JSON format

In the JSON result, each build have some properties, if the build started to run on an agent it gets a property assignTime, so If we don´t have this property it means the job is waiting

We can count how many of those jobs without the property assignTime are present for a specific pool

What do you think?

Please let me know if it is feasable

Thanks

Alberto

@mblaschke mblaschke added the enhancement New feature or request label Dec 16, 2019
@ScottGuymer
Copy link
Contributor

@AlbMor I ran into the same need so I had a little go at adding this in #18

Reviews would be very much appreciated.

@AlbMor
Copy link
Author

AlbMor commented Oct 9, 2020

We have now a metric doing that
azure_devops_agentpool_queue_length
Thanks

@AlbMor AlbMor closed this as completed Oct 9, 2020
@ruskinb1
Copy link

Could anyone please help on that, How we can setup prometheus for only this use case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants