buildkite-agent-metrics-adapter

command module
v0.0.0-...-306833a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 26, 2021 License: MIT Imports: 8 Imported by: 0

README

Go Reference

buildkite-agent-metrics-adapter

This application implements Kubernetes External Metrics API for Buildkite agent metrics.

Deployment

  • Build docker image
  • Deploy to kubernetes
# docker build -t buildkite-agent-metrics-adapter:latest -f deployDockerfile .
# kubectl apply -f deploy/adapter.yaml

Metrics

There are total counters prefixed with total_ and queue counters prefixed with queue_.

Queue counters should be filtered by metric label queue (see usage examples below)

Metric names are taken from Buildkite's collector package and converted to snake_case.

F.e. counter for total number of running jobs will be total_ + ToSnakeCase(RunningJobsCount) = total_running_jobs_count

Usage examples

  • Autoscaling based on total number of waiting jobs:

    apiVersion: autoscaling/v2beta2
    kind: HorizontalPodAutoscaler
    metadata:
      name: buildkite-autoscaler
    spec:
      scaleTargetRef:
        apiVersion: apps/v1
        kind: Deployment
        name: buildkite
      minReplicas: 1
      maxReplicas: 10
      metrics:
      - type: External
        external:
          metric:
            name: total_waiting_jobs_count
          target:
            type: AverageValue
            averageValue: 1m
    
  • Autoscaling based on number of waiting jobs in specific queue:

    apiVersion: autoscaling/v2beta2
    kind: HorizontalPodAutoscaler
    metadata:
      name: buildkite-autoscaler
    spec:
      scaleTargetRef:
        apiVersion: apps/v1
        kind: Deployment
        name: buildkite
      minReplicas: 1
      maxReplicas: 10
      metrics:
      - type: External
        external:
          metric:
            name: queue_waiting_jobs_count
            selector:
              matchLabels:
                queue: default
          target:
            type: AverageValue
            averageValue: 1m
    

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL