An open API service indexing awesome lists of open source software.

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

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