Ticket: P1.5-S6-04
Type: Feature | Est: 1.5d
Goal: For GCP services with sparse logs (Pub/Sub backlog depth, Cloud Function error rate, BigQuery quota), ARIA surfaces Cloud Monitoring metrics as structured signals alongside log results — preventing LOW confidence classifications when logs are absent but metrics indicate a problem.
Scope:
implementations/clusters/cloud/gcp/monitoring_connector.py (new): GCPMonitoringConnector
- Uses
google.cloud.monitoring_v3.MetricServiceClient; auth via ADC
query_metrics(project_id: str, resource_type: str, start_time: datetime, end_time: datetime) -> list[MetricSignal]
MetricSignal dataclass: { metric_type: str, resource_type: str, value: float, unit: str, timestamp: datetime, labels: dict }
- Metric targets:
- Pub/Sub:
pubsub.googleapis.com/subscription/num_undelivered_messages
- Cloud Functions:
cloudfunctions.googleapis.com/function/execution_count (filter status != OK)
- BigQuery:
bigquery.googleapis.com/storage/table_count (proxy for quota health)
requirements.txt: add google-cloud-monitoring >= 2.20.0
core/agents/log_extractor.py: when GCPMonitoringConnector is injected (optional, via DI), call query_metrics() for GCP platform incidents and append metric signals as LogLine objects (level WARNING, message = formatted metric reading) to LogQueryResult
api/dependencies.py: inject GCPMonitoringConnector into get_agent2() when ARIA_VAULT_BACKEND=gcp
Acceptance criteria:
Ticket:
P1.5-S6-04Type: Feature | Est: 1.5d
Goal: For GCP services with sparse logs (Pub/Sub backlog depth, Cloud Function error rate, BigQuery quota), ARIA surfaces Cloud Monitoring metrics as structured signals alongside log results — preventing LOW confidence classifications when logs are absent but metrics indicate a problem.
Scope:
implementations/clusters/cloud/gcp/monitoring_connector.py(new):GCPMonitoringConnectorgoogle.cloud.monitoring_v3.MetricServiceClient; auth via ADCquery_metrics(project_id: str, resource_type: str, start_time: datetime, end_time: datetime) -> list[MetricSignal]MetricSignaldataclass:{ metric_type: str, resource_type: str, value: float, unit: str, timestamp: datetime, labels: dict }pubsub.googleapis.com/subscription/num_undelivered_messagescloudfunctions.googleapis.com/function/execution_count(filterstatus != OK)bigquery.googleapis.com/storage/table_count(proxy for quota health)requirements.txt: addgoogle-cloud-monitoring >= 2.20.0core/agents/log_extractor.py: whenGCPMonitoringConnectoris injected (optional, via DI), callquery_metrics()for GCP platform incidents and append metric signals asLogLineobjects (levelWARNING, message = formatted metric reading) toLogQueryResultapi/dependencies.py: injectGCPMonitoringConnectorintoget_agent2()whenARIA_VAULT_BACKEND=gcpAcceptance criteria:
GCPMonitoringConnector.query_metrics()returns at least 1MetricSignalfor a live Pub/Sub subscription with a backloglog_result.log_linesfor GCP platform incidentsMetricServiceClient; assert correct metric path constructed and signals returned