Metadata-Version: 2.1
Name: alert-exporter
Version: 0.2.0
Summary: Extract alerts configured in different sources (eg: Prometheus Rules, CloudWatch Alarms, etc.)
Author-email: Baptiste ROUX <rouxbaptiste@outlook.com>
License: GNU GENERAL PUBLIC LICENSE
                              Version 3, 29 June 2007        
            Extract a list of alerts configured in different sources (eg: Prometheus Rules, CloudWatch Alarms, etc.)
            Copyright (C) 2022  Baptiste ROUX        
            This program is free software: you can redistribute it and/or modify
            it under the terms of the GNU General Public License as published by
            the Free Software Foundation, either version 3 of the License, or
            (at your option) any later version.        
            This program is distributed in the hope that it will be useful,
            but WITHOUT ANY WARRANTY; without even the implied warranty of
            MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
            GNU General Public License for more details.        
            You should have received a copy of the GNU General Public License
            along with this program.  If not, see <http://www.gnu.org/licenses/>.        
        Also add information on how to contact you by electronic and paper mail.        
          You should also get your employer (if you work as a programmer) or school,
        if any, to sign a "copyright disclaimer" for the program, if necessary.
        For more information on this, and how to apply and follow the GNU GPL, see
        <http://www.gnu.org/licenses/>.        
          The GNU General Public License does not permit incorporating your program
        into proprietary programs.  If your program is a subroutine library, you
        may consider it more useful to permit linking proprietary applications with
        the library.  If this is what you want to do, use the GNU Lesser General
        Public License instead of this License.  But first, please read
        <http://www.gnu.org/philosophy/why-not-lgpl.html>.                
Project-URL: Homepage, https://github.com/BapRx/alert-exporter
Project-URL: Bug Tracker, https://github.com/BapRx/alert-exporter/issues
Project-URL: changelog, https://github.com/BapRx/alert-exporter/blob/master/CHANGELOG.md
Keywords: alert_exporter,alert,monitoring,prometheus,cloudwatch
Classifier: Development Status :: 4 - Beta
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: kubernetes
Requires-Dist: boto3
Requires-Dist: humanize

# Alert Exporter

<p>
<a href="https://pypi.org/project/alert-exporter/"><img alt="PyPI" src="https://img.shields.io/pypi/v/alert-exporter"></a>
<a href="https://pypi.org/project/alert-exporter/"><img alt="PyPI - Python Version" src="https://img.shields.io/pypi/pyversions/alert-exporter"></a>
<a href="https://github.com/BapRx/alert-exporter/"><img alt="GitHub repo size" src="https://img.shields.io/github/repo-size/BapRx/alert-exporter"></a>
<a href="https://pypi.org/project/alert-exporter/"><img alt="PyPI - Status" src="https://img.shields.io/pypi/status/alert-exporter"></a>
</p>

## Installation

Use the package manager [pip](https://pip.pypa.io/en/stable/) to install alert-exporter.

```bash
pip install alert-exporter
```

## Usage

```bash
❯ alert-exporter --help
Extract alerts configured in different sources (eg: Prometheus Rules, CloudWatch Alarms, etc.)

optional arguments:
  -h, --help            show this help message and exit
  --log-level {DEBUG,INFO,WARNING,ERROR}
  -o OUTPUT_FILE, --output-file OUTPUT_FILE
  --jinja-template [JINJA_TEMPLATE]
  -f {markdown,csv,html,yaml}, --format {markdown,csv,html,yaml}
  --prometheus
  --context [CONTEXT]
  --cloudwatch
  --aws-profile AWS_PROFILE
  --aws-region AWS_REGION
                        Specific region to target. Default: Iterate over all regions available.
```

### Multiple sources are available, one or many can be selected

#### Kubernetes / Prometheus

The current context is used unless you provide the `--context` flag.

```bash
alert-exporter -o minikube.html --prometheus --context minikube
```

#### AWS Cloudwatch

All available regions are parsed unless you provide the `--aws-region` flag.

You need to be authenticated before using this tool.

```bash
alert-exporter -o aws.html --cloudwatch --aws-region eu-west-1 --aws-profile profile
```

#### Multiple sources at once

```bash
alert-exporter -o combined.html --prometheus --cloudwatch --aws-region eu-west-1
```

### Formats

Predefined formats are provided with this tool:

- HTML
- Markdown
- CSV
- YAML

You can use a custom format by providing a Jinja2 file with the `--jinja-template` flag.

## HTML output example

<a href="https://raw.githubusercontent.com/BapRx/alert-exporter/master/docs/alerts-html.png"><img alt="HTML output" src="https://raw.githubusercontent.com/BapRx/alert-exporter/master/docs/alerts-html.png"></a>

## Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
