|
1 | 1 | --- |
2 | 2 | title: "Prometheus" |
3 | | -weight: 5 |
| 3 | +slug: prometheus |
| 4 | +weight: 10 |
| 5 | +tags: [ "monitoring" ] |
4 | 6 | --- |
5 | 7 |
|
6 | | - |
7 | | - |
8 | | -resticprofile can generate a prometheus file, or send the report to a push gateway. For now, only a `backup` command will generate a report. |
9 | | -Here's a configuration example with both options to generate a file and send to a push gateway: |
| 8 | +Resticprofile can generate a Prometheus file or send the report to a Pushgateway. Currently, only the `backup` command generates a report. Below is a configuration example for generating a file and sending it to a Pushgateway: |
10 | 9 |
|
11 | 10 | {{< tabs groupid="config-with-json" >}} |
12 | 11 | {{% tab title="toml" %}} |
@@ -80,66 +79,69 @@ root: |
80 | 79 | {{< /tabs >}} |
81 | 80 |
|
82 | 81 | {{% notice style="note" %}} |
83 | | -Please note you need to set `extended-status` to `true` if you want all the available metrics. See [Extended status]({{% relref "/status/index.html#-extended-status" %}}) for more information. |
| 82 | +Set `extended-status` to `true` to access all available metrics. For details, see [Extended status]({{% relref "/monitoring/status/index.html#-extended-status" %}}). |
84 | 83 | {{% /notice %}} |
85 | 84 |
|
86 | | -Here's an example of the generated prometheus file: |
| 85 | +Here's an example of a generated prometheus file: |
87 | 86 |
|
88 | 87 | ``` |
| 88 | +# HELP restic_build_info restic build information. |
| 89 | +# TYPE restic_build_info gauge |
| 90 | +restic_build_info{profile="prom",version="0.18.0"} 1 |
89 | 91 | # HELP resticprofile_backup_added_bytes Total number of bytes added to the repository. |
90 | 92 | # TYPE resticprofile_backup_added_bytes gauge |
91 | | -resticprofile_backup_added_bytes{profile="prom"} 9.83610983e+08 |
| 93 | +resticprofile_backup_added_bytes{profile="prom"} 96167 |
92 | 94 | # HELP resticprofile_backup_dir_changed Number of directories with changes. |
93 | 95 | # TYPE resticprofile_backup_dir_changed gauge |
94 | | -resticprofile_backup_dir_changed{profile="prom"} 0 |
| 96 | +resticprofile_backup_dir_changed{profile="prom"} 8 |
95 | 97 | # HELP resticprofile_backup_dir_new Number of new directories added to the backup. |
96 | 98 | # TYPE resticprofile_backup_dir_new gauge |
97 | | -resticprofile_backup_dir_new{profile="prom"} 847 |
| 99 | +resticprofile_backup_dir_new{profile="prom"} 0 |
98 | 100 | # HELP resticprofile_backup_dir_unmodified Number of directories unmodified since last backup. |
99 | 101 | # TYPE resticprofile_backup_dir_unmodified gauge |
100 | | -resticprofile_backup_dir_unmodified{profile="prom"} 0 |
| 102 | +resticprofile_backup_dir_unmodified{profile="prom"} 1060 |
101 | 103 | # HELP resticprofile_backup_duration_seconds The backup duration (in seconds). |
102 | 104 | # TYPE resticprofile_backup_duration_seconds gauge |
103 | | -resticprofile_backup_duration_seconds{profile="prom"} 4.453124672 |
| 105 | +resticprofile_backup_duration_seconds{profile="prom"} 0.986296416 |
104 | 106 | # HELP resticprofile_backup_files_changed Number of files with changes. |
105 | 107 | # TYPE resticprofile_backup_files_changed gauge |
106 | | -resticprofile_backup_files_changed{profile="prom"} 0 |
| 108 | +resticprofile_backup_files_changed{profile="prom"} 2 |
107 | 109 | # HELP resticprofile_backup_files_new Number of new files added to the backup. |
108 | 110 | # TYPE resticprofile_backup_files_new gauge |
109 | | -resticprofile_backup_files_new{profile="prom"} 6006 |
| 111 | +resticprofile_backup_files_new{profile="prom"} 0 |
110 | 112 | # HELP resticprofile_backup_files_processed Total number of files scanned by the backup for changes. |
111 | 113 | # TYPE resticprofile_backup_files_processed gauge |
112 | | -resticprofile_backup_files_processed{profile="prom"} 6006 |
| 114 | +resticprofile_backup_files_processed{profile="prom"} 7723 |
113 | 115 | # HELP resticprofile_backup_files_unmodified Number of files unmodified since last backup. |
114 | 116 | # TYPE resticprofile_backup_files_unmodified gauge |
115 | | -resticprofile_backup_files_unmodified{profile="prom"} 0 |
| 117 | +resticprofile_backup_files_unmodified{profile="prom"} 7721 |
116 | 118 | # HELP resticprofile_backup_processed_bytes Total number of bytes scanned for changes. |
117 | 119 | # TYPE resticprofile_backup_processed_bytes gauge |
118 | | -resticprofile_backup_processed_bytes{profile="prom"} 1.016520315e+09 |
| 120 | +resticprofile_backup_processed_bytes{profile="prom"} 2.935621558e+09 |
119 | 121 | # HELP resticprofile_backup_status Backup status: 0=fail, 1=warning, 2=success. |
120 | 122 | # TYPE resticprofile_backup_status gauge |
121 | 123 | resticprofile_backup_status{profile="prom"} 2 |
122 | 124 | # HELP resticprofile_backup_time_seconds Last backup run (unixtime). |
123 | 125 | # TYPE resticprofile_backup_time_seconds gauge |
124 | | -resticprofile_backup_time_seconds{profile="prom"} 1.707863748e+09 |
| 126 | +resticprofile_backup_time_seconds{profile="prom"} 1.747673785e+09 |
125 | 127 | # HELP resticprofile_build_info resticprofile build information. |
126 | 128 | # TYPE resticprofile_build_info gauge |
127 | | -resticprofile_build_info{goversion="go1.22.0",profile="prom",version="0.26.0"} 1 |
| 129 | +resticprofile_build_info{goversion="go1.24.3",profile="prom",version="0.31.0"} 1 |
| 130 | +
|
128 | 131 |
|
129 | 132 | ``` |
130 | 133 |
|
131 | 134 | ## Prometheus Pushgateway |
132 | 135 |
|
133 | | -Prometheus Pushgateway uses the job label as a grouping key. All metrics with the same grouping key get replaced when pushed. To prevent metrics from multiple profiles getting overwritten by each other, the default job label is set to `<profile_name>.<command>` (e.g. `root.backup`). |
| 136 | +Prometheus Pushgateway uses the job label as a grouping key. Metrics with the same grouping key are replaced when pushed. To prevent overwriting metrics from different profiles, the default job label is set to `<profile_name>.<command>` (e.g., `root.backup`). |
134 | 137 |
|
135 | | -If you need more control over the job label, you can use the `prometheus-push-job` property. This property can contain the `$command` placeholder, which is replaced with the name of the executed command. |
| 138 | +For more control over the job label, use the `prometheus-push-job` property. This property supports the `$command` placeholder, which is replaced with the executed command's name. |
136 | 139 |
|
137 | | -Additionally, the request format can be specified with `prometheus-push-format`. The default is `text`, but it can also be set to `protobuf` (see [compatibility with Prometheus](https://prometheus.io/docs/instrumenting/exposition_formats/#exposition-formats)). |
| 140 | +You can specify the request format using `prometheus-push-format`. The default is `text`, but it can also be set to `protobuf` (see [compatibility with Prometheus](https://prometheus.io/docs/instrumenting/exposition_formats/#exposition-formats)). |
138 | 141 |
|
139 | | -## User defined labels |
| 142 | +## User-Defined Labels |
140 | 143 |
|
141 | | -You can add your own prometheus labels. Please note they will be applied to **all** the metrics. |
142 | | -Here's an example: |
| 144 | +You can add custom Prometheus labels, which will apply to **all** metrics. Example: |
143 | 145 |
|
144 | 146 | {{< tabs groupid="config-with-json" >}} |
145 | 147 | {{% tab title="toml" %}} |
@@ -227,4 +229,4 @@ root: |
227 | 229 | {{< /tabs >}} |
228 | 230 |
|
229 | 231 |
|
230 | | -which will add the `host` label to all your metrics. |
| 232 | +This adds the `host` label to all your metrics. |
0 commit comments