https://github.com/peopledoc/haproxy-stats-lib
Java library to get data from HAProxy stats and putting it in JSON
https://github.com/peopledoc/haproxy-stats-lib
approved-public ghec-mig-migrated tribe-java
Last synced: 10 months ago
JSON representation
Java library to get data from HAProxy stats and putting it in JSON
- Host: GitHub
- URL: https://github.com/peopledoc/haproxy-stats-lib
- Owner: peopledoc
- License: apache-2.0
- Created: 2018-10-23T14:56:17.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-12-05T22:29:53.000Z (about 2 years ago)
- Last Synced: 2025-03-22T20:38:29.054Z (10 months ago)
- Topics: approved-public, ghec-mig-migrated, tribe-java
- Language: Java
- Size: 71.3 KB
- Stars: 0
- Watchers: 8
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
HAProxy monitoring library
==========================
Overview
--------
Java library to poll statistics from HAProxy instances and give back a
formatted JSON file to use in another applications.
Key Features
------------
- Configurable with a YAML file.
- Give back a JSON with some data in it.
Maven usage
-----------
```xml
com.peopledoc
haproxy-stats
1.3.2
```
Classes to use
--------------
* `com.peopledoc.haproxystats.HAProxyChecker` to check HAProxy stats.
* `com.peopledoc.statsretriever.StatsRetriever` to collect results from multiple servers providing results
from `HAProxyChecker`.
Config file format (verbose)
----------------------------
For `com.peopledoc.haproxystats.HAProxyChecker` :
```yaml
environment: env-name
# HAProxy instances list
loadbalancers:
- name: haproxy1
url: http://haproxy1.example.com
username: userA
password: pass
# optional whitelist of proxies
proxies:
- app1
- app2
```
For `com.peopledoc.statsretriever.StatsRetriever` :
```yaml
integration: https://integration.example.com
test: https://test.example.com
```
Result sample
-------------
```json
{
"test" : [ {
"name" : "app1",
"backends" : [ {
"name" : "app1-A",
"weight" : 0,
"available" : true,
"status" : "DISABLED"
}, {
"name" : "app1-B",
"weight" : 100,
"available" : true,
"status" : "OK"
} ],
"loadbalancer" : "haproxy1"
} ]
}
```
License
-------
Apache License v2.0 - © 2018 PeopleDoc