Skip to content

Latest commit

 

History

History
72 lines (37 loc) · 4.86 KB

File metadata and controls

72 lines (37 loc) · 4.86 KB

Local Installation (Linux) - Oracle Cloud Infrastructure Data Source for Grafana

Background

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 local server.

Install the Oracle Cloud Infrastructure CLI

The Oracle Cloud Infrastructure CLI provides you with a way to perform tasks in OCI from your command line rather than the OCI Console. It does so by making REST calls to the OCI APIs. We will be using the CLI to authenticate between our local environment hosting Grafana and OCI in order to pull in metrics. The CLI is built on Python (version 2.7.5 or 3.5 or later), running on Mac, Windows, or Linux.

Begin by installing the Oracle Cloud Infrastructure CLI. Follow the installation prompts to install the CLI on your local environment. After the installation is complete, use the oci setup config command to have the CLI walk you through the first-time setup process. If you haven't already uploaded your public API signing key through the console, follow the instructions here to do so.

Configure OCI Identity Policies

In the OCI console under Identity > Groups click Create Group and create a new group called grafana. Add the user configured in the OCI CLI to the newly-created group.

Screen Shot 2018-12-19 at 3.02.31 PM

Under the Policy tab click Create Policy and create a policy allowing the group to read tenancy metrics. Add the following policy statements:

  • allow group grafana to read metrics in tenancy
  • allow group grafana to read compartments in tenancy

Screen Shot 2018-12-19 at 3.00.10 PM

Install Grafana and the OCI Data Source for Grafana Plugin

To install the data source make sure you are running Grafana 3.0 or later. Use the grafana-cli tool to install the Oracle Cloud Infrastructure Data Source for Grafana from the command line:

grafana-cli plugins install oci-datasource

The plugin will be installed into your Grafana plugins directory, which by default is located at /var/lib/grafana/plugins. Here is more information on the CLI tool. Alternatively, you can manually download the .zip file and unpack it into your /grafana/plugins directory. To do so, change to the Grafana plugins directory: cd /usr/local/var/lib/grafana/plugins. Download the OCI Grafana Plugin: wget https://grafana.com/api/plugins/oci-datasource/versions/1.0.0/download. Create a directory and install the plugin: mkdir oci && tar -C oci -xvf plugin.tar and then remove the tarball: rm plugin.tar.

To start the Grafana server, run: sudo systemctl start grafana-server.

Navigate to the Grafana homepage at http://localhost:3000.

Configure Grafana

Screen Shot 2018-12-17 at 3.23.46 PM

Log in with the default username admin and the password admin. You will be prompted to change your password. Click Skip or Save to continue.

Screen Shot 2018-12-17 at 3.23.54 PM

On the Home Dashboard click the gear icon on the left side of the page.

Screen Shot 2018-12-17 at 3.24.02 PM

Click Add data source.

Screen Shot 2018-12-17 at 3.24.13 PM

Choose oracle-oci-datasource as your data source type.

Screen Shot 2018-12-17 at 3.24.24 PM

Fill in your Tenancy OCID, Default Region, and Environment. For Environment choose local.

Click Save & Test to return to the home dashboard.

Screen Shot 2018-12-17 at 3.25.33 PM

Next Steps

Check out how to use the newly installed and configured plugin in our Using Grafana with Oracle Cloud Infrastructure Data Source walkthrough.