Skip to content

feat(google_cloudsql_postgres): add log metrics for automated backups - #495

Merged
n0coast merged 3 commits into
mainfrom
ntade/MZCLD-4213
Sep 24, 2026
Merged

n0coast merged 3 commits into
mainfrom
ntade/MZCLD-4213

Conversation

@n0coast

@n0coast n0coast commented Sep 24, 2026

Copy link
Copy Markdown
Member

Description

Allows the optional creation of log based metrics for automated backups, there are 4 backup statuses: STATUS_SUCCEEDED, STATUS_ATTEMPT_FAILED, STATUS_FAILED, and STATUS_SKIPPED.
Log based metrics can be used for alerting in gcloud monitoring or elsewhere.

Example log:

{
  "protoPayload": {
    "@type": "type.googleapis.com/google.cloud.audit.AuditLog",
    "status": {
      "message": "OK"
    },
    "authenticationInfo": {},
    "requestMetadata": {
      "requestAttributes": {},
      "destinationAttributes": {}
    },
    "serviceName": "cloudsql.googleapis.com",
    "methodName": "cloudsql.instances.automatedBackup",
    "resourceName": "projects/<project_name>/instances/<primary_db_name>",
    "metadata": {
      "@type": "type.googleapis.com/speckle.AutomatedBackupEventLog",
      "windowStatus": "STATUS_SUCCEEDED",
      "windowStartTime": "<date>",
      "backupStartTime": "<date>",
      "backupCompletionTime": "<date>",
      "message": "",
      "windowEndTime": "<date>"
    }
  },
  "insertId": "<insertId>",
  "resource": {
    "type": "cloudsql_database",
    "labels": {
      "database_id": "<project_name>:<primary_db_name>",
      "region": "<location>",
      "project_id": "<project_name>"
    }
  },
  "timestamp": "<date>",
  "severity": "INFO",
  "logName": "projects/<project_name>/logs/cloudaudit.googleapis.com%2Fsystem_event",
  "receiveTimestamp": "<date>"
}

Related Tickets & Documents

@github-actions github-actions Bot added the minor This PR will increment a minor version label Sep 24, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Release plan

Directory Previous version New version
google_cloudsql_postgres 0.10.0 0.11.0

Comment thread google_cloudsql_postgres/outputs.tf Outdated
@n0coast
n0coast merged commit 8379926 into main Sep 24, 2026
8 checks passed
@n0coast
n0coast deleted the ntade/MZCLD-4213 branch September 24, 2026 22:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

minor This PR will increment a minor version

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants