Let me provide a complete solution for restoring your metric visibility:
Root Cause:
The issue isn’t that custom namespaces interfere with standard metrics - they coexist independently. What happened is your dashboard widgets were reconfigured (manually or automatically) to filter by the custom namespace, hiding the default OCI service metrics. This is a common mistake when first implementing custom metrics.
Solution Steps:
1. Understanding Custom Metric Namespace Setup
Custom namespaces are isolated from OCI service namespaces:
- Custom namespace: Your application metrics (e.g.,
custom_app_metrics)
- OCI service namespace: Standard database metrics (e.g.,
oci_autonomous_database, oci_database)
- These don’t conflict - they’re queried separately
2. OCI Monitoring Configuration - Dashboard Restructure
Navigate to Observability & Management → Monitoring → Dashboards → Your Dashboard
Create Widget for Standard Database Metrics:
Widget Type: Line Chart
Query:
Namespace: oci_autonomous_database (or oci_database)
Metric: CpuUtilization
Interval: 1 minute
Statistic: Mean
Dimensions:
resourceId: <your-database-ocid>
Create Widget for Custom Application Metrics:
Widget Type: Line Chart
Query:
Namespace: custom_app_metrics (your custom namespace)
Metric: <your-custom-metric-name>
Interval: 1 minute
Statistic: Mean
Dimensions:
resourceId: <your-resource-id>
3. Comprehensive Dashboard Layout:
Organize your dashboard with clear sections:
Section 1: Standard Database Health (oci_autonomous_database namespace)
- Widget 1: CPU Utilization
- Widget 2: Storage Utilization
- Widget 3: Current Connections
- Widget 4: Failed Connections
Section 2: Custom Application Metrics (custom_app_metrics namespace)
- Widget 5: Application Query Response Time
- Widget 6: Transaction Volume
- Widget 7: Custom Business Metrics
4. IAM Policy for Metrics Verification
Verify your monitoring group has proper permissions:
# Pseudocode - IAM Policy Structure:
1. Navigate to Identity → Policies → Your Monitoring Policy
2. Verify statements include:
- Allow group MonitoringUsers to read metrics in tenancy
- Allow group MonitoringUsers to read alarms in tenancy
- Allow group MonitoringUsers to use metric-family in tenancy
3. Ensure policy is in root compartment or covers target compartments
If policies are too restrictive, add:
Allow group MonitoringUsers to read metrics in tenancy where any {
request.namespace = 'oci_autonomous_database',
request.namespace = 'oci_database',
request.namespace = 'custom_app_metrics'
}
5. Verify Metrics Collection via CLI
Test that both metric types are being collected:
Standard OCI metrics:
oci monitoring metric-data summarize-metrics-data \
--namespace oci_autonomous_database \
--query-text "CpuUtilization[1m].mean()" \
--compartment-id <compartment-ocid>
Custom metrics:
oci monitoring metric-data summarize-metrics-data \
--namespace custom_app_metrics \
--query-text "YourCustomMetric[1m].mean()" \
--compartment-id <compartment-ocid>
If either query returns no data, the issue is collection, not visualization.
6. Troubleshooting Missing Standard Metrics
If standard OCI metrics still don’t appear:
Check metric namespace:
oci monitoring metric list \
--compartment-id <compartment-ocid> \
--namespace oci_autonomous_database
This lists all available metrics in the namespace.
Verify database is emitting metrics:
- Database must be in AVAILABLE state
- Metrics have 5-minute delay (standard collection interval)
- Check database isn’t in a stopped or maintenance state
7. Dashboard Query Best Practices
Use MQL (Monitoring Query Language) for complex queries:
CpuUtilization[1m]{resourceId="<db-ocid>"}.mean()
Combine multiple metrics in one widget:
Create separate widgets - you cannot mix namespaces in a single widget, but you can create composite dashboards with multiple widgets showing related metrics from different sources.
8. Alarm Configuration for Both Metric Types
Ensure alarms work for both:
Standard metric alarm:
# Pseudocode - Alarm Definition:
1. Create Alarm → Metric namespace: oci_autonomous_database
2. Metric: CpuUtilization
3. Trigger: Mean > 80% for 5 minutes
4. Destination: Your notification topic
Custom metric alarm:
# Pseudocode - Alarm Definition:
1. Create Alarm → Metric namespace: custom_app_metrics
2. Metric: YourCustomMetric
3. Trigger: Mean > threshold for duration
4. Destination: Your notification topic
9. Long-term Dashboard Management
Create dashboard templates:
- Standard Database Health Dashboard (OCI metrics only)
- Application Performance Dashboard (custom metrics only)
- Unified Operations Dashboard (both metric types)
Use dashboard groups:
- Group related dashboards by service or application
- Share dashboards with appropriate teams
- Export dashboard JSON for version control
Verification Checklist:
- [ ] Can query standard OCI metrics via CLI
- [ ] Can query custom metrics via CLI
- [ ] Dashboard has separate widgets for each namespace
- [ ] IAM policies allow reading both namespaces
- [ ] All widgets show data (no “No data” messages)
- [ ] Alarms configured for critical metrics in both namespaces
Common Mistakes to Avoid:
- Don’t try to query multiple namespaces in one widget
- Don’t use overly restrictive IAM policies that block namespace access
- Don’t forget the 5-minute collection delay for OCI service metrics
- Don’t mix custom and service namespaces in alarm queries
This comprehensive approach addresses all three focus areas: proper custom metric namespace setup with isolated collection, correct OCI Monitoring configuration with namespace-specific widgets, and appropriate IAM policies that grant access to both custom and service metric namespaces. Your monitoring visibility should be fully restored with both standard database metrics and custom application metrics visible on properly configured dashboards.