Apache exporter

984 views
Skip to first unread message

nee...@gmail.com

unread,
Oct 20, 2015, 9:57:39 AM10/20/15
to Prometheus Developers
Hello!

I've written apache exporter:

https://github.com/neezgee/apache_exporter

It is not tested very much, but it works for me. :-)

Björn Rabenstein

unread,
Oct 21, 2015, 6:09:16 AM10/21/15
to nee...@gmail.com, Prometheus Developers
Looks quite good. Thanks for the work done.

Some nits:

Port 9114 is already used by the Elasticsearch exporter. See
https://github.com/prometheus/prometheus/wiki/Default-port-allocations
(the list might not be up to date – we should probably check it
against http://prometheus.io/docs/instrumenting/exporters/ ).

The naming convention for counters is to always end on `_total`. Some
of your counters have the `total` in the middle, some have none at
all.

Exporting rates directly ("something per second") is rather
"un-Promethean". It is preferred to export a counter of "something"
and let the Prometheus server calculate a rate. (In that way, you
don't lose data but only resolution if you miss a scrape.) mod_status
is exporting rates because not everybody has Prometheus. :) If I
understand the mod_status output correctly, `ReqPerSec` is just a rate
of `Total Accesses`. Correspondingly, `BytesPerSec` is a rate of
`Total kBytes`, and `BytesPerReq` is the ratio of `BytesPerSec` and
`ReqPerSec`. All of these calculations can be done by Prometheus, so
arguably, you should not export `ReqPerSec`, `BytesPerSec` and
`BytesPerReq` at all.
> --
> You received this message because you are subscribed to the Google Groups "Prometheus Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-devel...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
Björn Rabenstein, Engineer
http://soundcloud.com/brabenstein

SoundCloud Ltd. | Rheinsberger Str. 76/77, 10115 Berlin, Germany
Managing Director: Alexander Ljung | Incorporated in England & Wales
with Company No. 6343600 | Local Branch Office | AG Charlottenburg |
HRB 110657B

Руслан И.

unread,
Oct 21, 2015, 7:25:30 AM10/21/15
to Björn Rabenstein, Prometheus Developers
Thank you for comments, Björn!

I checked what ports are alredy used. You can update your list:

bind_exporter - 9109
couchdb_exporter - 9984
django-prometheus - 8001
mtail - 3903
memcache_exporter - 9106
mongo - 9001
munin - 8080
newrelic - 9126
postgresql - 9113
RabbitMQ Exporter - 9090
redis - 9121
rethinkdb_exporter - 9123
rsyslog - 9104
scollector - 9107
sql - 8080

9117 is not used, so I would like to reserve it.

I made all proposed changes. Please look at it again.

Björn Rabenstein

unread,
Oct 22, 2015, 5:35:49 AM10/22/15
to Руслан И., Prometheus Developers
Thanks for collecting all those ports. I guess we should update the
list based on your research.

On Wed, Oct 21, 2015 at 1:25 PM, Руслан И. <nee...@gmail.com> wrote:
> 9117 is not used, so I would like to reserve it.

Sounds good. But I'd feel better if other core devs could voice their
opinion. Anybody?

> I made all proposed changes. Please look at it again.

Will do ASAP.

Björn Rabenstein

unread,
Oct 23, 2015, 4:31:45 PM10/23/15
to Руслан И., Prometheus Developers
OK, no objections voiced, so I have penciled in port 9117 at
https://github.com/prometheus/prometheus/wiki/Default-port-allocations
. (Unfortunately, many ports you have researched are already
collisions with existing reservations. Meh...)

You metrics look good to me. Some final nits: "access_total" should
probably be "accesses_total" as counters usually use the plural form
(and all your others do). Also, it would be nicer to end the help
string with a period consistently.

Thanks for your work. I'll also add the exporter to our list of 3rd
party exporters.

Руслан И.

unread,
Oct 23, 2015, 5:34:18 PM10/23/15
to Björn Rabenstein, Prometheus Developers
Fixed and released 0.1. :-)

Yosef Yudilevich

unread,
Jun 28, 2016, 8:50:53 AM6/28/16
to Prometheus Developers, nee...@gmail.com
hi, do we get only 4 metrics from exporter?

may be you could add 
from:
totalaccepting busy idle writing keep-alive closing

and more
4 is not enough at all for real life 
PS i am not a dev so cant help for now

Ben Kochie

unread,
Jun 28, 2016, 9:29:22 AM6/28/16
to Yosef Yudilevich, Prometheus Developers, nee...@gmail.com
Because that's all that the apache server provides.  It's pretty useless.

I wrote a much better metrics generator using apache logs and mtail.  There are example configs for both common logs and one for a log format tailored to metrics.


--

Yosef Yudilevich

unread,
Jun 28, 2016, 10:24:47 AM6/28/16
to Ben Kochie, Prometheus Developers, nee...@gmail.com
did you set
"ExtendedStatus On"

in apache config?

thanks




Ben Kochie

unread,
Jun 28, 2016, 10:29:21 AM6/28/16
to Yosef Yudilevich, Prometheus Developers, Руслан И.
Yes, but all of those values are useless since they show the ephemeral state of each proccess/thread.  They do not collect usage counters.  If you have a typical polling interval of say 15 seconds anything going on in between those 15 seconds is lost.

Yosef Yudilevich

unread,
Jun 28, 2016, 11:00:09 AM6/28/16
to Prometheus Developers, nee...@gmail.com
actually you are right and the mtail looks prommising
but if you would add only few more things in this exporter it would get usable :)
may be "sum"sections
the stuff you dont get from logs
like  threads, sessions traffic
dunno how complicated id it :)
thanks anyway

going to try mtail :)


On Tuesday, October 20, 2015 at 4:57:39 PM UTC+3, nee...@gmail.com wrote:

Yosef Yudilevich

unread,
Jun 28, 2016, 11:09:13 AM6/28/16
to Prometheus Developers, nee...@gmail.com
also it is changed, i guess because i see:
<dt>Total accesses: 3429 - Total Traffic: 8.7 MB</dt>

its apache 2.4

On Tuesday, October 20, 2015 at 4:57:39 PM UTC+3, nee...@gmail.com wrote:

petar...@mint.rs

unread,
Aug 1, 2017, 6:10:45 AM8/1/17
to Prometheus Developers, nee...@gmail.com

Someone have problem with installation ?

When I try go get nothing happens, still blocked.

When I try go got -v github.com/neezgee/apache_exporter

I see:

Parsing meta tags from https://gopkg.in/alecthomas/kingpin.v2?go-get=1 (status code 200)
get "gopkg.in/alecthomas/kingpin.v2": found meta tag main.metaImport{Prefix:"gopkg.in/alecthomas/kingpin.v2", VCS:"git", RepoRoot:"https://gopkg.in/alecthomas/kingpin.v2"} at https://gopkg.in/alecthomas/kingpin.v2?go-get=1
gopkg.in/alecthomas/kingpin.v2 (download)

Reply all
Reply to author
Forward
0 new messages