Plugins 〉Oracle Cloud Infrastructure Logs
Oracle Cloud Infrastructure Logs
Oracle Cloud Infrastructure Logging Data Source
Grafana is a popular technology that makes it easy to visualize metrics and logs. The OCI Logging Grafana Plugin can be used to extend Grafana by adding Oracle Cloud Logging as a data source in Grafana. The plugin allows you to retrieve logs related to a number of resources on Oracle Cloud: Compute, Networking, Storage, and custom logs from your application. Once these logs are in Grafana, they can be analysed along with metrics, giving you a single pane of glass for your application monitoring needs.
For custom logs from your application, see Custom Logging on OCI.
We will discuss two different Grafana IAM configurations that needs to be in place, for Grafana to fetch the logs from Oracle Cloud Logging Service.
For local/dev box environment
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 GrafanaLoggingUserGroup. Add the user configured in the OCI CLI to the newly-created group.
Under the Policy tab switch to the root compartment and click Create Policy. Create a policy allowing the group to read tenancy metrics. Add the following policy statements:
allow group GrafanaLoggingUserGroup to read log-groups in tenancy
allow group GrafanaLoggingUserGroup to read log-content in tenancy
For compute-instance/VM on Oracle Cloud Infrastructure
Create Dynamic Group for your instance
Provision an Oracle Linux virtual machine in OCI connected to a Virtual Cloud Network with access to the public internet. If you do not already have access to a Virtual Cloud Network with access to the public internet you can navigate to Virtual Cloud Networks under Networking and click Create Virtual Cloud Network. Choosing the
CREATE VIRTUAL CLOUD NETWORK PLUS RELATED RESOURCES option will result in a VCN with an Internet Routing Gateway and Route Tables configured for access to the public internet. Three subnets will be created: one in each availability domain in the region.
After creating your VM, the next step is to create a dynamic group used to group virtual machine or bare metal compute instances as “principals” (similar to user groups). You can define the dynamic group similar to below, where your instance is part of the compartment given in the definition of the dynamic group.
Create IAM policy for Dynamic Group for your instance
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 DynamicGroupForGrafanaInstances to read log-groups in tenancy
allow dynamicgroup DynamicGroupForGrafanaInstances to read log-content in tenancy
Installing Oracle Cloud Infrastructure Logs on Grafana Cloud:
Installing plugins on a Grafana Cloud instance is a one-click install; same with updates. Cool, right?
For more information, visit the docs on plugin installation.
Installing on a local Grafana:
For local instances, plugins are installed and updated via a simple CLI command. Plugins are not updated automatically, however you will be notified when updates are available right within your Grafana.
1. Install the Data Source
Use the grafana-cli tool to install Oracle Cloud Infrastructure Logs from the commandline:
grafana-cli plugins install
The plugin will be installed into your grafana plugins directory; the default is /var/lib/grafana/plugins. More information on the cli tool.
Alternatively, you can manually download the .zip file for your architecture below and unpack it into your grafana plugins directory.
Alternatively, you can manually download the .zip file and unpack it into your grafana plugins directory.
2. Configure the Data Source
Accessed from the Grafana main menu, newly installed data sources can be added immediately within the Data Sources section.
Next, click the Add data source button in the upper right. The data source will be available for selection in the Type select box.
To see a list of installed data sources, click the Plugins item in the main menu. Both core data sources and installed data sources will appear.
What’s new in Grafana Enterprise Metrics 1.3, our scalable, self-hosted Prometheus service
Blog post 5 min
Introducing the new Open Distro for Elasticsearch plugin for Grafana, also available in Amazon Managed Service for Grafana
Blog post 3 min
Want to visualize software development insights with Grafana? With our new Jira Enterprise plugin, you can!
Blog post 5 min
A closer look at the admin API and plugin for centralized tenant adminstration and control in Grafana Enterprise Logs
Blog post 4 min
The new Splunk Infrastructure Monitoring plugin brings the SaaS formerly known as SignalFx to your Grafana dashboards
Blog post 5 min
The Splunk plugin for Grafana now supports data links for jumping directly from logs to traces
Blog post 5 min
With the new AWS IoT SiteWise plugin, you can visualize and monitor your equipment data in Grafana dashboards
Blog post 2 min
The new Wavefront Enterprise plugin brings the high-scale, high-speed SaaS to your Grafana dashboards
Blog post 5 min