-
Notifications
You must be signed in to change notification settings - Fork 43
Description
impacted version: v6.5.2
Problem
When building Grafana variables with the OCI Metrics data source, the variable query helper dimensions(...) does not provide a way to scope the variables return values. This makes it impossible to scope a downstream variable to selections made in upstream variables.
for example, restricting $target to series where datacenter="$datacenter" and cluster="$cluster"
Why this matters
• Large compartments/tenancies produce very large, noisy variable lists when they can’t be constrained.
• Hierarchical dashboards (Datacenter → Cluster → Namespace → Pod/Hostname/Target) need variables that honor upstream selections.
• Lack of multi‑label scoping forces per‑panel query hacks and hurts maintainability/performance.
Current behavior
• dimensions($region, $compartment, $metric_namespace, , $resourcegroup) returns dimension tuples but has no way to pass a label selector such as {datacenter="$datacenter", cluster="$cluster"} to constrain what is returned.
Expected behavior
Support scoping variable queries by multiple labels.
examples:
dimensions($region, $compartment, $metric_namespace, , $resourcegroup,
selector='{datacenter="$datacenter", cluster="$cluster"}')
Workarounds tried
• Post‑filtering with regex in the variable, example:
Regex: /.datacenter="([^"])"./
Regex: /.target="([^"])"./
This regex filter only helps for one dimension and still fetches everything.
Proposed solution
• Add multi‑label filter support to dimensions(...) and/or dimension_values(...) using a Prometheus‑style {label="value", ...} selector.