GithubHelp home page GithubHelp logo

nikit0zzz / promtool-github-actions Goto Github PK

View Code? Open in Web Editor NEW

This project forked from peimanja/promtool-github-actions

0.0 1.0 0.0 6 KB

GitHub Action for checking Prometheus Configs and Alert rules

Dockerfile 3.36% Shell 96.64%

promtool-github-actions's Introduction

Promtool GitHub Actions

Promtool GitHub Actions allow you to check Prometheus configs and Alert rules within GitHub Actions.

The output of the actions can be viewed from the Actions tab in the main repository view. If the actions are executed on a pull request event, a comment may be posted on the pull request.

Success Criteria

An exit code of 0 is considered a successful execution.

Usage

Promtool GitHub Actions are a single GitHub Action that executes different promtool subcommands depending on the content of the GitHub Actions YAML file. Right now only rules and config is supported which runs promtool check rules and promtool check config for the given files.

name: Check Prometheus Alert rules

on:
  pull_request:
    paths:
    - 'prometheus/config/*.yml'
    - 'prometheus/alert_rules/*.yml'

jobs:
  on-pull-request:
    name: On Pull Request
    runs-on: ubuntu-latest
    steps:
    - name: Checkout Repo
      uses: actions/checkout@master

    - name: Check Prometheus alert rules
      uses: peimanja/promtool-github-actions@master
      with:
        promtool_actions_subcommand: 'rules'
        promtool_actions_files: 'prometheus/alert_rules/*.yml'
        promtool_actions_version: '2.14.0'
        promtool_actions_comment: true
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

    - name: Check Prometheus configs
      uses: peimanja/promtool-github-actions@master
      with:
        promtool_actions_subcommand: 'config'
        promtool_actions_files: 'prometheus/config/*.yml'
        promtool_actions_version: '2.14.0'
        promtool_actions_comment: true
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Inputs

Inputs configure Terraform GitHub Actions to perform different actions.

  • promtool_actions_subcommand - (Required) The Promtool subcommand to execute. Valid values are rules and config.
  • promtool_actions_files - (Required) Path to files. Can be something like configs/*.yml or alert_rules/*.yml.
  • promtool_actions_version - (Optional) The Promtool version to install and execute (Prometheus bundle version). The default is set to latest and the latest stable version will be pulled down automatically.
  • promtool_actions_comment - (Optional) Whether or not to comment on GitHub pull requests. Defaults to true.

Secrets

Secrets are similar to inputs except that they are encrypted and only used by GitHub Actions. It's a convenient way to keep sensitive data out of the GitHub Actions workflow YAML file.

  • GITHUB_TOKEN - (Optional) The GitHub API token used to post comments to pull requests. Not required if the promtool_actions_comment input is set to false.

promtool-github-actions's People

Contributors

marcusteixeira avatar peimanja 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.