kedacore / keda

KEDA is a Kubernetes-based Event Driven Autoscaling component. It provides event driven scale for any container running in Kubernetes
https://keda.sh
Apache License 2.0
8.28k stars 1.05k forks source link

Default value for missing data in Dynatrace scaler #6097

Open zip-chanko opened 3 weeks ago

zip-chanko commented 3 weeks ago

Proposal

A parameter for a scaler which fallbacks to a default value when the query returns no value.

Example: The fallbackThreshold parameter which fallbacks the value to 10 when the query returns no value.

triggers:
  - type: dynatrace
    metadata:
      host: https://dummy-instance.live.dynatrace.com/
      metricSelector: 'MyCustomEvent:filter(eq("someProperty","someValue")):count:splitBy("dt.entity.process_group"):fold'
      threshold: "1000"
      fallbackThreshold: "10"

Use-Case

As described in https://github.com/kedacore/keda/discussions/6054, Keda will show a warning KEDAScalerFailed if the query return no value.

Is this a feature you are interested in implementing yourself?

No

Anything else?

No response

JorTurFer commented 3 weeks ago

Hello Does Dynatrace support default values within the query?

zip-chanko commented 3 weeks ago

Something that I'm not aware of. This is a general idea which applies to all scalers where a trigger could have a fallback value?

JorTurFer commented 3 weeks ago

No no, I'm asking about if Dynatrace query language supports default values as part of the query. For example, PromQL does support setting default values

rickbrouwer commented 2 weeks ago

@zip-chanko The default transformation replaces null values in the payload with the specified value. Is this something you can use?