01 Sep 2025 04:49 PM
Basically, I'm looking for something synonymous to the "describe" command, but for metrics. Does anything like that currently exist?
Yes, in DQL you get the auto-complete pop-ups when you type "by:" in the "timeseries" command and using the Metrics browser you can use the split-by to get a list of available dimensions, but I'm working on something more dynamic and need to find a way to get a list of all available dimensions for any specific metric.
Is there any programmatic way to do this right now? In the Classic API v2 there is an endpoint that will return this data, but how would I do that in DQL or using the newer Grail API's (I'd prefer to be able to do it solely in DQL, but if that isn't possible, I could settle with an API call if necessary).
Thanks!
11 Sep 2025 04:15 AM
DQL does not currently support retrieving dimensions for a metric directly.
You could use the Metrics API on a code tile:
13 Nov 2025 02:57 PM
To expand on this, you can actually see the available dimensions, but it's a bit inconvenient and not really a list of dimensions but a list of series. Lets assume your looking for the dimensions on the dt.host.cpu.usage metric in Grail. If you run the following DQL query you will get all series for that metric
fetch metric.series
| filter metric.key == "dt.host.cpu.usage"As I said, this isn't a list of dimensions, but each row represents a different series and the columns are the dimensions on that series. As the dimensions are dynamic and DQL doesn't support an unpivot command, the only real way to use this to get a list of dimensions would be to get the full list of series, export to csv, and then extract just the header row to get the dimension list. I'm currently looking for more information on how dimensions are added to metrics myself, for example with host centric metrics, the host custom metadata seems to be added as dimensions.
Alternatively, you can pull the auto complete suggestions programmatically via the DQL autocomplete endpoint (/platform/storage/query/v1/query:autocomplete) but I have never done so and don't know how effective it is. It is the underlying logic used by the metric browser I believe.