Introduction

Overview

Grafana is an open-source visualisation and dashboarding platform that seamlessly integrates with Oracle Cloud Infrastructure (OCI) to visualise Observability and Management (O&M) metrics. Deploying Grafana via the OCI Marketplace simplifies the setup process by providing pre-configured security rules, ports, policies, and the OCI Metrics Data Source plugin. This solution enables you to build Grafana dashboards based on OCI O&M metrics, facilitating efficient monitoring of your cloud resources. Additionally, example dashboards for all O&M services are provided for easy import which then can be modified and cloned as needed.

Architecture

The deployment architecture involves provisioning a Grafana instance within OCI, configured to collect and display metrics from various OCI services. The following diagram illustrates the high-level architecture:

Description: The diagram showcases the integration between Grafana and OCI services, 
highlighting the flow of metrics data from OCI to Grafana dashboards.
Description of Grafana-Architecture.png

Benefits

This solution comes with pre-configured security rules, ports, policies and oci-metric-datasource, as well as dashboards for various O&M services. This eliminates the need to set up services metrics collection. In addition, this solution makes it easy to import and visualize key metrics into a tool you are already familiar with and are using in your daily monitoring, such as Grafana.


Implementation Steps

Prerequisites

Before getting into the implementation, ensure you have the following in place:

  • An active OCI account
  • A designated and a compartment
  • Appropriate IAM policies to allow Grafana to access OCI Monitoring services.

Step 1: Deploy Grafana from OCI Marketplace

  1. Log in to your OCI Console.
  2. Navigate to the Marketplace from the main menu.
  3. Search for Grafana in the Marketplace.
  4. Select the Grafana Listing.
  5. Choose the desired compartment and click Launch Stack.
  6. Review the stack information and click Create to initiate the deployment.

Step 2: Configure Instance Details

After launching the stack:

  1. Select your compartment and availability domain.
  2. Choose the appropriate instance shape and Oracle Linux image.
  3. Configure networking options, including VCN and subnet selections.
  4. Set up SSH keys for secure access.
  5. Define host and policy names as required.

Step 3: Review and Launch Instance

  1. Review all configurations to ensure they meet your requirements.
  2. Click Launch Instance to deploy the Grafana server.

Validation

  1. Access the Grafana instance using the public IP address provided.
  2. Log in with the default credentials (username: admin, password: admin).
  3. Upon first login, you’ll be prompted to change the default password.
  4. Navigate to Configuration > Data Sources and verify that the OCI Metrics data source is configured.
  5. Test the data source to ensure connectivity with OCI Monitoring services

Use Case

Utilising Pre-Built Dashboards

The solution provides pre-configured dashboards for various OCI services. These ready-to-use dashboards and can be easily configured to suit your specific needs. The following are included:

  • Application Performance Monitoring (APM)
  • Database Management
  • Ops Insights (OPSI)
  • Stack Monitoring

To import these dashboards:
  1. Navigate to Dashboards > Manage in Grafana.
  2. Click Import and upload the JSON files available in the GitHub repository.
  3. Customize the dashboards as needed to suit your monitoring requirements.

Example Use Case: Monitoring Host Systems

By leveraging the pre-built dashboards, and monitoring host CPU and Memory utilisation and disk metrics you can make informed decisions about your systems. For example, if you consistently notice high CPU usage without heavy loads, it might indicate you are running inefficient applications or you are in need for hardware upgrades.

Similarly, monitoring disk usage can help you identify when to scale up or clean up data. For example, if you see that disk usage is consistently high, it might be time to add more storage or archive old data.

Description: The dashboard displays real-time usage metrics,
						 aiding in performance analysis and decision-making.
Description of InstanceMonitor.jpg

Next steps

Follow these instructions as well as those on Github Repository and use Grafana to visualise your metrics. Create your own dashboards and learn how to get deep insights into your infrastructure and applications.



Acknowledgements

  • Primary Author: Mahesh Sharma

More Learning Resources

Explore other labs on docs.oracle.com/learn or access more free learning content on the Oracle Learning YouTube channel. Additionally, visit education.oracle.com/learning-explorer to become an Oracle Learning Explorer.

For product documentation, visit Oracle Help Center.