-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
63 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# Apache Exporter for Prometheus | ||
Exports server statistics provided by mod_status of an Apache HTTP server to Prometheus metrics format | ||
|
||
It can be built with: | ||
|
||
``` | ||
mvn clean install | ||
``` | ||
|
||
## Usage | ||
|
||
It can be importer in your Maven project with | ||
|
||
``` | ||
<dependency> | ||
<groupId>ch.postfinance.prometheus</groupId> | ||
<artifactId>apache-exporter</artifactId> | ||
<version>v1.0.0</version> | ||
</dependency> | ||
``` | ||
|
||
To obtain the metrics, use the method: | ||
|
||
|
||
``` | ||
public String export() throws IOException | ||
``` | ||
|
||
It returns a String in the format: | ||
|
||
``` | ||
# HELP apache_exporter_build_info A metric with a constant '1' value labeled by version, revision, branch, and goversion from which apache_exporter was built. | ||
# TYPE apache_exporter_build_info gauge | ||
apache_exporter_build_info{branch="HEAD",goversion="go1.12.6",revision="6195241a96c02af175ba2842dfd883682133b066",version="0.7.0"} 1 | ||
# HELP apache_scoreboard Apache scoreboard statuses | ||
# TYPE apache_scoreboard gauge | ||
apache_scoreboard{state="closing"} 0 | ||
apache_scoreboard{state="dns"} 0 | ||
apache_scoreboard{state="graceful_stop"} 0 | ||
apache_scoreboard{state="idle"} 6 | ||
apache_scoreboard{state="idle_cleanup"} 0 | ||
apache_scoreboard{state="keepalive"} 1 | ||
apache_scoreboard{state="logging"} 0 | ||
apache_scoreboard{state="open_slot"} 142 | ||
apache_scoreboard{state="read"} 0 | ||
apache_scoreboard{state="reply"} 1 | ||
apache_scoreboard{state="startup"} 0 | ||
# HELP apache_sent_kilobytes_total Current total kbytes sent (*) | ||
# TYPE apache_sent_kilobytes_total counter | ||
apache_sent_kilobytes_total 5721 | ||
# HELP apache_up Could the apache server be reached | ||
# TYPE apache_up gauge | ||
apache_up 1 | ||
# HELP apache_uptime_seconds_total Current uptime in seconds (*) | ||
# TYPE apache_uptime_seconds_total counter | ||
apache_uptime_seconds_total 9255 | ||
# HELP apache_workers Apache worker statuses | ||
# TYPE apache_workers gauge | ||
apache_workers{state="busy"} 2 | ||
apache_workers{state="idle"} 6 | ||
``` |