https://github.com/magenta-aps/os2mo-amqp-trigger-metrics
OS2mo AMQP Trigger receiver that exposes metrics about changes in MO.
https://github.com/magenta-aps/os2mo-amqp-trigger-metrics
managed-by-atlantis mirrored-repository
Last synced: 17 days ago
JSON representation
OS2mo AMQP Trigger receiver that exposes metrics about changes in MO.
- Host: GitHub
- URL: https://github.com/magenta-aps/os2mo-amqp-trigger-metrics
- Owner: magenta-aps
- License: other
- Created: 2022-12-08T13:13:58.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2022-12-10T14:05:12.000Z (over 2 years ago)
- Last Synced: 2025-02-17T15:47:03.539Z (3 months ago)
- Topics: managed-by-atlantis, mirrored-repository
- Language: Python
- Homepage:
- Size: 70.3 KB
- Stars: 0
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# OS2mo AMQP Trigger Metrics
This repository contains an OS2mo AMQP Trigger receiver that exposes metrics about changes in MO.
## Usage
Adjust the `AMQP_URL` variable to OS2mo's running message-broker, either;
* directly in `docker-compose.yml` or
* by creating a `docker-compose.override.yaml` file.Now start the container using `docker-compose`:
```
docker-compose up -d
```You should see the following:
```
[info ] Starting metrics server
[info ] Register called function=metrics_callback routing_key=*.*.*
[info ] Starting AMQP system
[info ] Establishing AMQP connection host=msg_broker path=/ port=5672 scheme=amqp user=guest
[info ] Creating AMQP channel
[info ] Attaching AMQP exchange to channel exchange=os2mo
[info ] Declaring unique message queue function=metrics_callback queue_name=os2mo-amqp-trigger-metrics_metrics_callback
[info ] Starting message listener function=metrics_callback
[info ] Binding routing keys function=metrics_callback
[info ] Binding routing-key function=metrics_callback routing_key=*.*.*
```
After which each message will add:
```
[debug ] Received message function=metrics_callback routing_key=org_unit.address.edit
[info ] Message received object_type=address payload=... request_type=edit service_type=org_unit
```
And at which point metrics should be available at `localhost:8000`:
```
...
# HELP os2mo_events_total AMQP Events
# TYPE os2mo_events_total counter
os2mo_events_total{request="edit",object="org_unit",service="org_unit"} 1.0
# HELP os2mo_events_created AMQP Events
# TYPE os2mo_events_created gauge
os2mo_events_created{request="edit",object="org_unit",service="org_unit"} 1.6273914312081306e+09
```