Need help configuring Grafana plugin for OCI

Hello Everyone,

I am looking for some help with configuring grafana to display OCI metrics. I am following the instructions from https://docs.cloud.oracle.com/iaas/Content/API/SDKDocs/grafana.htm

I am doing a setup on a local host (Outside of OCI), So as instructed created a user “monitor_oci” in OCI with privileges to monitor my cloud resources in my tenancy.

I have grafana working on the localhost (running OEL 6) configured to use prometheus as Default datasource. Installed the oci plugin. Installed it as root.

I have created a user “oci_monitor” on my localhost and set up OCI CLI, and configured it to use the “monitor_oci” user in the tenancy. I am able to make calls using OCICLI

When trying to create the Datasource. I am getting a message "Data source is not working
" .

I have two queries here:

  1. Which user should be able to make OCI calls using OCI CLI? as OCI is getting installed on /home/oci_monitor/bin only oci_monitor is able to run it. Grafana is running as user grafana.

  2. Can I get a more detailed log of what is failing when grafana is trying add the data source?

Any help is much appreciated.

Thanks!
Bapi

Hi,

To anyone facing the same issue, User grafana needs to able to connect to oci using oci-cli, It accesses the config from

[root@mycb grafana]# pwd
/usr/share/grafana

[root@mycb grafana]# ls -latr
.
.
drwxr-xr-x.  2 grafana grafana   73 May 20 03:05 .oci
drwxr-xr-x.  2 grafana grafana   73 May 20 03:06 .oraclebmc

Place valid config file in them and the api keys and retry to add data source.

Also, log is in /var/log/grafana/grafana.log

hi @bapiraju : Does user grafana need to have oci-cli command execution capabilities? Currently grafana user is just a service account. Also I did all the steps as above, but still facing the following error:

t=2022-06-15T17:44:24+0000 lvl=eror msg=“Metric request error” logger=context userId=1 orgId=1 uname=admin error=“rpc error: code = Unknown desc = error with client(common.composingConfigurationProvider) {\n Providers: ([]common.ConfigurationProvider) (len=3 cap=3) {\n (common.fileConfigurationProvider) Configuration provided by file: /usr/share/grafana/.oci/config,\n (common.fileConfigurationProvider) Configuration provided by file: /usr/share/grafana/.oraclebmc/config,\n (common.environmentConfigurationProvider) Configuration provided by environment variables prefixed with: TF_VAR\n }\n}\ncan not create client, bad configuration: did not find a proper configuration for private key”