GithubHelp home page GithubHelp logo

5l1v3r1 / version_exporter Goto Github PK

View Code? Open in Web Editor NEW

This project forked from caarlos0/version_exporter

0.0 1.0 0.0 270 KB

Monitor the versions of the things you run and care about

License: MIT License

Makefile 4.01% Go 95.28% Dockerfile 0.71%

version_exporter's Introduction

version_exporter

Exports versions of Github projects as prometheus metrics, with contraint version, from a config file, and latest version, fetched from Github, as labels.

Running

version_exporter --bind ":9333"

Or with docker:

docker run -p 127.0.0.1:9333:9333 -v $PWD/config.yaml:/config.yaml caarlos0/version_exporter

Or with docker-compose:

version: '3'
services:
  releases:
    image: caarlos0/gversion_exporter:v1
    restart: always
    volumes:
    - /path/to/config.yml:/etc/config.yml
    command:
    - '--config.file=/etc/config.yml'
    ports:
    - 127.0.0.1:9333:9333
    env_file:
    - .env

You can personalize the config.yaml file like following:

repositories:
  # repository: semver constraint (check https://github.com/masterminds/semver#working-with-pre-release-versions)
  prometheus/alertmanager: ~v0.14.0
  prometheus/prometheus: ^2.1.0
  caarlos0/version_exporter: 0.0.5

You can reload the config file by sending a SIGHUP to version_exporter process.

On the prometheus settings, add the version_exporter job:

scrape_configs:
  - job_name: version
    static_configs:
      - targets: [ 'version_exporter:9333' ]

Alerting rules example:

groups:
- name: versions
  rules:
  - alert: SoftwareOutOfDate
    expr: version_up_to_date == 0
    for: 1s
    labels:
      severity: warning
    annotations:
      summary: "{{$labels.repository}}: out of date"
      description: "latest version {{ $labels.latest }} is not within constraint {{ $labels.constraint }}"

Building locally

Install the needed tooling and libs:

make setup

Run with:

go run main.go

Run tests with:

make test

version_exporter's People

Contributors

caarlos0 avatar dependabot-preview[bot] avatar renovate[bot] avatar tmatias 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.