# Fix Invalid Time-Series Errors in DQL Queries

**URL:** <https://community.dynatrace.com/t/fix-invalid-time-series-errors-in-dql-queries/53874>\
**Category:** DQL\
**Tags:** dql\
**Created:** [October 27, 2025, 3:32pm UTC](https://community.dynatrace.com/t/fix-invalid-time-series-errors-in-dql-queries/53874 "2025-10-27T15:32:18Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sivart\_89](https://avatars.discourse-cdn.com/v4/letter/s/848f3c/32.png) [@sivart\_89](https://community.dynatrace.com/u/sivart_89)\
**Post date:** [October 27, 2025, 3:32pm UTC](https://community.dynatrace.com/t/fix-invalid-time-series-errors-in-dql-queries/53874/1 "2025-10-27T15:32:18Z")

</div>

I’m trying to alert on unhealthy argoCD applications in Dynatrace. My method for doing this is setting up a label on the argoCD application to be something like dynatrace\_alert: true, then having an alert in Dynatrace that will alert when said application is not healthy. I’m doing it this way so that I don’t need to constantly update the alert in Dynatrace. I just add a label and it also is easier to see what apps I’m alerting on by just looking for this label in my repo.

How I come up with this alert is by taking the result of 1 query to get a list of apps that should be alerted on (dynatrace\_alert: true) then feeding that list into another query that will then show me which apps from that list is unhealthy. The problem I am running int is that it seems to work fine in a notebook but when putting into Davis Anomaly detector, I am getting ‘Query does not result in a valid timeseries: No valid time series records found’. Any suggestions here?

Result in notebook

 ![sivart_89_0-1761578808632.png](https://global.discourse-cdn.com/dynatrace/original/3X/d/c/dc9978fc5e7fb167e25f2f86bd432c5b133013ce.png)

What I am using in the Anomaly detector

```markup
timeseries {alert_count = avg(argocd_app_labels, default: 0)}, by:{name}, filter:label_dynatrace_alert == "true", interval:1m
| join 
[ timeseries {unhealthy_count = avg(argocd_app_info, default: 0)}, by:{health_status, name, k8s.cluster.name}, filter:health_status != "Healthy", interval:1m
| filter k8s.cluster.name != "eks-enterprise-dev"], on:{name}

```

---

<div class="post-metadata">

**Author:** ![juan\_mesa](https://avatars.discourse-cdn.com/v4/letter/j/47e85d/32.png) [@juan\_mesa](https://community.dynatrace.com/u/juan_mesa)\
**Post date:** [October 28, 2025, 10:45pm UTC](https://community.dynatrace.com/t/fix-invalid-time-series-errors-in-dql-queries/53874/2 "2025-10-28T22:45:08Z")

</div>

Hey!

That error usually happens because the query doesn’t produce a valid time series that Davis can analyze. It may work in the notebook, but the anomaly detector works better if you use explicit time-based data.I believe a good approach would be using the makeTimeseries, which forces Dynatrace to create a proper time-series output, even when the data comes from logs or events.

You can use something like this:

```markup
fetch logs
| filter label_dynatrace_alert == "true"
| summarize unhealthy_count = avg(argcod_app_info), by:{name, k8s.cluster.name, health_status}
| filter health_status != "Healthy"
| makeTimeseries unhealthy_count = avg(unhealthy_count), by:{name}, interval:1m

```

This approach will guarantee a continuous time-series that Davis can process, also you will avoid the “no valid time-series records found” issue.In short, your query logic is fine, it just needs makeTimeseries to explicitly define the time dimension for the anomaly detector.  
If you want you can go to the documentation to be more clear on the matter.

[DQL aggregation commands — Dynatrace Docs](https://docs.dynatrace.com/docs/shortlink/aggregation-commands#makeTimeseriesHope) this helps,

Best regards!

---

<div class="post-metadata">

**Author:** ![sivart\_89](https://avatars.discourse-cdn.com/v4/letter/s/848f3c/32.png) [@sivart\_89](https://community.dynatrace.com/u/sivart_89)\
**Post date:** [October 29, 2025, 12:13pm UTC](https://community.dynatrace.com/t/fix-invalid-time-series-errors-in-dql-queries/53874/3 "2025-10-29T12:13:24Z")

</div>

Thanks for the input here&nbsp;[@juan\_mesa](https://community.dynatrace.com/user/87655).&nbsp;What I am alerting off of are Prometheus metrics, nothing with logs and using logs to get this information even if it was possible, I rather not do since I would then have to customize the logic even more instead of using native provided&nbsp;Prometheus metrics.

---

<div class="post-metadata">

**Author:** ![juan\_mesa](https://avatars.discourse-cdn.com/v4/letter/j/47e85d/32.png) [@juan\_mesa](https://community.dynatrace.com/u/juan_mesa)\
**Post date:** [October 29, 2025, 1:05pm UTC](https://community.dynatrace.com/t/fix-invalid-time-series-errors-in-dql-queries/53874/4 "2025-10-29T13:05:20Z")

</div>

Got it, that make sense if you’re working with Prometheus metrics. I believe the issue comes from the join that its producing empty intervals. I´ll keep digging if there’s a work around.

---

<div class="post-metadata">

**Author:** ![sivart\_89](https://avatars.discourse-cdn.com/v4/letter/s/848f3c/32.png) [@sivart\_89](https://community.dynatrace.com/u/sivart_89)\
**Post date:** [October 29, 2025, 2:24pm UTC](https://community.dynatrace.com/t/fix-invalid-time-series-errors-in-dql-queries/53874/5 "2025-10-29T14:24:22Z")

</div>

Thank you for your time here. I’ve tried a handful of things but can’t get anything to work, but then again i’m nowhere near real proficient with dql when it comes to some of these more what I will say complex for myself queries
