webdevops / azure-devops-exporter

Prometheus exporter for Azure DevOps (VSTS) including agent pools, builds, releases, deployments, pullrequests and repo stats
MIT License
147 stars 57 forks source link

Build and Install instructions #26

Closed 211217613 closed 1 month ago

211217613 commented 4 years ago

How is this built and installed?

Why is there no binary in the releases?

mblaschke commented 4 years ago

There is a docker image available: https://hub.docker.com/r/webdevops/azure-devops-exporter/ The image is using googles distroless container and the application is static build.. you could also copy the binary and run it on linux amd64

ngeegoh commented 3 years ago

Hi @mblaschke im having the same question? i am so confused about the installation and configuration of this metric container. It would be great that the readme file could be updated to include some detailed install instruction and how to connect to Prometheus :)

I have built the container with this command in PowerShell docker run -e AZURE_DEVOPS_URL=https://dev.azure.com/company -e AZURE_DEVOPS_ACCESS_TOKEN=pat -e AZURE_DEVOPS_ORGANISATION=company -e AZURE_DEVOPS_APIVERSION=6.0 --rm webdevops/azure-devops-exporter

But it doesn't generate the URL that I can use to connect to Prometheus?? So how can i configure this to connect to Prometheus to scrape metrics?

Thanks

tsaibabu4u commented 3 years ago

@ngeegoh pass -p 8080:8080 to your above command and try to access the with this port ex : http://localhost:8080/metrics it took some time to figure it out

Below is prometheous config

giuliov commented 3 years ago

This is the Powershell script I use to build locally

$PROJECT_NAME = 'azure-devops-exporter'
$GIT_TAG      = $(git describe --dirty --tags --always)
$GIT_COMMIT   = $(git rev-parse --short HEAD)

if ($PSVersionTable.Platform -eq 'Win32NT') {
  $OUTPUT_EXE="${PROJECT_NAME}.exe"
} else {
  $OUTPUT_EXE="${PROJECT_NAME}"
}

$env:CGO_ENABLED = 0
go build -a -ldflags '-X "main.gitTag=${GIT_TAG}" -X "main.gitCommit=${GIT_COMMIT}" -extldflags "-static"' -o ${PROJECT_NAME}.exe .