You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* generation of prometheus file from backup summary
* add labels to metrics
* prometheus groups of profiles
* allow generic status by registering an interface
* docs: add prometheus in README
* display an error instead of a panic
* add user defined prometheus labels
Copy file name to clipboardExpand all lines: README.md
+91-4Lines changed: 91 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -29,10 +29,11 @@ With resticprofile:
29
29
* You can generate cryptographically secure random keys to use as a restic key file
30
30
* You can easily schedule backups, retentions and checks (works for *systemd*, *crond*, *launchd* and *windows task scheduler*)
31
31
* You can generate a simple status file to send to some monitoring software and make sure your backups are running fine
32
-
***[new for v0.10.0]**You can use a template syntax in your configuration file
33
-
***[new for v0.11.0]**You can generate scheduled tasks using *crond*
32
+
* You can use a template syntax in your configuration file
33
+
* You can generate scheduled tasks using *crond*
34
34
***[new for v0.12.0]** Get backup statistics in your status file
35
35
***[new for v0.14.0]** Automatically clear up [stale locks](#locks)
36
+
***[new for v0.15.0]** Export a **prometheus** file after a backup, or send the report to a push gateway automatically
36
37
37
38
The configuration file accepts various formats:
38
39
*[TOML](https://github.com/toml-lang/toml) : configuration file with extension _.toml_ and _.conf_ to keep compatibility with versions before 0.6.0
@@ -101,6 +102,7 @@ For the rest of the documentation, I'll be showing examples using different form
101
102
*[Changing schedule\-permission from user to system, or system to user](#changing-schedule-permission-from-user-to-system-or-system-to-user)
102
103
*[Status file for easy monitoring](#status-file-for-easy-monitoring)
103
104
*[Extended status](#extended-status)
105
+
*[Prometheus](#prometheus)
104
106
*[Variable expansion in configuration file](#variable-expansion-in-configuration-file)
105
107
*[Pre\-defined variables](#pre-defined-variables)
106
108
*[Hand\-made variables](#hand-made-variables)
@@ -1395,6 +1397,8 @@ Here's an example of a generated file, where you can see that the last `check` f
1395
1397
}
1396
1398
```
1397
1399
1400
+
## Extended status
1401
+
1398
1402
Note: In the backup section above you can see some fields like `files_new`, `files_total`, etc. This information is only available when resticprofile's output is either *not* sent to the terminal (e.g. redirected) or when you add the flag `extended-status` to your backup configuration.
1399
1403
This is a technical limitation to ensure restic displays terminal output correctly.
1400
1404
@@ -1405,8 +1409,6 @@ This is a technical limitation to ensure restic displays terminal output correct
1405
1409
- stderr
1406
1410
- duration
1407
1411
1408
-
## Extended status
1409
-
1410
1412
`extended-status` is **not set by default because it hides any output from restic**
1411
1413
1412
1414
```yaml
@@ -1421,6 +1423,89 @@ profile:
1421
1423
1422
1424
```
1423
1425
1426
+
# Prometheus
1427
+
1428
+
resticprofile can generate a prometheus file, or send the report to a push gateway. For now, only a `backup` command will generate a report.
1429
+
Here's a configuration example with both options to generate a file and send to a push gateway:
1430
+
1431
+
```yaml
1432
+
root:
1433
+
inherit: default
1434
+
prometheus-save-to-file: "root.prom"
1435
+
prometheus-push: "http://localhost:9091/"
1436
+
backup:
1437
+
extended-status: true
1438
+
no-error-on-warning: true
1439
+
source:
1440
+
- /
1441
+
```
1442
+
1443
+
Please note you need to set `extended-status` to `true` if you want all the available metrics. See [Extended status](#extended-status) for more information.
1444
+
1445
+
Here's an example of the generated prometheus file:
1446
+
1447
+
```
1448
+
# HELP resticprofile_backup_added_bytes Total number of bytes added to the repository.
You can add your own prometheus labels. Please note they will be applied to **all** the metrics.
1490
+
Here's an example:
1491
+
1492
+
```yaml
1493
+
root:
1494
+
inherit: default
1495
+
prometheus-save-to-file: "root.prom"
1496
+
prometheus-push: "http://localhost:9091/"
1497
+
prometheus-labels:
1498
+
- host: {{ .Hostname }}
1499
+
backup:
1500
+
extended-status: true
1501
+
no-error-on-warning: true
1502
+
source:
1503
+
- /
1504
+
```
1505
+
1506
+
which will add the `host` label to all your metrics.
1507
+
1508
+
1424
1509
# Variable expansion in configuration file
1425
1510
1426
1511
You might want to reuse the same configuration (or bits of it) on different environments. One way of doing it is to create a generic configuration where specific bits will be replaced by a variable.
@@ -1914,6 +1999,8 @@ Flags used by resticprofile only
0 commit comments