Thursday, March 11, 2021

Grafana for OCI Monitoring in Docker running on Windows

 Grafana for OCI Monitoring in Docker on Windows

Step 1: Install Docker Desktop on Windows

Step 2: Download and Install WSL 2

Step 3: Make Sure Docker Desktop on Windows is Running

Step 4: Sign-in to Docker [ optional ]

Step 5: Install Grafana on Docker

Run Grafana container with persistent storage (recommended)

# create a persistent volume for your data in /var/lib/grafana (database and plugins)

docker volume create grafana-storage

# start grafana

docker run -d -p 3000:3000 --name=grafana -v grafana-storage:/var/lib/grafana grafana/grafana

Step 6 : Launch URL and Validate

Step 7 : Launch CLI

Install the Data Source Plugin. From the command line, use grafana-cli to install the plugin

# grafana-cli plugins install oci-metrics-datasource

Step 8 : Setup OCI - CLI on Docker

Follow Instruction

Step 9 : Move the .oci folder from host to grafana docker image

PS C:\Users\skrajend> docker ps

CONTAINER ID   IMAGE             COMMAND     CREATED             STATUS          PORTS                    NAMES

e647e4022bc0   grafana/grafana   "/"   About an hour ago   Up 17 minutes>3000/tcp   grafana

PS C:\Users\skrajend>

PS C:\Users\skrajend> docker cp .oci e647e4022bc0:/home/grafana

Step 10 : Configure the key_file in OCI config file

Login into the docker container as root user

PS C:\Users\skrajend> docker exec -it --user root e647e4022bc0 /bin/sh

/usr/share/grafana # cd /home/grafana

Use vi editor and \uUpdate key_file with the correct path and save the config file

/home/grafana/.oci # cat config|grep -i key


/home/grafana/.oci #

Step 11 : Change Owner of the .oci folder to grafana

/home/grafana/ # chown -Rf grafana:root .oci

Step 12: Restart grafana docker

Step 13 : Login into Grafana and Validate OCI Data Source

Step 14 : Configure the Tenancy in the Data Source


Step 15 : Loading OCI Compute Instance Monitoring Plugin from Grafana Plugin Website

Import the Plugin via the ID 

Select the data source as Oracle Cloud Infrastructure Metric

Validate the Grafana Dashboard

Happy Learning with Grafana

Popular Posts