Compare two lists

I have a k8s cluster with autoscale. I want to query the last time there was a change in the number of nodes in my cluster (for example, 1 hour ago i had 20 and now the cluster grew to 25), and get a list of the nodes added to the cluster.
right now, I have two lists of nodes comparing now and 1 hour ago, using the next query:
SELECT uniques(hostname) as ‘number of hosts’ FROM K8sNodeSample COMPARE WITH 1 day ago where clusterName=‘my_cluster’

But with that I have two problems: first, It doesnt show the new nodes, it shows all of the existing nodes
and second, the lists doesnt show the times of growth, it shows two different times i picked.

any ideas in this subject?

Hey there @jasmin.gati,

I hope you are well and am terribly sorry for such a delayed response.

I see you are wanting to query when there is a change in the number of nodes in your cluster. I think this doc here will help get you headed in the right direction: Find and use your Kubernetes data | New Relic Documentation. I do have a question regarding your query though. You are trying to compare two lists of nodes from now and 1 hour prior but in your query you have “COMPARE WITH 1 day ago” which would give you results that may vary from whats expected.

Please let me know if you need further assistance and we will be more than happy to help!

well, I am not sure if this will work , I will look into this later to see if I can help you with a better query,
for now, i suggest you can use the unique count of the attribute and can facet the same attribute and compare it with whatever you want,
and the result will show you some numbers in a billboard graph and the ones which existed earlier will show “1<0.1%” and the ones which got newly created will only have “1” in front of it

Hey @RishavSharma,

Thank you for the suggestion, we really appreciate you reaching out to help!

@jasmin.gati Please let us know if you were able to utilize the recommendation that @RishavSharma had posted. We hope to hear from you soon!