Skip to content

Conversation

@JorTurFer
Copy link
Member

@JorTurFer JorTurFer commented Jan 10, 2026

Checklist

Fixes #7377

Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>
@github-actions
Copy link

Thank you for your contribution! 🙏

Please understand that we will do our best to review your PR and give you feedback as soon as possible, but please bear with us if it takes a little longer as expected.

While you are waiting, make sure to:

  • Add an entry in our changelog in alphabetical order and link related issue
  • Update the documentation, if needed
  • Add unit & e2e tests for your changes
  • GitHub checks are passing
  • Is the DCO check failing? Here is how you can fix DCO issues

Once the initial tests are successful, a KEDA member will ensure that the e2e tests are run. Once the e2e tests have been successfully completed, the PR may be merged at a later date. Please be patient.

Learn more about our contribution guide.

@JorTurFer
Copy link
Member Author

JorTurFer commented Jan 10, 2026

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

@keda-automation keda-automation requested review from a team January 10, 2026 19:53
@snyk-io
Copy link

snyk-io bot commented Jan 10, 2026

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>
Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>
Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>
@JorTurFer
Copy link
Member Author

JorTurFer commented Jan 10, 2026

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

Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>
@JorTurFer
Copy link
Member Author

JorTurFer commented Jan 10, 2026

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

Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>
@JorTurFer
Copy link
Member Author

JorTurFer commented Jan 11, 2026

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

Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>
@JorTurFer JorTurFer marked this pull request as ready for review January 11, 2026 00:27
@rickbrouwer
Copy link
Member

rickbrouwer commented Jan 11, 2026

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

@JorTurFer JorTurFer mentioned this pull request Jan 11, 2026
31 tasks
Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>
@keda-automation keda-automation requested a review from a team January 11, 2026 16:32
Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>
@JorTurFer
Copy link
Member Author

PTAL @rickbrouwer
After a quick chat with my colleague in Dynatrace, he suggested me to expose the polling configuration so I've added the control parameters

Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>
@JorTurFer JorTurFer requested a review from rickbrouwer January 11, 2026 16:46
@JorTurFer
Copy link
Member Author

JorTurFer commented Jan 11, 2026

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

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request adds support for Dynatrace Query Language (DQL) to the Dynatrace scaler, allowing users to query metrics using DQL in addition to the existing metricSelector approach. The implementation introduces a new query execution and polling mechanism for asynchronous DQL query processing.

Changes:

  • Added DQL query support with polling-based result retrieval mechanism
  • Introduced new metadata fields for DQL configuration (query, queryTimeoutSeconds, queryPollingWait, queryPollingTries)
  • Made metricSelector and query mutually exclusive with proper validation

Reviewed changes

Copilot reviewed 4 out of 6 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
pkg/scalers/dynatrace_scaler.go Core implementation of DQL query execution and polling logic, including new metadata fields and validation
pkg/scalers/dynatrace_scaler_test.go Unit tests for DQL query execution covering various success and failure scenarios
tests/scalers/dynatrace_dql/dynatrace_dql_test.go End-to-end integration tests for the DQL scaler functionality
schema/generated/scalers-schema.yaml Schema updates adding new DQL-related parameters
schema/generated/scalers-schema.json JSON schema updates mirroring the YAML changes
CHANGELOG.md Changelog entry documenting the new DQL querying feature

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Jorge Turrado Ferrero <Jorge_turrado@hotmail.es>
@JorTurFer
Copy link
Member Author

JorTurFer commented Jan 11, 2026

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

@rickbrouwer
Copy link
Member

Quick concern about the time.Sleep() in the polling .
I thought we avoid sleeps in scalers (but I am not fully sure about this, something struck me)?

But if it must remain, I think it ignores context cancellation and blocks reconciliation for up to 5s (5x1s). Should this use select with time.After() and ctx.Done() instead? Not sure if I'm overthinking it.

Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>
@keda-automation keda-automation requested a review from a team January 11, 2026 19:38
Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>
@JorTurFer
Copy link
Member Author

Quick concern about the time.Sleep() in the polling . I thought we avoid sleeps in scalers (but I am not fully sure about this, something struck me)?

But if it must remain, I think it ignores context cancellation and blocks reconciliation for up to 5s (5x1s). Should this use select with time.After() and ctx.Done() instead? Not sure if I'm overthinking it.

actually, it makes sense since it's a configurable thing. I used the "rude for" because initially the values were fixed, but as soon as I've exposed them, I think that using select+after makes sense totally because a user could set crazy waiting times and cancelling the loop is needed.

I've updated the code :)

@JorTurFer
Copy link
Member Author

JorTurFer commented Jan 11, 2026

/run-e2e dynatrace
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.

Dynatrace: Support DQL

2 participants