Giter Club home page Giter Club logo

walg-exporter's Introduction

infra-data-walg-exporter

A straightforward Go exporter designed to verify WAL files backed up using WAL-G and expose the results to Prometheus.

How to build the exporter

go-task build

How to build the container image

The container image for this exporter is built and pushed the registry using Github Actions. Alternatively, you can build it locally by executing the command below:

go-task container

How to release a new version

The version information is stored in the VERSION file. To release a new version, follow these steps:

echo "1.0.1" > VERSION
go-task release

This process will generate a new tag v1.0.1 and push it to the Git repository, which in turn triggers a new GitHub Action to compile and deploy the container image.

How to run the exporter

his exporter is engineered to operate within a Kubernetes cluster, utilizing the sidecar Vault Injector for assistance. The essential secrets required for the exporter's operation are securely stored in Vault and are dynamically injected into the exporter's environment.

Configuration

The exporter is configured using environment variables:

  • WALG_EXPORTER_PORT: The port where the exporter will listen for requests.
  • WALG_EXPORTER_TIMER: The time between each verification. (default: 30m)
  • ENV: The environment where the exporter is running. (default: dev)
  • PGCLUSTERS: A comma-separated list of Postgres clusters to verify.

Take the .env file as an example

How to add more clusters in the scrapping list

Add the new cluster to the comma-separeted list PGCLUSTERS and restart the deployment, that will make Vault Injector to inject the new secret into the exporter.

Exported metrics

The exporter exposes the following metrics:

  • wal_g_verify_integrity_status: wal-g wal-verify integrity status - 0: OK, 1: Error, 2: Unknown
  • wal_g_show_status: wal-g wal-show status - 0: OK, 1: Error, 2: Unknown
  • wal_g_backup_count: number of base backups found
  • wal_g_last_upload_file_s3_timestamp: last upload file timestamp UNIX epoch

Limitations

  • The exporter only supports S3 backups with the directory with the following structure: s3://bucket-name/postgres/walg/cluster-name-env/

walg-exporter's People

Contributors

aryklein avatar

Watchers

 avatar

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.