Skip to content

chore: reduce log verbosity for backup-handler#4063

Open
rocketeerbkw wants to merge 1 commit intomainfrom
backup-handler-reduce-logs
Open

chore: reduce log verbosity for backup-handler#4063
rocketeerbkw wants to merge 1 commit intomainfrom
backup-handler-reduce-logs

Conversation

@rocketeerbkw
Copy link
Copy Markdown
Member

General Checklist

  • Affected Issues have been mentioned in the Closing issues section
  • Documentation has been written/updated
  • PR title is ready for inclusion in changelog

Database Migrations

n/a

Description

k8up sends webhooks to the backup-handler for certain events, and there is a fallback that logs the webhook data if the webhook can't be handled. For every snapshot, k8up sends two webhooks: 1) a webhook with progress/metrics information about the single snapshot and 2) a webhook with a list of all snapshots.

Currently, scenario (1) results in a log being printed, and this PR adds a check to exclude it, since it is a webhook that is known to not be handled. This reduces logs by ~30%.

Example extraneous log (formatted for clarity):

unable to handle webhook, data is: {
    "name": "lagoon-demo-org-main",
    "bucket_name": "baas-lagoon-demo-org",
    "backup_metrics": {
        "backup_start_timestamp": 1,
        "backup_end_timestamp": 1773711035,
        "errors": 0,
        "new_files": 1,
        "changed_files": 0,
        "unmodified_files": 0,
        "new_dirs": 0,
        "changed_dirs": 0,
        "unmodified_dirs": 0,
        "data_transferred": 2624556,
        "mounted_PVCs": [],
        "Folder": "/lagoon-demo-org-main-mariadb-prebackuppod.mariadb.sql"
    },
    "snapshots": null,
    "restore_location": "",
    "snapshot_ID": "",
    "restored_files": null
}

Closing issues

n/a

unable to handle webhook, data is:
Copy link
Copy Markdown
Member

@shreddedbacon shreddedbacon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants