We are experiencing an issue with the OCI Metrics Datasource where the Builder does not list compartments correctly.
In the COMPARTMENT field, only the tenancy root compartment is returned. First-level compartments and child compartments are not shown.
Environment
OS: Oracle Linux (ARM64)
Grafana: 13.1.0 (Docker)
Plugin: oci-metrics-datasource 6.5.5
Authentication: Instance Principal
Grafana DB: SQLite
Current behavior
In Builder mode, COMPARTMENT returns only the root tenancy compartment.
Namespaces and metrics shown are limited to root scope.
New panels cannot be configured for resources located in child compartments.
Expected behavior
Builder should list all compartments accessible by the principal (at least first-level compartments).
It should be possible to navigate/select child compartments in panel creation flow.
Evidence IAM/OCI is working correctly
Instance Principal is healthy.
OCI CLI using the same principal returns compartments correctly (first-level and subtree).
Metrics queries work correctly via CLI.
Read permissions for metrics and compartments were already applied and validated.
Validation command (generic)
oci iam compartment list
–compartment-id TENANCY_OCID
–access-level ACCESSIBLE
–all
–auth instance_principal
Additional tests already performed
Upgraded Grafana to 13.1.0.
Clean reinstall of OCI plugin.
Created a brand-new datasource.
Temporarily tested broader IAM permissions.
Behavior unchanged in Builder.
Impact
New OCI panels cannot be created via Builder for non-root compartments.
Existing dashboards still work when OCID/query is already persisted.
Request
Please verify a possible bug/regression in OCI Metrics Datasource compartment discovery flow (Builder).
Please provide an official workaround until a fix is available.
Since the same Instance Principal can list all accessible compartments via the OCI CLI, this is less likely to be an IAM issue.
One thing to verify is whether the datasource is actually receiving only the root compartment or whether the Builder is failing to display the full hierarchy. Check the browser’s Network tab while the Builder loads the compartment list:
If the API response contains only the root compartment, the issue is likely in the datasource’s compartment discovery logic or the request it sends to OCI.
If the API response contains all compartments but the Builder only shows the root, it’s likely a Builder/UI bug.
Based on the information you’ve shared, I couldn’t find a documented regression or an official workaround. If the Network trace confirms either behavior above, it would be useful to include it in the bug report for the plugin maintainers: