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

Datadog trigger is being included into the composite-metric unexpectedly. #5367

Closed
devkoriel opened this issue Jan 12, 2024 · 4 comments
Closed
Labels
bug Something isn't working

Comments

@devkoriel
Copy link

Report

I am using scalingModifiers to make composite-metric using metric-api triggers but when I add datadog trigger metric, it's also forced to be included into composite-metric not as I expected.

Expected Behavior

I expected the new external section to be added in HPA.

Actual Behavior

I am using scalingModifiers to make composite-metric using metric-api triggers but when I add datadog trigger metric, it's also forced to be included into composite-metric not as I expected.

Steps to Reproduce the Problem

  1. Use composite-metric by adding scalingModifier.
  2. Add datadog trigger.
  3. It happens.

Logs from KEDA operator

2024-01-12T03:54:29Z	ERROR	scale_handler	error pairing triggers & metrics for compositeScaler	{"scaledObject.Namespace": "engine", "scaledObject.Name": "engine-open-api", "error": "trigger name not given with compositeScaler for metric s4-datadog-sum-kubernetes_state-deployment-replicas_desired"}
github.com/kedacore/keda/v2/pkg/scaling.(*scaleHandler).getScalerState
	/workspace/pkg/scaling/scale_handler.go:744
github.com/kedacore/keda/v2/pkg/scaling.(*scaleHandler).getScaledObjectState
	/workspace/pkg/scaling/scale_handler.go:590
github.com/kedacore/keda/v2/pkg/scaling.(*scaleHandler).checkScalers
	/workspace/pkg/scaling/scale_handler.go:241
github.com/kedacore/keda/v2/pkg/scaling.(*scaleHandler).startScaleLoop
	/workspace/pkg/scaling/scale_handler.go:180

KEDA Version

2.12.1

Kubernetes Version

1.26

Platform

Amazon Web Services

Scaler Details

kubernetes-workload, metrics-api, cpu, datadog

Anything else?

We are operating k8s using kops on AWS.

@devkoriel devkoriel added the bug Something isn't working label Jan 12, 2024
@JorTurFer
Copy link
Member

JorTurFer commented Jan 12, 2024

Hello,
This is done as design, when you work with scaling modifiers, all the triggers are treated as sources for the formula.
I see that you are using CPU trigger too, but it is not supported for composition.
As the HPA Controller does a Max between all the exposed metrics, you can include datadog scaler in your formula replicating that behavior, just with max(you_formula, datadog_scaler)

@JorTurFer JorTurFer closed this as not planned Won't fix, can't repro, duplicate, stale Jan 12, 2024
@github-project-automation github-project-automation bot moved this from To Triage to Ready To Ship in Roadmap - KEDA Core Jan 12, 2024
@devkoriel
Copy link
Author

@JorTurFer Thank you for guiding. However, for now, I have to use cron trigger with scalingModifiers. Any workarounds or plans for this feature?

@JorTurFer
Copy link
Member

I don't think so, because it makes the things quite complex (which metrics, why onyl one formula, etc), but I'd like to know the thoughts from @zroubalik and @tomkerkhove

@zroubalik
Copy link
Member

Yeah, I am also inclined towards what @JorTurFer mentioned. The original desing of ScalingModifiers have been done this way. It would be extremely complicated. Just include it into the formula.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

No branches or pull requests

3 participants