Move logs from Oracle Cloud Infrastructure Logging service to Datadog for the following processes: Running analytics on service, audit, and custom logs in Datadog; Consolidating logs from multicloud and hybrid environments;
More
As you make your way through this tutorial, look out for this icon . Whenever you see it, it's time for you to perform an action.
Before you deploy this sample function, make sure you have run steps A, B and C of the Oracle Functions Quick Start Guide for Cloud Shell
- A - Set up your tenancy
- B - Create application
- C - Set up your Cloud Shell dev environment
Assuming you have successfully completed the prerequisites, you should see your application in the list of applications.
fn ls apps
Review the following files in the current folder:
- the code of the function, func.py
- its dependencies, requirements.txt
- the function metadata, func.yaml
- In your Datadog account, select Integrations, and under the APIs, click create API key. This will generate your API key.
- Replace the value of the DATADOG_TOKEN in the func.yaml
In Cloud Shell, run the fn deploy
command to build this function and its dependencies as a Docker image,
push the image to the specified Docker registry, and deploy this function to Oracle Functions
in the application created earlier:
fn -v deploy --app <app-name>
e.g.,
fn -v deploy --app myapp
In Cloud Shell, run the following fn invoke
command to unit test this function:
fn invoke <app-name> <function-name> < test.json
e.g.,
fn invoke myapp oci-logs-to-datadog-python < test.json
You should see the logs appear in Datadog.
-
From the OCI Console navigation menu, select Logging, and then select Log Groups.
-
Click Create Log Group, select your compartment, add a Name and Description
-
Select Logs in the left menu, click Enable Service Log, select your compartment, select Log Category on Service and fill the rest of the fields appropriately.
-
From the navigation menu, select Logging, and then select Service Connectors.
-
Click Create Connector, add a Name, Description, select the compartment, select the Source as Logging and Target as Functions.
-
On Configure Source connection, select the compartment, select the Log Group created earlier.
-
On Configure Target connection, select the compartment and select the Function. If prompted to create a policy for writing to functions, click Create.
Make sure you configure basic observability for your function and connector using metrics, alarms and email alerts: