Skip to content

Commit

Permalink
Merge branch 'develop' into feat/update_python
Browse files Browse the repository at this point in the history
  • Loading branch information
fluxxcode committed Jan 4, 2024
2 parents 0dcb06d + 23e51dc commit acf6da0
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 13 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@

name: Create and publish a Docker image to GitHub packages

on:
push:
tags:
- "v*"

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build-and-push-image:
runs-on: ubuntu-20.04

permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Log in to the container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: test

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

jobs:
unit-tests:
Expand Down
21 changes: 9 additions & 12 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

0 comments on commit acf6da0

Please sign in to comment.