---
title: Install and configure OCI metrics monitoring
source: https://docs.newrelic.com/docs/infrastructure/oci/install-metrics
---

Use this guide to send OCI metrics to New Relic. Metrics track the health, capacity, and performance of your OCI resources. To send logs as well, see [Monitor OCI metrics and logs](https://docs.newrelic.com/docs/infrastructure/oci/install-metrics-and-logs). To send only logs, see [Forward OCI logs](https://docs.newrelic.com/docs/logs/forward-logs/oci-log-forwarding).

## Compatibility and requirements [#requirements]

Before you begin, make sure you have:

-   A New Relic account with infrastructure monitoring permissions in a supported region (US, EU, or JP)
-   A valid New Relic [ingest license key](https://docs.newrelic.com/docs/apis/intro-apis/new-relic-api-keys/#ingest-license-key) and [user key](https://docs.newrelic.com/docs/apis/intro-apis/new-relic-api-keys/#user-api-key)
-   An OCI tenancy with an Identity and Access Management (IAM) domain, and temporary administrative access to that domain and the root compartment, enough to complete Workload Identity Federation (WIF) setup, the mechanism New Relic uses to authenticate without storing long-lived credentials. You can revoke this access once setup is complete.
-   Your OCI tenancy OCID and home region (for example, `us-ashburn-1`)
-   An OCI API signing key (only if you're deploying with Terraform)

## Guided installation [#ui-install]

Guided installation is available at **[one.newrelic.com](https://one.newrelic.com) > Integrations & Agents > Oracle Cloud Infrastructure**. The UI walks you through connecting your OCI account, then instrumenting the metric namespaces you want to monitor.

### Choose the metrics data type

Follow these steps:

1.  Select **Metrics** (for performance and usage statistics).
2.  Click **Continue**.

### Choose your integration method and configure the integration

Select your preferred integration method to ingest OCI metrics into New Relic based on your organizational needs:

**Monitor OCI with Oracle Resource Manager**

Runs Oracle Resource Manager stacks to provision what the integration needs, instead of you creating each piece by hand in the OCI console.
Follow the on-screen instructions to establish the connection.

**Manually integrate your OCI account**

In the OCI console create the required policies and service connectors. The guided installation walks you through these steps in order: create a compartment, create a dynamic group, set up a key vault secret, create a policy, set up a network, set up the metrics function, set up the metrics connector, set up WIF, and create the connection.

You will need the following information to complete the process:

-   Name the dedicated compartment as `newrelic_compartment_DO_NOT_REMOVE`. Create it in your OCI home region.
-   While creating the dynamic group in the root compartment under the default domain, add the rules `resource.type = 'serviceconnector'` and `resource.type = 'fnfunc'`.
-   Create a key vault to securely store your New Relic license key and user key for authentication.
    1.  **Create a key vault**. In the OCI console, locate and access the **Key Management and Vault services** and create a vault in the compartment you created earlier, naming it (for example, `newrelic-vault`) and choosing a standard or virtual private vault based on your security requirements.
    2.  **Create a master encryption key**. In the vault, create a master key named (for example) `newrelic-encryption-key`, using the `AES` algorithm and a `256`-bit key length.
    3.  **Create secrets for your API keys**. Create a secret for your New Relic ingest license key, named (for example) `newrelic-ingest-key`, selecting the master key you just created and pasting your ingest license key as the secret content (Plain Text). Repeat to create a second secret for your New Relic user key, named (for example) `newrelic-user-key`, pasting your user key as the secret content (Plain Text).
-   Create a serverless application and deploy the New Relic function that processes and forwards your OCI metrics.
    1.  **Create a serverless application**
        -   Access the **Functions** service under **Developer Services** in the OCI console.
        -   Create a new application with this configuration:
            -   **Name**: a descriptive name (for example, `NewRelicMetricsApp`)
            -   **Compartment**: your designated New Relic compartment
            -   **VCN**: the VCN created for the New Relic integration
            -   **Subnet**: the private subnet, for secure connectivity
            -   **Shape**: `GENERIC_X86`, for the application shape
    2.  **Configure environment variables**
        -   Within the application settings, add these configuration variables:
            -   `FORWARD_TO_NR`: set to `True` to enable data forwarding to New Relic
            -   `LOGGING_ENABLED`: set to `False` to disable verbose logging (optional)
            -   `NR_METRIC_ENDPOINT`: the New Relic endpoint, using `newrelic-metric-api` for US accounts, `newrelic-eu-metric-api` for EU accounts, or `newrelic-jp-metric-api` for JP accounts
            -   `VAULT_REGION`: the region where you created your key vault
            -   `SECRET_OCID`: the OCID of your New Relic ingest secret from the key vault
            -   `TENANCY_OCID`: your OCI tenancy OCID
        -   Save the configuration variables.
    3.  **Create and deploy the function**
        -   Within the application, create a new function with these specifications:
            -   **Function name**: a descriptive name (for example, `newrelic-metrics-function`)
            -   **Image source**: the New Relic Docker image, which you copy into a private repository in your Container Registry
            -   **Memory allocation**: appropriate memory (for example, 256 MB)
        -   For the Docker image, pull the New Relic image from Docker Hub (`docker.io/newrelic/beyond-oci-metric-function:latest`, platform `linux/amd64`). Then authenticate with your regional Container Registry endpoint (`{region}.ocir.io`) using an auth token.
        -   Tag and push the image to a private repository in your namespace in the same region as the function, and reference it in your function configuration.
        -   Complete the function creation and deployment process.
        -   To upgrade later, push the new image again and update the function to use it.

**Automate with Terraform**

For the detailed integration steps, refer to the [OCI cloud integration guide](https://registry.terraform.io/providers/newrelic/newrelic/latest/docs/guides/cloud_integrations_guide#oci).

### Instrument your metric namespaces

Once you create the connection, the OCI page in New Relic shows a metrics view with an **Add instrumentation** control:

1.  Click **Add instrumentation**, filtered to **Not instrumented** tab by default.
2.  Expand a compartment to see its individual metric namespaces, and select the ones you want to monitor.
3.  Confirm your selection. New Relic shows a summary of how many compartments and namespaces you're about to instrument. Then click **Deploy to OCI**.
4.  After the deployment finishes in OCI, the compartment moves to the **Instrumented** tab, and its data appears at **[one.newrelic.com](https://one.newrelic.com) > Infrastructure > OCI**.

Data can take up to 30 minutes to appear. If you don't see it after that, check the deployment status in the OCI console.

To instrument additional namespaces later, return to the OCI page in New Relic and repeat these steps.

### Find and use your data

Once your data starts appearing at **[one.newrelic.com](https://one.newrelic.com) > Infrastructure > OCI**, confirm the integration is working and put it to use:

1.  Verify that your OCI account appears in the integrations list.
2.  Confirm that you're receiving metrics.
3.  [Create alert conditions](https://docs.newrelic.com/docs/alerts/create-alert/create-alert-condition/alert-conditions) for key OCI metrics to get proactive notifications about performance issues.
4.  [Build custom dashboards](https://docs.newrelic.com/docs/query-your-data/explore-query-data/dashboards/introduction-dashboards/) to visualize your OCI infrastructure data and monitor performance trends.

If you don't see data after 30 minutes, see [Troubleshooting](https://docs.newrelic.com/docs/infrastructure/oci/troubleshoot).

## Related articles [#related-articles]

-   [Introduction to the OCI integration](https://docs.newrelic.com/docs/infrastructure/oci/introduction): Overview of the OCI integration and its setup options.
-   [OCI metrics reference](https://docs.newrelic.com/docs/infrastructure/oci/metrics-reference): The OCI namespaces New Relic collects from and the service each belongs to.
-   [Uninstall the OCI integration](https://docs.newrelic.com/docs/infrastructure/oci/uninstall): Remove the resources created by the integration and unlink your account.
-   [Troubleshooting](https://docs.newrelic.com/docs/infrastructure/oci/troubleshoot): Fixes for not seeing data and for trust-configuration conflicts during setup.
