Code Monkey home page Code Monkey logo

restic-exporter's Introduction

Metrics

The following metrics are exported for given host (target)

❯ curl 'localhost:8999/probe?target=ahorn'
# HELP restic_snapshots_latest_time Time of the latest snapshot
# TYPE restic_snapshots_latest_time gauge
restic_snapshots_latest_time{hostname="ahorn"} 1.655762407e+09
# HELP restic_stats_latest_total_nfiles Number of files
# TYPE restic_stats_latest_total_nfiles gauge
restic_stats_latest_total_nfiles{hostname="ahorn"} 480
# HELP restic_stats_latest_total_size Total Size
# TYPE restic_stats_latest_total_size gauge
restic_stats_latest_total_size{hostname="ahorn"} 686011

Configuration

Configuration is done via environment variables.

# Exporter configuration
RESTIC_EXPORTER_BIN="restic"
RESTIC_EXPORTER_PORT=8999
RESTIC_EXPORTER_ADDRESS=127.0.0.1

# Restic configuration
RESTIC_REPOSITORY=s3:https://s3.myhost.com/restic
RESTIC_PASSWORD_FILE=/var/src/secrets/restic/repo-pw

# Optional: S3 credentials
AWS_ACCESS_KEY_ID=restic-ahorn
AWS_SECRET_ACCESS_KEY=aaaaaabbbbbcccccddddd

Nix flake

A nix flake is provided exposing the application as package. It also provides a nixos module.

services.restic-exporter = {
  enable = true;

  # Optional configuration
  port = "8999";
  address = "127.0.0.1";
  user = "restic-exporter";
  group = "restic-exporter";
  environmentFile = "/path/to/envfile";
};

Prometheus

- job_name: restic
  metrics_path: /probe
  relabel_configs:
    - source_labels:
        - "__address__"
      target_label: "__param_target"
    - source_labels:
        - "__param_target"
      target_label: target
    - replacement: "127.0.0.1:8999"
      target_label: "__address__"
  scrape_interval: "10m"
  scrape_timeout: "9m"
  static_configs:
    - targets:
        - host1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.