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. To send only logs, see Forward OCI logs.
Compatibility and requirements
Before you begin, make sure you have:
A New Relic account with infrastructure monitoring permissions in a supported region (US, EU, or JP)
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
Guided installation is available at 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:
Select Metrics (for performance and usage statistics).
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:
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.
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.
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.
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.
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.
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
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.
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.