Agent configurations are another way to publish custom metrics to Monitoring. With agent configurations, the API isn't necessarily required to publish custom metrics. You can now use agent configurations to ingest metric data into custom metrics. For example, expose metrics from a virtual machine (VM) using an HTTP endpoint in Prometheus format.
A custom metric is a metric that you design to collect and analyze data.
For example, create a productOrder metric (in a metric namespace, mymetricsnamespace) to track product orders by country and division, with additional metadata for product categories and notes.
Before You Begin
IAM policies: To publish custom metrics, you must be given the required type of access in a policy written by an administrator. This requirement applies whether you're using the REST API with an SDK, CLI, or other tool. If you get a message that you don't have permission or are unauthorized, check with the administrator. You might not have the required type of access in the current compartment .
For the metric namespace, don't use a reserved prefix (oci_ or oracle_).
Ensure that custom metrics don't exceed limits. For example, note the valid range of dimensions and maximum number of streams for custom metrics. See PostMetricData.
Define metrics with aggregation in mind. While custom metrics can be posted as frequently as every second (minimum frequency of one second), the minimum aggregation interval is one minute.
Ensure that timestamp values are near current time. For a data point to be posted, its timestamp must be near current time (less than two hours in the past and less than 10 minutes in the future). See PostMetricData.
When retrieving custom metrics, you can match to a resource group. Blank (null) for resource group returns metric data that doesn't have a resource group.