See https://www.dynatrace.com/hub/detail/oracle-connector-hub-signals-ingest/
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 navigate to Applications and click on 'Create Application'.
- Enter a name for the application and select a subnet for this application. Change the Shape to GENERIC_ARM then click on 'Create'

- Once the application is created you will be rediected to the Getting started page. Launch the cloud shell and follow the instructions under Setup fn CLI on Cloud Shell.

- In the cloud shell clone the OCI Function from this github repository and enter the directory.

- Edit the
func.yamlfile using your preferred text editor (vimornano) and set the value ofDYNATRACE_TENANTto your Dynatrace tenant 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 themetrics.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.
- Set the configuration option
IMPORT_ALL_METRICSif you want to import metrics from a namespace that is not supported by the OCI extension. These metrics will not have metadata associated with them.
- If you're using token based authentication, set the value of
- Save and exit the text editor. Now deploy the function using the command
fn -v deploy --app <application name>
If the deployment succeeded then you should see the image in your OCI container registry.

- Navigate to the Connector Hub and click on 'Create connector'.

- Enter a name for the connector and select 'Monitoring' as the Source and 'Functions' as the Target

- Select the compartments and namespaces you want to pull metrics from.

- Scroll past Configure task and choose the compartment, application and function that you just created in the previous setps.

- If you see a warning asking if you want to create a policy in a given compartment, you must click Create

- Finally click 'Create'

- Verify the metrics are getting ingested 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.
