Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ If you are running Grafana on a machine instance in Oracle Cloud, use the Instan
If you are running Grafana anywhere else you'll need to get the necessary provider and resource settings, as described in this section [Getting OCI Configuration values](https://github.com/oracle/oci-grafana-plugin/blob/master/docs/linux.md#getting-oci-configuration-values)


Latest plugin version 5.X.X (available on [Grafana Marketplace](https://grafana.com/grafana/plugins/oci-metrics-datasource/)) is compatible with **Grafana 10**.
Latest plugin version 6.5.X (available on [Grafana Marketplace](https://grafana.com/grafana/plugins/oci-metrics-datasource/)) is compatible with **Grafana 10**.

**Breaking changes:**
- In case you are migrating from a previous version (3.x.x or below) of the OCI Metrics Grafana Plugin and are not using Instance Principals (Environment not set as OCI instance), please refer to the [**Migration Instructions for Grafana OCI Metrics Data Source Settings (User Principals and Single Tenancy mode only)**](https://github.com/oracle/oci-grafana-metrics/blob/master/docs/migration.md) because you will have to reconfigure the plugin setup
Expand Down
18 changes: 18 additions & 0 deletions pkg/plugin/metrics_functions.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,14 @@ func (o *OCIDatasource) GetCompartments(ctx context.Context, tenancyOCID string,

takey := o.GetTenancyAccessKey(tenancyOCID)

region, regErr := o.tenancyAccess[takey].config.Region()
if regErr != nil {
backend.Logger.Error("client", "GetCompartments", "error retrieving default region")
return nil
}
reg := common.StringToRegion(region)
o.tenancyAccess[takey].monitoringClient.SetRegion(string(reg))

tenancyocid, tenancyErr := o.FetchTenancyOCID(takey)
if tenancyErr != nil {
backend.Logger.Warn("client", "GetSubscribedRegions", tenancyErr)
Expand Down Expand Up @@ -505,6 +513,9 @@ func (o *OCIDatasource) GetNamespaceWithMetricNames(
o.GetSubscribedRegions(ctx, tenancyOCID),
)
} else {
if region != "" {
o.tenancyAccess[takey].monitoringClient.SetRegion(region)
}
namespaceWithMetricNames = listMetricsMetadataPerRegion(
ctx,
o.cache,
Expand Down Expand Up @@ -1167,6 +1178,10 @@ func (o *OCIDatasource) GetResourceGroups(
o.GetSubscribedRegions(ctx, tenancyOCID),
)
} else {
if region != "" {
o.tenancyAccess[takey].monitoringClient.SetRegion(region)
}

metricResourceGroups = listMetricsMetadataPerRegion(
ctx,
o.cache,
Expand Down Expand Up @@ -1284,6 +1299,9 @@ func (o *OCIDatasource) GetDimensions(
o.GetSubscribedRegions(ctx, tenancyOCID),
)
} else {
if region != "" {
o.tenancyAccess[takey].monitoringClient.SetRegion(region)
}
metricDimensions = listMetricsMetadataPerRegion(
ctx,
o.cache,
Expand Down
1 change: 1 addition & 0 deletions pkg/plugin/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ func listMetricsMetadataFromAllRegion(

for _, subscribedRegion := range regions {
if subscribedRegion != constants.ALL_REGION {
mClient.SetRegion(subscribedRegion)
wg.Add(1)
go func(mc monitoring.MonitoringClient, sRegion string) {
defer wg.Done()
Expand Down
4 changes: 2 additions & 2 deletions src/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
},
{ "name": "UPL", "url": "https://oss.oracle.com/licenses/upl" }
],
"version": "6.5.2",
"updated": "2025-07-15",
"version": "6.5.3",
"updated": "2025-10-01",
"screenshots":[
{
"name":"OCI Metrics Dashboard",
Expand Down