oracle / oci-grafana-metrics

Grafana datasource plugin for OCI metrics
https://grafana.com/grafana/plugins/oci-metrics-datasource
Universal Permissive License v1.0
79 stars 40 forks source link

Multitenancy support #146

Closed mamorett closed 1 year ago

mamorett commented 2 years ago

Scope of this PR is to implement the Multitenancy capability for the plugin. The multitenancy support can be selected when configuring the plugin. The only supported method for multitenancy is the classical OCI authentication (OCIDUser/key), therefore the keys and the .oci/config files need to be mounted in the grafana user home directory. The change is intended to maintain retro-compatibility with the current single-tenancy configurations. Changes in datasource.go includes function to handle the connections across multiple tenancies, while the UI includes the changes required to select the correct oci/config. Several other changes are made in the javascript set of files to make use of the tenancyconfig variable, which contains reference to the tenancy configuration and Tenancy OCID to be used. What is tested:

huskerdhf commented 2 years ago

When posting a PR please summarize the following:

Providing this information is important rather than forcing reviewers to have to divine or guess this context from the changes made. This will ensure that the review process is more efficient & effective and in the end the resulting changes are better than otherwise.