Oracle Cloud Infrastructure

Overview

Oracle Cloud Infrastructure (OCI) is an infrastructure-as-a-service (IaaS) and platform-as-a-service (PaaS) used by enterprise-scale companies. With a full suite of managed services for hosting, storage, networking, databases, and more.

With the Datadog integration, OCI users can stream all of their logs directly into Datadog, where they can then be stored indefinitely, analyzed for troubleshooting, and monitored for security and compliance posturing.

Setup

Log collection

Send logs from your Oracle Cloud Infrastructure to Datadog by following either process:

  1. Configure an OCI log.
  2. Create an OCI function.
  3. Setup an OCI Service Connector.

The instructions below use the OCI portal to set up the integration.

OCI logging

  1. In the OCI portal, navigate to Solutions and Platform -> Logging -> Log Groups.
  2. Click on Create Log Group to be directed to the Create Custom Log page.
  3. Select your Compartment name. This selection remains consistent across the entire installation.
  4. Use “data_log_group” as the Name and type in a Description of your choice.
  5. Click on Create to set up your new Log Group.
  6. Navigate to Solutions and Platform -> Logging -> Logs.
  7. Click on Enable Service Log.
  8. Under Select Resource select your Compartment, a Service you would like to collect logs from, and a Resource belonging to that service.
  9. Under Configure Log select “Write Access Events” as the Log Category and type in a Name of your choice.
  10. Click on Enable Log, to create your new OCI Log.

For more information on OCI Logs, see Enabling Logging for a Resource.

OCI function

  1. In the OCI portal, navigate to Solutions and Platform -> Developer Services -> Functions.
  2. Select an existing application or click Create Application.
  3. Create a new OCI function within your application. See the Oracle Overview of Functions for details.
  4. It is recommended to create a boilerplate Python function first and replace the auto generated files with Datadog’s source code:
    • Replace func.py with code from the Datadog OCI repo.
    • Replace func.yaml with code from the Datadog OCI repo. DATADOG_TOKEN and DATADOG_HOST must be replaced with your Datadog API key and region logs intake link.
    • Replace requirements.txt with code from the Datadog OCI repo.

OCI service connector hub

  1. In the OCI portal, navigate to Solutions and Platform -> Logging -> Service Connectors.
  2. Click on Create Connector to be directed to the Edit Service Connector page.
  3. Select the Source as Logging and Target as Functions.
  4. Under Configure Source Connection select a Compartment name, Log Group, and Log. (The Log Group and Log created in the first step)
  5. If you also want to send Audit Logs, click on +Another Log and select the same Compartment while replacing “_Audit” as your Log Group.
  6. Under Configure Target Condition select a Compartment name, Function Application, and Function. (The Function Application and Function created in the previous step)
  7. If you are prompted to create a policy, click Create.
  8. Click Save Changes to finish creating your Service Connector.

For more information on OCI Object Storage, see Oracle’s Service Connector blog post.

  1. Configure an OCI log.
  2. Create an OCI object store and enable read/write access for OCI logs.
  3. Create an OCI function.
  4. Set up an OCI event.

The instructions below use the OCI portal to set up the integration.

OCI logging

  1. In the OCI portal, navigate to Solutions and Platform -> Logging -> Logs.
  2. Click on Create Custom Log to be directed to the Create Custom Log page.
  3. Give your new OCI log a name.
  4. Select a Compartment and Log Group. These selections remain consistent across the entire installation.
  5. Click on Create Custom Log to be directed to the Create Agent Config page.
  6. Click on Create new configuration.
  7. Give your new configuration a name. Your compartment is preselected for you.
  8. Set the group type to Dynamic Group and group to one of your existing groups.
  9. Set the input type to Log Path, enter your preferred input name and use “/” for file paths.
  10. Click on Create Custom Log, then your OCI log is created and available on the logs page.

For more information on OCI Logs, see Enabling Logging for a Resource.

OCI object storage

  1. In the OCI portal, navigate to Core Infrastructure -> Object Storage -> Object Storage.
  2. Click on Create Bucket to be directed to the Create Bucket form.
  3. Select Standard for your storage tier and check Emit Object Events.
  4. Complete the rest of the form based on your preference.
  5. Click on Create Bucket, then your bucket is created and available in the bucket list.
  6. Select your new bucket from the active bucket list and click on Logs under resources.
  7. Toggle read to enabled which directs you to an Enable Log side menu.
  8. Select a Compartment and Log Group (use the same selections as your OCI log).
  9. Enter a name for the Log Name and select your preferred log retention.

For more information on OCI Object Storage, see Putting Data into Object Storage.

OCI function

  1. In the OCI portal, navigate to Solutions and Platform -> Developer Services -> Functions.
  2. Select an existing application or click Create Application.
  3. Create a new OCI function within your application. See the Oracle Overview of Functions for more details.
  4. It is recommended to create a boilerplate Python function first and replace the auto generated files with Datadog’s source code:
    • Replace func.py with code from the Datadog OCI repo.
    • Replace func.yaml with code from the Datadog OCI repo. DATADOG_TOKEN and DATADOG_HOST must be replaced with your Datadog API key and region logs intake link.
    • Replace requirements.txt with code from the Datadog OCI repo.

OCI event

  1. In the OCI portal, navigate to Solutions and Platform -> Application Integration -> Event Service.
  2. Click on Create Rule to be directed to the Create Rule page.
  3. Give your event rule a name and description.
  4. Set your condition as Event Type, service name as Object Storage, and event type as Object - Create.
  5. Set your action type as Functions.
  6. Ensure that your function compartment is the same selection you made for OCI Log, OCI Bucket, and OCI Function.
  7. Select your function application and function (according to the previous installation step.)
  8. Click on Create Rule, then your rule is created and available in the rules list.

For more information on OCI Object Storage, see Getting Started with Events.