Skip to content

Feature request: Support multi‑label filters when populating Grafana variables #335

@anilmoris

Description

@anilmoris

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions