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

Use the metrics route scoped to a queue to get metrics for the queue #92

Conversation

triarius
Copy link
Contributor

@triarius triarius commented Jul 4, 2023

Previously, we polled the index route, which returns the metrics grouped
by queue, and then dropped the metrics for the other queues. This is
wasteful. There is a route scoped to the queue,

http 'agent.buildkite.localhost/v3/metrics/queue?name=default' "Authorization: Token **********"

it returns the JSON in the shape:

{
    "agents": {
        "busy": 0,
        "idle": 0,
        "total": 0
    },
    "jobs": {
        "running": 0,
        "scheduled": 0,
        "total": 0,
        "waiting": 0
    },
    "organization": {
        "slug": "buildkite"
    }
}

Previously, we polled the index route, which returns the metrics grouped
by queue, and then dropped the metrics for the other queues. This is
wasteful. There is a route scoped to the queue, it returns the JSON in
the shape:
```json
{
    "agents": {
        "busy": 0,
        "idle": 0,
        "total": 0
    },
    "jobs": {
        "running": 0,
        "scheduled": 0,
        "total": 0,
        "waiting": 0
    },
    "organization": {
        "slug": "buildkite"
    }
}
```
@triarius triarius marked this pull request as ready for review July 25, 2023 05:53
@triarius triarius requested a review from a team July 25, 2023 05:53
Copy link
Contributor

@DrJosh9000 DrJosh9000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

buildkite/buildkite.go Outdated Show resolved Hide resolved
@triarius triarius requested a review from DrJosh9000 July 25, 2023 07:02
@triarius triarius merged commit adbcea8 into master Jul 25, 2023
@triarius triarius deleted the pdp-1296-scope-buildkite-agent-scalers-use-of-the-metrics-endpoint-to branch July 25, 2023 07:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants