Grafana is a popular technology that makes it easy to visualize metrics. The Oracle Cloud Infrastructure Data Source for Grafana is used to extend Grafana by adding OCI as a data source. The plugin enables you to visualize metrics related to a number of OCI resources: Compute, Networking, Storage, and custom metrics.
This walkthrough is intended for use by people who would like to deploy Grafana and the OCI Data Source for Grafana on a Kubernetes environment.
Make sure you have access to the Monitoring Service and that metrics have been enabled for the resources you are trying to monitor.
In order to use the the OCI Data Source for Grafana on OKE, the first step is to create a dynamic group used to group virtual machine or bare metal compute instances as “principals” (similar to user groups). Create a dynamic group that corresponds to all of your OKE worker nodes:
Next, create a policy named “grafana_policy” in the root compartment of your tenancy to permit instances in the dynamic group to make API calls against Oracle Cloud Infrastructure services. Add the following policy statements:
-
allow dynamicgroup grafana to read metrics in tenancy
-
allow dynamicgroup grafana to read compartments in tenancy
Next, we are going to install the stable Helm chart for Grafana. We will do this in two parts: First, update the stable repository by running: helm repo update
Next, install the chart for Grafana.
For OSS Grafana run: helm install --set plugins=oci-metrics-datasource grafana bitnami/grafana
Follow the instructions given in the output, after the helm chart install for accessing Grafana, retrieving password for admin user account etc.
The next step is to configure the plugin. Navigate to the Grafana homepage at http://localhost:3000
Log in with the default username admin
and the password you obtained from the kubectl command from the previous section.
On the Home Dashboard click the gear icon on the left side of the page.
Click Add data source.
Choose oracle-oci-datasource as your data source type.
Fill in your Tenancy OCID, Default Region, and Environment. Your Default region is the same as your home region listed in the Tenancy Details page. For Environment choose OCI Instance.
For Environment choose OCI Instance (please note that multitenancy mode is not yet supported with OCI Instance as Environment).
You can then fill in your Default Region.
Click Save & Test to return to the home dashboard.
Check out how to use the newly installed and configured plugin in our Using Grafana with Oracle Cloud Infrastructure Data Source walkthrough.