Mohit Tevatia
Mohit Tevatia

Reputation: 97

nomad auto scaling using prometheus metric

I'm using Nomad and want to configure a scaling policy in my Nomad file. My current configuration is:

check "allocations-counts" {
    source = "prometheus"
    query  = "nomad_client_allocations_running{node_class=\"myclass\"}"

    strategy "threshold" {
        upper_bound = 3
        delta       = -1
    }
}

After deploying this, it fails with the error: "failed to query source: query returned 4 metric streams, only 1 is expected."

When I run the Prometheus query separately, it returns multiple results like:

What I want to achieve is:

Can anyone suggest the correct configuration for this?

Upvotes: 1

Views: 56

Answers (0)

Related Questions