borg icon indicating copy to clipboard operation
borg copied to clipboard

add a prometheus-text-file-exporter parameter

Open Stunkymonkey opened this issue 2 years ago • 7 comments

Have you checked borgbackup docs, FAQ, and open GitHub issues?

Yes

Is this a BUG / ISSUE report or a QUESTION?

Feature request

Describe the problem you're observing.

when running borg it is only possible to parse the output from --stats to get a more deeper look into metrics.

It would be nice to have an parameter --prometheus-exporter <file> to write all the metrics to the file. This way we do not need to run any additional command and have it persistent on the disk.

Stunkymonkey avatar Nov 05 '23 20:11 Stunkymonkey

Some commands also have json output capability, so maybe you can use that.

ThomasWaldmann avatar Nov 05 '23 21:11 ThomasWaldmann

That is a good idea. Maybe I can use the json-exporter for this. Not sure how good the metrics are, but I will have a look.

Does that mean you don't want to provide it in the first place, but would rather suggest the use of other tools?

Stunkymonkey avatar Nov 05 '23 21:11 Stunkymonkey

Yes, guess we rather provide generic exporting (like json) than supporting misc. more specialised formats (? no idea about what prometheus need) directly.

ThomasWaldmann avatar Nov 06 '23 12:11 ThomasWaldmann

I am very fine with json, but could we add an parameter like --json-export file.json so I have the normal output of the stats ind the job and my monitoring will use the json.

Stunkymonkey avatar Jan 13 '24 19:01 Stunkymonkey

IIRC, if you use --log-json, you'll get all log output as json.

Some commands have a --json (or --json-lines) option, so their (non-logging) output is made in json format.

ThomasWaldmann avatar Jan 13 '24 21:01 ThomasWaldmann

yes, but then I would have either the stats in a nice format or json, but never both.

If you do not like my suggestion, please go ahead an close it. I am ok with the current situation.

Stunkymonkey avatar Jan 14 '24 12:01 Stunkymonkey