Include repo name with borgmatic info --json output #800

Closed
opened 2023-12-19 11:05:52 +00:00 by ginkel · 3 comments

What I'd like to do and why

Hi there,

now that repositories (can) have names in borgmatic's configuration, it would be nice if the json output from borgmatic info --json included the repository name next to its id:

[
  {
    "archives": [...],
    "cache": {...},
    "encryption": {
      "mode": "repokey"
    },
    "repository": {
      "id": "<id>",
      "name": "myrepository",
      "last_modified": "2023-12-19T11:24:00.000000",
      "location": "ssh://<user>@<user>.your-storagebox.de:23/./borg/<host>"
    }
  },
  [...]
]

This would make creating (Prometheus) metrics for backup runs targeting multiple repositories much easier by being able to use a descriptive name to distinguish repos.

Thanks!

Other notes / implementation ideas

No response

### What I'd like to do and why Hi there, now that repositories (can) have names in borgmatic's configuration, it would be nice if the json output from `borgmatic info --json` included the repository name next to its id: ``` [ { "archives": [...], "cache": {...}, "encryption": { "mode": "repokey" }, "repository": { "id": "<id>", "name": "myrepository", "last_modified": "2023-12-19T11:24:00.000000", "location": "ssh://<user>@<user>.your-storagebox.de:23/./borg/<host>" } }, [...] ] ``` This would make creating (Prometheus) metrics for backup runs targeting multiple repositories much easier by being able to use a descriptive name to distinguish repos. Thanks! ### Other notes / implementation ideas _No response_
Owner

Great idea! I have an implementation of this for all borgmatic actions that produce JSON output, but I need to write a few more tests. The new JSON field will be called label, as that's what it's called in configuration.

Great idea! I have an implementation of this for all borgmatic actions that produce JSON output, but I need to write a few more tests. The new JSON field will be called `label`, as that's what it's called in configuration.
Owner

Okay, this is implemented in main and will be part of the next release. Thanks again for the suggestion!

Okay, this is implemented in main and will be part of the next release. Thanks again for the suggestion!
Owner

Released in borgmatic 1.8.6!

Released in borgmatic 1.8.6!
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: borgmatic-collective/borgmatic#800
No description provided.