-
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
Add refactoring for datadog scaler #6552
base: main
Are you sure you want to change the base?
Conversation
} | ||
|
||
// TODO: Need to check whether we can deprecate vType and how should we proceed with it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kedacore/keda-maintainers Hi team, I have one question and would need your help 🙏 . Are we ready to deprecate vType
? it has been flagged out in the PR #3491 2 years ago
keda/pkg/scalers/datadog_scaler.go
Lines 254 to 265 in 30ddff3
if val, ok := config.TriggerMetadata["type"]; ok { | |
logger.V(0).Info("trigger.metadata.type is deprecated in favor of trigger.metricType") | |
if config.MetricType != "" { | |
return nil, fmt.Errorf("only one of trigger.metadata.type or trigger.metricType should be defined") | |
} | |
val = strings.ToLower(val) | |
switch val { | |
case avgString: | |
meta.vType = v2.AverageValueMetricType | |
case "global": | |
meta.vType = v2.ValueMetricType | |
default: |
I'm slightly confused as it is also metntioned as part of the test case in
keda/pkg/scalers/datadog_scaler_test.go
Line 111 in 30ddff3
{v2.AverageValueMetricType, map[string]string{"useClusterAgentProxy": "true", "datadogMetricName": "nginx-hits", "datadogMetricNamespace": "default", "targetValue": "2", "type": "global"}, map[string]string{"token": "token", "datadogNamespace": "datadog", "datadogMetricsService": "datadog-cluster-agent-metrics-api", "unsafeSsl": "true", "authMode": "bearer"}, true}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for best expert opinion, I would like to ping @arapulido
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @wozniakjan ,for now I will just focus on the refactoring and leave this for another time
d59eb1a
to
8f6280b
Compare
8f6280b
to
dc86a22
Compare
/run-e2e datadog |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the refactor looks pretty good but probably some small regression has been added because it seems that e2e tests are failing now
helper.go:4***7: Waiting for deployment replicas to hit target. Deployment - datadog-dca-test-deployment, Current - ***, Target - 0
datadog_dca_test.go:***58:
Error Trace: /__w/keda/keda/tests/sequential/datadog_dca/datadog_dca_test.go:***58
Error: Should be true
Test: TestDatadogScalerDCA
Messages: replica count should be 0 after *** minutes
datadog_dca_test.go:***68: --- testing activation ---
helper.go:54***: Applying template: lightLoadTemplate
helper.go:494: Waiting for some time to ensure deployment replica count doesn't change from 0
helper.go:50***: Deployment - datadog-dca-test-deployment, Current - ***
helper.go:504:
Error Trace: /__w/keda/keda/tests/helper/helper.go:504
/__w/keda/keda/tests/sequential/datadog_dca/datadog_dca_test.go:***7***
/__w/keda/keda/tests/sequential/datadog_dca/datadog_dca_test.go:***6***
Error: datadog-dca-test-deployment replica count has changed from 0 to ***
Test: TestDatadogScalerDCA
datadog_dca_test.go:***75: --- testing scale out ---
...
Failed tests:
Execution of tests/sequential/datadog_dca/datadog_dca_test.go, has failed after "two" attempts
make: *** [Makefile:***09: e***e-test] Error ***
Signed-off-by: dttung2905 <[email protected]>
Signed-off-by: dttung2905 <[email protected]>
Signed-off-by: dttung2905 <[email protected]>
Signed-off-by: dttung2905 <[email protected]>
0f8d4f6
to
7e6759e
Compare
/run-e2e datadog |
Refactoring the datadog scaler. It a little bit more complicated than I have imagined. There are a few TODO that I will resolve before marking this PR ready
Checklist
Relates to #5797