Skip to content

Prometheus metric keda_scaler_active never gets initialized #4945

Description

@jrauschenbusch

Report

The provided Grafana Dashboard does not work because the required metric keda_scaler_active is not rendered on the /metrics endpoint. Therefore, the dashboard variables for the dropdown boxes cannot be evaluated correctly. The reason is that not all metrics are correctly initialized at bootstrapping time (first recording with default values). In addition, if you use ScaledObjects exclusively with CPU/memory triggers, the following metrics are not recorded at all:
- keda_scaler_active
- keda_scaler_errors
- keda_scaler_metrics_value
- keda_scaler_metrics_latency

Expected Behavior

  1. All metrics are initialized after the bootstrapping phase with a default value so that they are rendered when requesting the /metrics endpoint so that Grafana dashboard variables can be evaluated correctly
  2. Metrics should also be recorded when only CPU/Memory triggers are set (currently skipped)
    • keda_scaler_active
    • keda_scaler_errors
    • keda_scaler_metrics_value
    • keda_scaler_metrics_latency

Actual Behavior

Metrics are missing if one is just using ScaledObjects with CPU/Memory triggers only

Steps to Reproduce the Problem

  1. Install KEDA v2.11.2
  2. Create ScaledObject with CPU/Memory trigger only
  3. Request /metrics endpoint of Operator

Logs from KEDA operator

No response

KEDA Version

2.11.2

Kubernetes Version

1.25

Platform

Microsoft Azure

Scaler Details

No response

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedLooking for support from communitystale-bot-ignoreAll issues that should not be automatically closed by our stale bot

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    Ready To Ship

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions