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

Add refactoring for datadog scaler #6552

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

dttung2905
Copy link
Contributor

@dttung2905 dttung2905 commented Feb 15, 2025

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

}

// TODO: Need to check whether we can deprecate vType and how should we proceed with it
Copy link
Contributor Author

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

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
{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},

Copy link
Member

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

Copy link
Contributor Author

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

@dttung2905 dttung2905 marked this pull request as ready for review March 2, 2025 15:43
@dttung2905 dttung2905 requested a review from a team as a code owner March 2, 2025 15:43
@dttung2905 dttung2905 force-pushed the refactor-datadog-scaler branch 2 times, most recently from d59eb1a to 8f6280b Compare March 4, 2025 22:39
@dttung2905 dttung2905 force-pushed the refactor-datadog-scaler branch from 8f6280b to dc86a22 Compare April 6, 2025 20:07
@dttung2905
Copy link
Contributor Author

dttung2905 commented Apr 6, 2025

/run-e2e datadog
Update: You can check the progress here

@dttung2905 dttung2905 requested a review from wozniakjan April 6, 2025 20:21
Copy link
Member

@wozniakjan wozniakjan left a 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]>
@dttung2905 dttung2905 force-pushed the refactor-datadog-scaler branch from 0f8d4f6 to 7e6759e Compare April 7, 2025 22:04
@dttung2905
Copy link
Contributor Author

dttung2905 commented Apr 7, 2025

/run-e2e datadog
Update: You can check the progress here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants