See https://www.dynatrace.com/hub/detail/oracle-connector-hub-signals-ingest/
With the OCI Log ingest function, OCI users can stream their logs directly into Dynatrace for troubleshooting and root cause analysis using Davis® AI.
This OCI function was created to work alongside the Oracle Cloud Infrastructure extension found on the Dynatrace Hub.
See CHANGELOG. Subscribe to watch CHANGELOG to get notified about new releases, fiex and patches to this project.
Note: These actions must be done by a OCI tenancy administrator using the Oracle Cloud Shell or Oracle Code Editor.
Policies must also be configured in the OCI tenant to allow the Service Connector read metrics from the tenant. Users should do this using a group where the resource type is serviceconnectors before assigning the following policy:
Allow group <GROUP_NAME> to read metrics in tenancy
- Login to the OCI portal and search for Log Groups

- Select your compartment on the left side and click Create Log Group - A side panel will open.

- Enter your desired name, description and any tags.
- Click Create to create your new Log Group.
- In the search bar, search for and select Logs.
- Select either Create custom log or Enable service log. Enter a name and select the log group you just created.

- Click Create custom log or Enable log to begin sending logs to your log group.
-
Select an existing application or click Create Application and give it a name, subnet and change the Shape to GENERIC_ARM then click on 'Create'

-
Create a new OCI function within your application and give it a name.
-
We recommend using the Oracle Code Editor to create your custom function.
-
Once the Code Editor is open, select Create from code repository and enter a function name and the url to the Github repository.

-
Edit the
func.yamlfile, updating theDYNATRACE_TENANTand variable with your Dynatrace tenant's URL. If you're using new Dynatrace then the you may need to replace 'apps' with 'live' in the tenant URL.
Ex:https://<tenant id>.apps.dynatrace.comshould behttps://<tenant id>.live.dyntrace.com- If you're using token based authentication, set the value of
DYNATRACE_API_KEYto an API token that has thelogs.ingestscope. - If you're using an OAuth2 Client for authentication change the
AUTH_METHODtooauthand enter your client_id, client_secret and URN. Please see the "Configuring an OAuth2 Client" section for more details on the requirements.
- If you're using token based authentication, set the value of
-
Follow the instructions on the Getting started page under your application. Use the cloned repository instead of the example function in the instructions. This can be done in the code editor's terminal instead of a separate cloud shell.

-
After completeing the commands in the Getting started tab, you should see your image under the Container registry page.

- In the OCI portal, search for Connectors
- Click Create Connector, give it a name and description.

- Select Logging as the source and Functions as the target.
- Under Configure source choose the log group and specific log that you want to stream to Dynatrace.
- Under Configure target select your application and function created in the previous steps.

- If you are prompted to create any policies, click on Create.

- Finally click Create at the bottom of the panel, now you have a connector for streaming logs into Dynatrace.

Using an OAuth2 client for the OCI functions will require you to add some additional policies to give the oauth token access to ingest metrics.
- Visit your Dynatrace tenant's Account Management portal and navigate to Identity & access management -> Policy Management. Click on the add policy button.

- Give the policy a name like Metric Ingest and paste the following policy statement into the large text box
ALLOW storage:metrics:write;and click on Save
- Now navigate to the Service Users page under Identity & access management and click on Add service user

- Give the user a name and optionally a description then click on Save

- Click on the 3 vertical dots on the right side of the page and select View Service User

- Copy the Service user email that is displayed on this page, you will need it for step 9.
- Click on the +Permission button and from the dropdown menu select the policy we created in step 2.

- Under Identity & access management navigate to OAuth clients and click on Create Client

- Paste the service user email address that you copied in setp 6 in the Subject user email text box then assign the user Write metrics (
storage:metrics:write) permission.

- Finally click on Create Client at the bottom of the page and copy the
client_id,client_secretandurnfor use with the OCI function.
If you are running into issues getting the connector to work, go to the application and enable Function Invocation Logs.
Any errors will be logged here as well as some information about when the function has been run.

In the Dynatrace menu, go to Logs and Events, to look for OCI logs by filtering by cloud.provider: oci.
