Official Oracle Cloud Infrastructure (OCI) Monitoring client for Node.js, part of the OCI TypeScript SDK (v2.132.0). Allows managing monitoring metrics, alarms, and retrieval of metric data. Requires OCI account, user with policy grants, and API signing key. Updates follow OCI SDK release cadence. Distinguishes from generic cloud monitoring SDKs by its tight integration with OCI IAM, compartment-based access control, and native support for OCI Monitoring APIs (listMetrics, postMetricData, etc.).
npm install oci-monitoringNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Lists metrics for a given compartment using OCI Monitoring SDK. Sets up auth from config, creates client, and calls listMetrics.
Pass an AuthenticationDetailsProvider instance, e.g., from ConfigFileAuthenticationDetailsProvider.
Use typed dimension arrays instead of plain objects for dimensions in MetricDataDetails.
Always include compartmentId in listMetrics, postMetricData, etc.
Check error.statusCode for OCI-specific status codes (e.g., 404).
Switch to ConfigFileAuthenticationDetailsProvider or ResourcePrincipalAuthenticationDetailsProvider.
Use import syntax or dynamic import(). For CommonJS: const { MonitoringClient } = await import('oci-monitoring').Ensure authenticationDetailsProvider is properly created, e.g., new ConfigFileAuthenticationDetailsProvider().
Add compartmentId to the request object, e.g., { compartmentId: 'ocid1.compartment.oc1..example' }.Verify the fingerprint in your config file (~/.oci/config) matches the one of the uploaded public key.