How to return labels for a single metric in Grafana

Hi team, is it possible to configure a template variable within Grafana using the “label_names” function to extract the labels for a single metric within Grafana? For instance, “label_names(sample-metric)” would return only the labels associated with this metric, which can be used as a drop-down variable within the dashboard.

It seems like Grafana is only capable of returning the label names from every single metric.