OCI Resources

  • Last Updated 7/18/2023, 1:15:18 PM UTC
  • About 3 min read

Plugin info

name: oci-resources

Monitors and reports changes on OCI resources in a tenancy. All reported metrics and events have their source dimension set to the tenancy name as configured in the source property (see Configuration ).

# Prerequisites

OCI API key with access to required OCI logs.

OCI client configuration is expected in file $HOME/.oci/config

# Events

Event Description
oci/resources/type_counts_changed emitted when changes were detected in the OCI resource type counts. The value is set to 1

# Metrics

# Resource Summary Information by Resource Type

All metrics are identified by the type dimension which reflects an OCI resource type such as LoadBalancer, Instance, Vcn, etc.

Metric Description
oci/resources/summary/count Total number of resources by type in any lifecycle state
oci/resources/summary/count_delta Difference in total number of resources by type from previous total number reported by this plugin. This will report positive number for additions and negative numbers for deletions

# Configuration

This section describes the configuration settings for this plugin

IMPORTANT

Sensitive data should be stored inside the agent secrets store and referenced in this file using ${secret key} notation.

Name Type Required Default Description
proxy string No optional http proxy url to use for the OCI endpoint requests
api_key_passphrase string Yes the API key passphrase (supports secrets)
oci_config_profile string No DEFAULT the OCI client configuration profile to use
timeout duration No 60s how long to wait for each search results page
source string Yes the source value to use for the generated metrics and events, should reflect the OCI tenancy name

# Examples

api_key_passphrase: ${oci.api_key_passphrase} # your API key passphrase (secret managed by polaris)
oci_config_profile: DEFAULT
source: arisant1

This might give you the following metrics:

oci/resources/summary/count{source="arisant1", type="OsmsManagedInstanceGroup"}: 3
oci/resources/summary/count_delta{source="arisant1", type="OsmsManagedInstanceGroup"}: 0
oci/resources/summary/count{source="arisant1", type="Policy"}: 25
oci/resources/summary/count_delta{source="arisant1", type="Policy"}: 1
oci/resources/summary/count{source="arisant1", type="Group"}: 12
oci/resources/summary/count_delta{source="arisant1", type="Group"}: 2
oci/resources/summary/count{source="arisant1", type="User"}: 22
oci/resources/summary/count_delta{source="arisant1", type="User"}: 0
oci/resources/summary/count{source="arisant1", type="Instance"}: 18
oci/resources/summary/count_delta{source="arisant1", type="Instance"}: -1
oci/resources/summary/count{source="arisant1", type="Bucket"}: 13
oci/resources/summary/count_delta{source="arisant1", type="Bucket"}: 0
oci/resources/summary/count{source="arisant1", type="Subnet"}: 20
oci/resources/summary/count_delta{source="arisant1", type="Subnet"}: 2

oci/resources/type_counts_changed{source="arisant1"}: 1

# Validate Configuration

oci-resources --run-conf /path/to/config/file.yaml --validate

# Testing

Run the plugin from the command line and get any emitted metrics on stdout. Use the --standalone-state-path flag to provide a directory where the plugin will store the current resources state.

oci-resources --run-conf /path/to/config/file.yaml --standalone-state-path /tmp/oci-resources

# List the metrics and event emitted by a plugin configuration

oci-resources --metrics 
oci-resources --events
Last Updated: 7/18/2023, 1:15:18 PM