azure-devops-exporter icon indicating copy to clipboard operation
azure-devops-exporter copied to clipboard

builds with status other then "completed"

Open AlexMe99 opened this issue 1 year ago • 2 comments

Hi together,

I really like your work for this exporter. It makes my life way easier currently! I'm using the exporter especially monitoring builds/pipeline runs in azure devops. After getting into the metrics and how they work, I get many information that I need.

Only one thing is currently missing for me and that is regarding running and non-completed builds. These are currently not scraped and after looking into the code, I saw that this is by design:

list, err := AzureDevopsClient.ListBuildHistoryWithStatus(project.Id, minTime, "completed")

[see here: https://github.com/webdevops/azure-devops-exporter/blob/main/metrics_build.go#L307C1-L307C93 ]

My question is, whether this is something, that HAS to be like this. Or whether it could be adjusted, so that not only completed, but also builds with other states can be scraped.

regards

AlexMe99 avatar Jun 05 '24 07:06 AlexMe99

One of our usecases for this exporter is to monitor running builds and see early if certain jobs have failed, so adding this would be great.

Probably with something like that?

list, err := AzureDevopsClient.ListBuildHistoryWithStatus(project.Id, minTime, "all")
[...]
	 for _, timelineRecord := range timelineRecordList.List {
			if timelineRecord.Status != "completed" {
				continue
			}
[...]

Tracking if a Job is running might be more overhead and new logic to differ between running/finished buildjobs on a first glance when i'm looking at the code --> I would be fine if this expoter only fetches completed Build Jobs, as long as I can see them as soon as they are done

Breee avatar Jun 25 '24 10:06 Breee

Added some changes in https://github.com/webdevops/azure-devops-exporter/pull/102 - for me that works fine

Breee avatar Jul 22 '24 06:07 Breee