Visualizing Logs on OCI

Tom MooreTom Moore
3 min read

Being able to view the status of an application that is running in production is critical. As developers we can’t necessarily, and should not ever, be poking around in production systems. This is even more critical when it comes to Cloud Native applications where we have no access to the underlying infrastructure.

Logs are a great source of information, however searching through logs is difficult, time consuming, and generally not something that you are going to do unless you know there is a problem…

OCI gives you a convenient, and it turns out pretty easy, way to turn your logs into visualizations that can help you to identify problems with your application. In this blog post we are going to walk through how you can set up a dashboard that will visualize errors.

The source

I am going to highlight OCI Object Storage as the source of information for the dashboard. Lets imagine I have an application that makes heavy use of OCI Object Storage, and errors interacting with that service would be an indicator that my application is having issues.

The first thing to do is set up logging on your bucket.

From the object storage interface, on a per bucket basis, OCI gives you the ability to set up logging. Once enabled, logging will automatically happen based on interactions with your bucket.

In this image you can see that for my bucket, I have selected Logs on the left hand navigation, and I have enabled both logs.Once this is done, you will be able to select a log group and log name for your log.

Here you can see the log entries for the bucket.

Setting up a dashboard

The next step is to create a dashboard to visualize the data. From the OCI Hamburger menu, you can select Dashboards

Select the “Dashboard Groups” option on the left.

Create your new Dashboard group, giving it a name and a description. You should also select the compartment that the dashboard will reside in.

Once you have your dashboard group, you can return to the main page for Dashboards and select the create a new Dashboard option.

Your new dashboard has a canvas that you can use to visualize data from the log. I am going to choose a new dashboard from scratch, provide a name and description, and select the compartment and my dashboard group.

My new dashboard provides a blank canvas to build on.

Adding a new widget gives me some options. For this first option, I am going to choose “Logging Chart”

Next I am going to click configure.

Next I want to set up the type of graph that makes sense for the visualization. In my case I want a line graph, over time, for the current day, and an interval period of 1 minute. (The smallest granularity available.)

Next I am going to scroll down to define the specific data that I am after. At the bottom, click the clear button on the logs to search option. This will allow you to select a specific log.

Navigate the search panel and add the specific log that you want to visualize. You can select multiple logs if that is appropriate, however in this case, I am only interested in a single log.

Next I can add in specific filters for the data that I am after.

The filter will allow me to type in, and provide content options.

Once I have completed my filters, I can save my changes, and go back to my dashboard to view the results.

Next I just need to save my changes and use my dashboard.

0
Subscribe to my newsletter

Read articles from Tom Moore directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Tom Moore
Tom Moore

I am a Master Principal Cloud Architect for Oracle Cloud (OCI). I create content designed to help developers with Cloud-Based technologies. This includes AWS, OCI, and occasionally Azure. I'm not excluding GCP, I just haven't had any excuse to dive into GCP yet. As far as development is concerned, my area of focus is predominantly .NET, though these days, I do branch out occasionally into NodeJS and Python. I am available for in-person speaking events as well as virtual sessions. I can usually be found at Boston Code Camp. Opinions expressed on my blog are my own, and should not be considered to be the opinions of my employer.