Enabling Monitoring for Compute Instances

This topic describes how to enable monitoring for Compute instances that use supported images.

Warning

Avoid entering confidential information when assigning descriptions, tags, or friendly names to your cloud resources through the Oracle Cloud Infrastructure Console, API, or CLI.

Except for Compute instances, all resources that support the Monitoring service emit metrics by default. A Compute instance using a supported image emits metrics when it has the required instance configuration and Oracle Cloud Agent software.

Supported Images

Prerequisites

  • Service gateways or public IP addresses: The Compute instances must have either service gateways or public IP addresses to send metrics to the Monitoring service.
  • IAM policies: To create and update Compute instances, you must be given the required type of access in a policy  written by an administrator, whether you're using the Console or the REST API with an SDK, CLI, or other tool. If you try to perform an action and get a message that you don’t have permission or are unauthorized, confirm with your administrator the type of access you've been granted and which compartment  you should work in. For more information, see Creating an Instance.
  • Instance access: To connect to a Linux Compute instance, you must have an SSH key. To connect to a Windows instance, you must have the instance password. For more information, see Connecting to an Instance.

Process Overview: Enabling Monitoring for a New Compute Instance

Following is the process for configuring a new Compute instance to emit metrics.

Task 1: Create a monitoring-enabled instance
Task 2: (Optional) Create a service gateway

Find Out if Monitoring Has Your Metrics

To find out if Monitoring has your metrics you either query instance metrics or view the instance configuration.

Query Instance Metrics

Query metrics to determine if Monitoring is receiving metrics emitted by the instance. For instructions, see Using the Console or Using the API.

Not seeing metrics for your instance?

View the Instance Configuration

View the instance configuration to determine if monitoring is enabled. Monitoring-enabled instances may require installation of the Oracle Cloud Agent software before metrics are emitted. For instructions, see Using the Console or Using the API.

Process Overview: Enabling Monitoring for an Existing Compute Instance

Following is the process for configuring an existing Compute instance to emit metrics.

Task 1: Enable monitoring

Update the instance configuration to enable monitoring. For instructions, see Using the Console or Using the API.

Task 2: Install the Oracle Cloud Agent software

Choose the operating system corresponding to the instance.

Linux
Windows

Task 3: (Optional) Create a service gateway

If your instances do not have public IP addresses, set up a service gateway on the virtual cloud network (VCN). The service gateway allows the instances to send metrics to the Monitoring service without the traffic going over the internet. Here are special notes for setting up the service gateway to access the Monitoring service:

  • When creating the service gateway, enable the service label called All <region> Services in Oracle Services Network. It includes the Monitoring service.
  • When setting up routing for the subnet that contains your instances, set up a route rule with Target Type set to Service Gateway, and the Destination Service set to All <region> Services in Oracle Services Network.

For detailed instructions, see Setting Up a Service Gateway in the Console.

Updating the Oracle Cloud Agent Software

We recommend always running the latest version of the Oracle Cloud Agent software.

If the installed software can access the internet, then no action is needed. The software periodically checks for newer versions and automatically installs the latest version when different from the current version.

If the installed software does not have access to the internet, then a manual update is required. For example, a Compute instance that has no internet gateway or service gateway cannot access the internet. In this situation, the software cannot complete its checks for newer versions.

To see which version of the Oracle Cloud Agent software is installed
To manually update the Oracle Cloud Agent software on a Compute instance

Oracle Cloud Agent software versions

Linux versions
Windows versions

Using the Console

Use the Console to create a Compute instance with monitoring enabled and, for new instances using legacy images, to run the script that installs the required Oracle Cloud Agent software.

To create a monitoring-enabled instance

Steps depend on the date of the image used to create the instance.

Latest version of supported image
Legacy version of supported image
To find out if monitoring is enabled or if Monitoring is receiving metrics
To enable monitoring on an existing instance

Using the API

Use the API to enable monitoring on a new or existing instance. After monitoring is enabled, you can install the Oracle Cloud Agent software.

For information about using the API and signing requests, see REST APIs and Security Credentials. For information about SDKs, see Software Development Kits and Command Line Interface.

To create a monitoring-enabled instance
To find out if monitoring is enabled or if Monitoring is receiving metrics
To enable monitoring on an existing instance