Ticket: P1.5-S6-02
Type: Feature | Est: 1.5d
Goal: GCPLogConnector accepts a config dict of resource type → filter template list so new GCP service types can be added via conf.yaml without any Python code changes.
Scope:
implementations/clusters/cloud/gcp/log_connector.py:
- Add
resource_type_templates: dict[str, list[str]] | None = None to constructor
- Refactor
_build_filter(): when resource_type_templates is set and the target resource type is found, use the template's filter clauses; otherwise fall back to the existing generic filter (backward compatible)
- Template format:
{
"cloud_dataproc_cluster": ['resource.type="cloud_dataproc_cluster"'],
"bigquery_dataset": ['resource.type="bigquery_dataset"', 'protoPayload.serviceName="bigquery.googleapis.com"'],
"cloud_function": ['resource.type="cloud_function"'],
"pubsub_subscription": ['resource.type="pubsub_subscription"'],
"gcs_bucket": ['resource.type="gcs_bucket"'],
}
api/dependencies.py — get_agent2(): load resource_type_templates from gcp_resource_type_templates() config helper when constructing GCPLogConnector
Acceptance criteria:
Ticket:
P1.5-S6-02Type: Feature | Est: 1.5d
Goal:
GCPLogConnectoraccepts a config dict of resource type → filter template list so new GCP service types can be added viaconf.yamlwithout any Python code changes.Scope:
implementations/clusters/cloud/gcp/log_connector.py:resource_type_templates: dict[str, list[str]] | None = Noneto constructor_build_filter(): whenresource_type_templatesis set and the target resource type is found, use the template's filter clauses; otherwise fall back to the existing generic filter (backward compatible){ "cloud_dataproc_cluster": ['resource.type="cloud_dataproc_cluster"'], "bigquery_dataset": ['resource.type="bigquery_dataset"', 'protoPayload.serviceName="bigquery.googleapis.com"'], "cloud_function": ['resource.type="cloud_function"'], "pubsub_subscription": ['resource.type="pubsub_subscription"'], "gcs_bucket": ['resource.type="gcs_bucket"'], }api/dependencies.py—get_agent2(): loadresource_type_templatesfromgcp_resource_type_templates()config helper when constructingGCPLogConnectorAcceptance criteria:
resource_type_templatesset (backward compatible)resource_type_templates={"bigquery_dataset": [...]}returns BigQuery logs from Cloud Logging_build_filter()output contains correctresource.typeclause for a configured type