Skip to content

DatadogMetric's status is flagged as Invalid if the returned Series is empty #36525

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

Open
qlikcoe opened this issue Apr 28, 2025 · 2 comments
Open

Comments

@qlikcoe
Copy link

qlikcoe commented Apr 28, 2025

// If the returned Series is empty for one or more processedMetrics, add it as invalid

Not sure if that's the best approach since it could be misleading in a scenario when there is no traffic and a service isn't reporting any requests count, for example.

I'm using Keda's ScaledObject to scale using DatadogMetric object, and ScaledObject is also flagged as not ready because of this.

@qlikcoe qlikcoe changed the title DatadogMetric's status is invalid if the returned Series is empty DatadogMetric's status is flagged as Invalid if the returned Series is empty Apr 28, 2025
@clamoriniere
Copy link
Contributor

Hi @qlikcoe,

Thanks for opening this issue! We will investigate how we can better support this KEDA use case.

The behavior you’re describing is currently expected. We designed it this way to prevent invalid queries (for example, queries with typos) by detecting when a query doesn’t return any value.

We are considering adding a new option to the DatadogMetric object to allow results without values.

In the meantime, could you try wrapping your query in a default() function, like this:
default(avg:system.cpu.idle{*}, 0)

This will cause the query to return a default value (0 in this example) when no data is available, ensuring the metric is always considered “valid.”

Thanks again for raising this!

@qlikcoe
Copy link
Author

qlikcoe commented Apr 28, 2025

Thanks @clamoriniere !

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

No branches or pull requests

3 participants