Skip to content

Commit

Permalink
Merge pull request #17 from gonicus/develop
Browse files Browse the repository at this point in the history
Release v1.1.0
  • Loading branch information
fluxxcode authored Jan 15, 2024
2 parents adb1d1c + 5f0ff25 commit 08b1b59
Show file tree
Hide file tree
Showing 17 changed files with 271 additions and 146 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
name: flake8 Lint

on: [push, pull_request]
on: [pull_request]

jobs:
flake8-lint:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
name: Lint
steps:
- name: Check out source repository
uses: actions/checkout@v3
- name: Set up Python environment
uses: actions/setup-python@v4
with:
python-version: "3.11"
python-version: "3.12.1"
- name: flake8 Lint
uses: py-actions/flake8@v2
with:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
name: test

on: [push, pull_request]
on: [pull_request]

jobs:
unit-tests:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
name: test
steps:
- uses: actions/checkout@v4
- name: Set up Python environment
uses: actions/setup-python@v4
with:
python-version: "3.8.10"
python-version: "3.12.1"

- name: Install dependencies
run: |
Expand Down
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# asterisk-prometheus-exporter Changelog
## v1.1.0 - 2024-01-15
### Added
- Add metric `version_info` showing the version of the exporter [#12](https://github.com/gonicus/asterisk-prometheus-exporter/pull/12)
- Add the `fully_booted_validation_timeout` configuration value to specify how long to wait for the `FullyBooted` event at startup [#13](https://github.com/gonicus/asterisk-prometheus-exporter/pull/13)

### Changed
- The exporter now waits for the `FullyBooted` event sent by Asterisk. Used to prevent sending actions to early [#13](https://github.com/gonicus/asterisk-prometheus-exporter/pull/13)
- Improve logging [#14](https://github.com/gonicus/asterisk-prometheus-exporter/pull/14)
- Improve docker instructions in `README.md` [#10](https://github.com/gonicus/asterisk-prometheus-exporter/pull/10)
- Update lint and test workflows to only run on the `pull_request` trigger [#15](https://github.com/gonicus/asterisk-prometheus-exporter/pull/15)

### Fixed
- Fix scrape example in `README.md` [#11](https://github.com/gonicus/asterisk-prometheus-exporter/pull/11)

### Dependencies
Dependencies have been updated with the following pull request: [#4](https://github.com/gonicus/asterisk-prometheus-exporter/pull/4)
- Updated python to `3.12.1`
- Updated prometheus-client to `0.19.0`
- Updated asterisk-ami to `0.1.7`
- Updated jsonschema to `4.20.0`
- Updated Docker image to use `python:3.12.1-alpine`
- Updated Flake8 to run on `ubuntu-22.04`
- Updated Flake8 to use python version `3.12.1`
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.8.10-alpine
FROM python:3.12.1-alpine

ENV POETRY_VERSION=1.7.1

Expand Down
23 changes: 10 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@
Repository that provides a dynamically configurable Prometheus exporter for Asterisk. The exporter uses the Asterisk Manager Interface (AMI) to communicate with Asterisk and YAML files to configure what data is scraped from Asterisk and what metrics are generated. This allows the exporter to be used with older Asterisk versions in different environments.

## Installation
### Docker
You can use the provided Docker image from GitHub Packages. \
Run the Docker image and mount the configuration:
```
docker run -p 8080:8080 -v ./config.yml:/home/dev/asterisk-prometheus-exporter/config.yml ghcr.io/gonicus/asterisk-prometheus-exporter:latest
```
The configured metrics can be accessed at http://localhost:8080. \
Alternatively, you can also create a Docker image using the provided Dockerfile.

### Python Poetry
The exporter uses Poetry as it's dependency management. Head over to [Poetry](https://python-poetry.org/) to install the latest version for your desired platform.

Expand All @@ -20,18 +29,6 @@ By default, the exporter loads the configuration `config.yml` and uses port 8080
A different port can be specified via the first positional argument: `poetry run python src/main.py 9090`. \
A different configuration can be set using the `--config` option: `poetry run python src/main.py --config path/to/config.yml`.

### Docker
Create a Docker image using the provided Dockerfile:
```
docker build --tag asterisk-prometheus-exporter .
```

Run the Docker image and mount the configuration:
```
docker run -p 8080:8080 -v ./config.yml:/home/dev/asterisk-prometheus-exporter/config.yml asterisk-prometheus-exporter
```
The configured metrics can be accessed at http://localhost:8080.

## Configuration
This section shows the rough structure of the configuration. See `src/config_schema.yml` for a detailed description of the configuration and what is possible.

Expand Down Expand Up @@ -81,7 +78,7 @@ scrape:
labels:
- name: "queue"
value: "$Queue" # Use '$' to access attributes from the filtered event
until: "ContactStatusDetailComplete"
until: "QueueStatusComplete"
```

## Example configuration
Expand Down
2 changes: 1 addition & 1 deletion config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ ami_client:
general:
log_level: "INFO"
login_validation_timeout: 10
fully_booted_validation_timeout: 60
response_timeout: 10
ping_timeout: 20


# Default settings
default:
scrape_interval: 15
Expand Down
Loading

0 comments on commit 08b1b59

Please sign in to comment.