Is there a way to set entitySelector to get information for specific disk from builtin:host.disk.usedPct metric with /metrics/query rest call?
When filtering by host
We get answer with value
When trying to filter by disk
We get empty answer
Is that a bug or a feature or something that I have done wrong ?
Thanks in advance for your input on this question
Solved! Go to Solution.
It seems like the issue may be that for some of the older metrics the primary entity must be included in the selector which for this metric is the host and that approach doesn't include that when filtering to the disk in the entity selector.
I did try a few alternatives though where you can include the disk id filter in the query itself to get the same desired result.
Using entity selector still, just in the metric selector as a filter: builtin:host.disk.usedPct:filter(in("dt.entity.disk",entitySelector("entityId("DISK-XXXXXXXX")"))):splitBy("dt.entity.disk") Just filtering on the disk id itself without a selector: builtin:host.disk.usedPct:filter(eq("dt.entity.disk", "DISK-XXXXXXXX")):splitBy("dt.entity.disk")
Thanks for your reply.
This filter works perfectly when using it within Data explorer code.
Our issue is when trying to convert this filter to rest api entitySelector
Any suggestion how to convent this filter to entitySelector?
You can add the filters (either the entity selector approach or the somewhat simpler disk dimension filter) in the metricSelector field of the API call. When you add the disk entity selector in that entitySelector field it filters out the host which needs to be present for this metric as that is it's 'primary' dimenions.
So don't use the entitySelector field and just put the whole thing (including the filter) in the metricSelector field: