Documentation
¶
Overview ¶
Package metrics emits gitdr's run metrics in Prometheus text-exposition format to a file that node_exporter's textfile collector scrapes. The metric DR alerting cares about is gitdr_last_successful_run (unix seconds of the last successful backup). An empty path is a no-op, so the tool runs anywhere. OTel users can still consume these via the Collector's Prometheus receiver.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
Writer writes the metrics file. Construct with New; an empty path disables output.
func (*Writer) WriteSuccess ¶
WriteSuccess records the last-successful-run timestamp and protected-repo count, writing the file atomically (temp + rename) so the collector never reads a partial file. Call only after a fully successful run, so a failure leaves the value stale and DR alerting fires.