TheKoguryo's Tech Blog

 Version 2024.04.01

Warning

This content has been generated by machine translation. The translations are automated and have not undergone human review or validation.

12.3.2 Grafana Configuration

Register Data Source

  1. Log in to Grafana.

  2. Go to left menu Configuration > Data Sources, or click Add data source on the home dashboard. image-20220117134810025

  3. Select Oracle Cloud Infrastructure among data sources image-20220117135436025

  4. OCI Data Source Settings

    • Tenancy OCID: Log in to the OCI Console, check and enter the Tenancy OCID
    • Default Region: Select the desired Region
    • Environment: Select OCI Instance

    image-20220117135619477

  5. Click Save & Test to check if the connection is successful.

Create Dashboard

  1. Go to the left menu Dashboard > Manage, or click New Dashboard on your home dashboard. image-20220117135824894

  2. Select the blank panel.

    image-20220117144428204

  3. Click the Query icon at the top of the left menu.

  4. In the Query item, select the Oracle Cloud Infrastructure Metrics that you added the data source to, and set them one by one in order from Region to Metric. image-20220117144708334

  5. Save the graph you created.

Using the template function

  1. Click the Dashboard Settings icon in the upper right corner.

    image-20220117144954142

  2. To add a variable, select Variables on the left and click Add variable image-20220117145034056

  3. Add a new variable. As seen in Preview of values, query results can be viewed as variables and used in the dashboard.

    • Name: region
    • Query: regions() image-20220117145326464
  4. Add the 2 variables below.

    NameQuery
    regionregions()
    compartmentcompartments()
  5. Go back to the dashboard and you will see the variable added as an option at the top.

    image-20220117151404029

  6. Select the actual viewable regions and compartments. And add the following variable in Dashboard Setting. If region and compartment are not selected, the following variables are related variables. When adding variables, an error may occur during the initial inquiry.

    NameQuery
    namespacenamespaces($region,$compartment)
    resourcegroupresourcegroups($region, $compartment, $namespace)
    metricmetrics($region,$compartment, $namespace, $resourcegroup)
  7. Finish adding variables

    image-20220117150535016

  8. Save the dashboard.

  9. Go back to the graph you created earlier. Edit the first added panel again.

  10. Change the variable you created earlier as the parameter of the lower query. For example, Region: $region. Then, if you select a value from the drop-down list at the top of the dashboard, the variable value is changed and displayed in the desired graph. In the drop-down list, if there is no monitored data, the list may not be visible, so please do not misunderstand. image-20220117152023320

  11. Click Apply in the upper right corner to save the dashboard.

  12. Move from the edit screen to the dashboard screen.

  13. You can search the dashboard as shown in the picture. image-20220117152440128

Reference site



As an individual, this article was written with my personal time. There may be errors in the content of the article, and the opinions in the article are personal opinions.

Last updated on 17 Jan 2022