# makeTimeseries from DQL to chart EC2 instances used by Kubernetes

**URL:** <https://community.dynatrace.com/t/maketimeseries-from-dql-to-chart-ec2-instances-used-by-kubernetes/45740>\
**Category:** DQL\
**Tags:** dql, aws, kubernetes\
**Created:** [May 23, 2024, 3:30pm UTC](https://community.dynatrace.com/t/maketimeseries-from-dql-to-chart-ec2-instances-used-by-kubernetes/45740 "2024-05-23T15:30:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![roberto\_camp1](https://avatars.discourse-cdn.com/v4/letter/r/b2d939/32.png) [@roberto\_camp1](https://community.dynatrace.com/u/roberto_camp1)\
**Post date:** [May 23, 2024, 3:30pm UTC](https://community.dynatrace.com/t/maketimeseries-from-dql-to-chart-ec2-instances-used-by-kubernetes/45740/1 "2024-05-23T15:30:23Z")

</div>

I have the following DQL query that I would like visualize as a simple bar or donut chart, to display the ec2 instance types of the worker nodes in my EKS cluster at any give time.

We have multiple EKS clusters in several different development and production accounts and tracking ec2 instance type might be of value to us.

I am having difficulty mapping the query to the makeTimeseries command.

Can anyone suggest a nice way to achieve this?

```  
fetch dt.entity.kubernetes\_node  
| filter in(id, classicEntitySelector(“type(KUBERNETES\_NODE),toRelationship.isClusterOfNode(type(KUBERNETES\_CLUSTER),entityName.equals(operations-1))”))  
| fields entity.name  
| lookup [fetch dt.entity.ec2\_instance | fields localHostName, awsInstanceType],lookupField:localHostName,sourceField:entity.name

// | makeTimeseries count()  
| makeTimeseries count(default: 0), interval: 30m

```

I keep getting the error: “Please specify the parameter `time` explicitly, as the implicit default `timestamp` doesn’t exist.”

---

<div class="post-metadata">

**Author:** ![krzysztof\_hoja](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/krzysztof_hoja/32/34625_2.png) [@krzysztof\_hoja](https://community.dynatrace.com/u/krzysztof_hoja)\
**Post date:** [May 24, 2024, 8:31pm UTC](https://community.dynatrace.com/t/maketimeseries-from-dql-to-chart-ec2-instances-used-by-kubernetes/45740/2 "2024-05-24T20:31:09Z")

</div>

In this case case there is no need to (and in fact you cannot) use _ **makeTimeseries** _  
Time dimension does not exist in result of _ **fetch \<entity\>** _ query. To count occurrences of particular field _ **summarize** _ is enough:

```markup
fetch dt.entity.kubernetes_node
//| filter in(id, classicEntitySelector("type(KUBERNETES_NODE),toRelationship.isClusterOfNode(type(KUBERNETES_CLUSTER),entityName.equals(operations-1))"))
| fields entity.name
| lookup [
    fetch dt.entity.ec2_instance 
    | fields localHostName, awsInstanceType
    ], lookupField:localHostName, sourceField:entity.name
| summarize {cnt=count()}, by: {lookup.awsInstanceType}
| fieldsAdd lookup.awsInstanceType = coalesce(lookup.awsInstanceType, "Unknown")
| sort cnt desc

```

note: I commented out filer for cluster name. I do not have such name in&nbsp; my environment. Result looks like:

 ![krzysztof_hoja_0-1716582626958.png](https://global.discourse-cdn.com/dynatrace/original/3X/c/d/cde6f5bb76e26fa38ab3b40574862eec75f24da6.png)

---

<div class="post-metadata">

**Author:** ![roberto\_camp1](https://avatars.discourse-cdn.com/v4/letter/r/b2d939/32.png) [@roberto\_camp1](https://community.dynatrace.com/u/roberto_camp1)\
**Post date:** [May 26, 2024, 4:21pm UTC](https://community.dynatrace.com/t/maketimeseries-from-dql-to-chart-ec2-instances-used-by-kubernetes/45740/3 "2024-05-26T16:21:56Z")

</div>

Thank you&nbsp;[@krzysztof\_hoja](https://community.dynatrace.com/user/25373)&nbsp;that works very well!
