-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 query with functions never returns healthy #2761
Comments
Actually; two edits on this:
I found that this constantly errors anyway. Dropping Changing this to not have
Everything works fine for a while, but I still intermittently see both:
and
For context, I'm in the process of trying to switch fully to Keda instead of using the Datadog Cluster Agent, in light of #470 I see there was a recent issue/merge for: #2694 // #2657 Thanks! |
@arapulido FYI |
With regards to the problem where Keda thinks my query is invalid- i've done a little digging, and it seems that this part is causing me issues: keda/pkg/scalers/datadog_scaler.go Line 77 in ef65f59
which points to keda/pkg/scalers/datadog_scaler.go Line 52 in ef65f59
In the datadog query for:
This code section is prefixing this with The There is a lot of possible functions that could be set here. I'm not sure that auto-prefixing a user's query is good practice, especially without notifying the user that it's happening. Fixing this should solve the first issue at least.
This would allow for an optional function wrapper (formed of letters, numbers or underscores) before the aggregator value. I'm kind of hoping that the recent commits to this scaler will solve the last remaining problem for |
@dalgibbard Thanks a lot for digging a bit deeper into the issue! And yes, this should be allowed. When querying a single metric, Datadog uses the Also, feel free to contribute to a patch :) Take into account that the Datadog Cluster Agent is for now the official way to HPA using Datadog Metrics, maintained by a whole team, while the Datadog KEDA scaler is just me, on my own time :) |
@arapulido Appreciate you working on this - and yeah, we were using the Cluster Agent initially, but this blocks our ability to scale on other metrics which is important for us :) I've submitted a PR, but I haven't fully tested it, as I haven't quite worked out how I could inject a custom build into our EKS Clusters (they're quite tightly controlled). The tests pass at least! |
@dalgibbard Fantastic! Thanks a lot! I will test this out this afternoon. Thanks a lot for debugging the issue and contribute to a patch |
@arapulido I've just thought... My PR is a bit over simplified, because a user could actually wrap multiple functions; for example:
Some take params, some don't etc. |
Sounds good, let me try some tests against the API directly, and I will update here. |
I did amend the regex to support multiple functions; but ultimately the source of truth for if a query is valid or not, is datadog's API :) I'll leave it with you for now anyway! And thanks :) |
@dalgibbard Thanks, and I agree, I am making some changes to rely more on the API for validation, rather than trying to cover all potential use cases. Feel free to close your PR, as mine will supersede that one. Thanks! |
Awesome, have closed my PR :D |
Report
Edit: see comments below, also amended the Issue title to better match the issue at hand
I have a Datadog ScaledObject resource setup, which looks like the following (Secret called
keda-myapp-datadog-secret
already created):Note specifically, the two datadog triggers in the single ScaledObject.
With this setup, the scaled object reports the following Health state (from describe):
Note that the first Trigger is failing, whilst the second is Happy.
And the keda-operator-metrics-apiserver logs show:
Note here, that it's reporting
no api key given
even though it's using the exact sameauthenticationRef
value to the other trigger.Expected Behavior
When:
All Triggers should load metrics successfully.
Actual Behavior
Only the last trigger correctly loads the configured TriggerAuth. Other triggers report
no api key given
Steps to Reproduce the Problem
See report for example YAML
Logs from KEDA operator
See above.
KEDA Version
2.6.1
Kubernetes Version
1.21
Platform
Amazon Web Services
Scaler Details
Datadog
Anything else?
No response
The text was updated successfully, but these errors were encountered: