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 option to the Datadog scaler to use the Cluster Agent as proxy #5496

Merged
merged 22 commits into from
Jul 29, 2024

Conversation

arapulido
Copy link
Contributor

@arapulido arapulido commented Feb 9, 2024

Add option to the Datadog scaler to use the Datadog Cluster Agent as proxy to obtain the metrics, instead of calling the REST API directly.

This avoids duplication and also improves the rate limiting issue that the Datadog scaler currently has, as the Cluster Agent gets the metric values in batches.

Implements: #5355

Checklist

  • Tests have been added
  • Changelog has been updated and is aligned with our changelog requirements
  • A PR is opened to update the documentation on (repo) (if applicable)
  • Commits are signed with Developer Certificate of Origin (DCO - learn more)

Fixes #5355

Docs: kedacore/keda-docs#1310

@arapulido arapulido changed the title Cluster agent proxy Add option to the Datadog scaler to use the Cluster Agent as proxy Feb 9, 2024
@arapulido arapulido force-pushed the cluster_agent_proxy branch from 76f8249 to 76a58a9 Compare February 9, 2024 16:19
Copy link

stale bot commented Apr 9, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale All issues that are marked as stale due to inactivity label Apr 9, 2024
@zroubalik
Copy link
Member

zroubalik commented Apr 10, 2024

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

@stale stale bot removed the stale All issues that are marked as stale due to inactivity label Apr 10, 2024
Copy link

stale bot commented Jun 9, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale All issues that are marked as stale due to inactivity label Jun 9, 2024
Copy link
Member

@zroubalik zroubalik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@arapulido any update on this, please?

@stale stale bot removed the stale All issues that are marked as stale due to inactivity label Jun 10, 2024
@arapulido
Copy link
Contributor Author

@zroubalik I will now continue this work. I need to rebase and I will ask for reviews soon

@arapulido arapulido force-pushed the cluster_agent_proxy branch from 76a58a9 to d3984a6 Compare June 11, 2024 14:13
@arapulido arapulido marked this pull request as ready for review June 19, 2024 07:54
@arapulido arapulido requested a review from a team as a code owner June 19, 2024 07:54
@arapulido arapulido force-pushed the cluster_agent_proxy branch from 20e7540 to 66a1b57 Compare June 19, 2024 07:56
@arapulido
Copy link
Contributor Author

@zroubalik this is ready to be reviewed. Thanks!

@zroubalik
Copy link
Member

zroubalik commented Jun 25, 2024

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

@arapulido
Copy link
Contributor Author

@zroubalik I have made some commits that fix the tests. They are currently working correctly in my local environment. Can you kick off running them in CI, please? Thanks!

@arapulido
Copy link
Contributor Author

@zroubalik @JorTurFer hello! can you kick off the E2E tests for this PR, please? This one should be ready for review. Thanks!

@arapulido
Copy link
Contributor Author

@zroubalik @tomkerkhove @JorTurFer Can we please rerun the e2e tests here, please? I would love to include this feature in the next KEDA release

@JorTurFer
Copy link
Member

JorTurFer commented Jul 24, 2024

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

Copy link
Member

@JorTurFer JorTurFer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice job! 💪
Some nits inline :)

pkg/scalers/datadog_scaler.go Outdated Show resolved Hide resolved
pkg/scalers/datadog_scaler.go Show resolved Hide resolved
pkg/scalers/datadog_scaler.go Show resolved Hide resolved
pkg/scalers/datadog_scaler.go Show resolved Hide resolved
pkg/scalers/datadog_scaler.go Show resolved Hide resolved
pkg/scalers/datadog_scaler.go Show resolved Hide resolved
pkg/scalers/datadog_scaler.go Outdated Show resolved Hide resolved
@arapulido arapulido force-pushed the cluster_agent_proxy branch from acd1bdc to a9250ea Compare July 24, 2024 12:51
@JorTurFer
Copy link
Member

JorTurFer commented Jul 24, 2024

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

Copy link
Member

@JorTurFer JorTurFer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! PTAL @zroubalik

Copy link
Member

@zroubalik zroubalik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, great job @arapulido !

Copy link
Member

@zroubalik zroubalik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@arapulido @JorTurFer is there anything we need to update in the docs? kedacore/keda-docs#1310

@arapulido
Copy link
Contributor Author

@arapulido @JorTurFer is there anything we need to update in the docs? kedacore/keda-docs#1310

Nothing, that one is good to go as well. Thanks!

@JorTurFer
Copy link
Member

JorTurFer commented Jul 29, 2024

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

@JorTurFer JorTurFer merged commit 00baf28 into kedacore:main Jul 29, 2024
18 checks passed
@arapulido arapulido deleted the cluster_agent_proxy branch July 29, 2024 09:50
@arapulido arapulido restored the cluster_agent_proxy branch July 29, 2024 09:51
JorTurFer added a commit to JorTurFer/keda that referenced this pull request Oct 7, 2024
…edacore#5496)

* Add new Datadog External scaler to talk to the DCA

Signed-off-by: Ara Pulido <[email protected]>

* Add ability to retrieve a metric value from the DCA

Signed-off-by: Ara Pulido <[email protected]>

* Use datadogmetric naming convention

Signed-off-by: Ara Pulido <[email protected]>

* Merge both Datadog scalers into one

Signed-off-by: Ara Pulido <[email protected]>

* Add authMode to the TriggerAuthentication

Signed-off-by: Ara Pulido <[email protected]>

* Add unit tests for Datadog scaler with Cluster Agent proxy

Signed-off-by: Ara Pulido <[email protected]>

* Fix activation

Signed-off-by: Ara Pulido <[email protected]>

* Add E2E tests for the Datadog scaler using the Cluster Agent proxy

Signed-off-by: Ara Pulido <[email protected]>

* Fixes after rebase

Signed-off-by: Ara Pulido <[email protected]>

* Rearrange Datadog tests

Signed-off-by: Ara Pulido <[email protected]>

* Fix linting errors

Signed-off-by: Ara Pulido <[email protected]>

* Keep token only auth

Signed-off-by: Ara Pulido <[email protected]>

* Remove references to ca metadata

Signed-off-by: Ara Pulido <[email protected]>

* remove trailing space

Signed-off-by: Ara Pulido <[email protected]>

* Add changelog entry for cluster agent as proxy feature

Signed-off-by: Ara Pulido <[email protected]>

* Fix activation parameter for Datadog API

Signed-off-by: Ara Pulido <[email protected]>

* Adjust Datadog test values

Signed-off-by: Ara Pulido <[email protected]>

* Fix typo in Datadog test

Signed-off-by: Ara Pulido <[email protected]>

* Make cluster agent metric server parameter mandatory

Signed-off-by: Ara Pulido <[email protected]>

* Use only service name and namespace to resolve the Cluster Agent service IP

Signed-off-by: Ara Pulido <[email protected]>

* Fix linting issues

Signed-off-by: Ara Pulido <[email protected]>

---------

Signed-off-by: Ara Pulido <[email protected]>
Co-authored-by: Jorge Turrado Ferrero <[email protected]>
Signed-off-by: Jorge Turrado <[email protected]>
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.

Add option for the Datadog scaler to use the Datadog Cluster Agent as source of metrics
3 participants