To publish metrics and logs in OCI, you need to create and manage certain policies that define the necessary permissions. These policies specify which groups or users have access to perform certain actions on resources within specific compartments.
To create a policy, perform the following steps:
Enter the policy rules based on the data that needs to be published:
To publish metrics you need to grant permission to the following policies in OCI:
Allow group <group_name> to read metrics in compartment <compartment_name>
This policy allows the specified group to read metrics within the specified compartment.
Allow group <group_name> to manage alarms in compartment <compartment_name>
This policy grants the specified group permission to manage alarms within the specified compartment.
Allow group <group_name> to manage ons-topics in compartment <compartment_name>
This policy provides the specified group with permissions to manage Oracle Notification Service (ONS) topics within the specified compartment.
Allow group <group_name> to use streams in compartment <compartment_name>
This policy enables the specified group to use streams within the specified compartment. Streams are used for real-time data ingestion, processing, and analysis.
To publish logs you need to grant permission to the following policies in OCI:
Allow group <group_name> to use log-groups in compartment <compartment_name>
This policy allows the specified group to access and view log-groups within the specified compartment.
Allow group <group_name> to manage log-groups in compartment <compartment_name>
This policy allows the specified group to create, update, and delete log groups within the specified compartment.
Allow group <group_name> to write logs in compartment <compartment_name>
This policy permits the specified group to write logs to log groups within the specified compartment.
For more information on policies, see Managing Policies.