{"id":14008035,"url":"https://github.com/Lusitaniae/apache_exporter","last_synced_at":"2025-07-24T03:31:40.523Z","repository":{"id":39890472,"uuid":"44455471","full_name":"Lusitaniae/apache_exporter","owner":"Lusitaniae","description":"Prometheus exporter for Apache.","archived":false,"fork":false,"pushed_at":"2025-04-14T23:25:23.000Z","size":5095,"stargazers_count":335,"open_issues_count":17,"forks_count":148,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-14T23:33:56.819Z","etag":null,"topics":["apache","docker","metrics","prometheus","quay"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Lusitaniae.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2015-10-17T21:34:05.000Z","updated_at":"2025-04-14T23:08:40.000Z","dependencies_parsed_at":"2023-11-09T00:24:18.297Z","dependency_job_id":"298fda54-2037-465d-8a95-586374a77604","html_url":"https://github.com/Lusitaniae/apache_exporter","commit_stats":{"total_commits":185,"total_committers":45,"mean_commits":4.111111111111111,"dds":0.7027027027027026,"last_synced_commit":"c5b8c928a64e5621ecd774b224cf7b9b213424c9"},"previous_names":["neezgee/apache_exporter"],"tags_count":31,"template":false,"template_full_name":null,"purl":"pkg:github/Lusitaniae/apache_exporter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lusitaniae%2Fapache_exporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lusitaniae%2Fapache_exporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lusitaniae%2Fapache_exporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lusitaniae%2Fapache_exporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Lusitaniae","download_url":"https://codeload.github.com/Lusitaniae/apache_exporter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lusitaniae%2Fapache_exporter/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266789207,"owners_count":23984248,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-24T02:00:09.469Z","response_time":99,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apache","docker","metrics","prometheus","quay"],"created_at":"2024-08-10T11:01:10.575Z","updated_at":"2025-07-24T03:31:40.274Z","avatar_url":"https://github.com/Lusitaniae.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"\n# Apache Exporter for Prometheus [![Build Status][buildstatus]][circleci]\n\n[![GitHub release](https://img.shields.io/github/release/Lusitaniae/apache_exporter.svg)][release]\n![GitHub Downloads](https://img.shields.io/github/downloads/Lusitaniae/apache_exporter/total.svg)\n[![Docker Repository on Quay](https://quay.io/repository/Lusitaniae/apache-exporter/status)][quay]\n[![Docker Pulls](https://img.shields.io/docker/pulls/lusotycoon/apache-exporter.svg?maxAge=604800)][hub]\n\nExports apache mod_status statistics via HTTP for Prometheus consumption.\n\nWith working golang environment it can be built with `go get`.  There is a [good article](https://machineperson.github.io/monitoring/2016/01/04/exporting-apache-metrics-to-prometheus.html) with build HOWTO and usage example.\n\nHelp on flags:\n\n\u003cpre\u003e\n  -h, --[no-]help                Show context-sensitive help (also try\n                                 --help-long and --help-man).\n      --telemetry.endpoint=\"/metrics\"\n                                 Path under which to expose metrics.\n      --scrape_uri=\"http://localhost/server-status/?auto\"\n                                 URI to apache stub status page.\n      --host_override=\"\"         Override for HTTP Host header; empty string for\n                                 no override.\n      --[no-]insecure            Ignore server certificate if using https.\n      --custom_headers     Adds custom headers to the collector.\n      --[no-]web.systemd-socket  Use systemd socket activation listeners instead\n                                 of port listeners (Linux only).\n      --web.listen-address=:9117 ...\n                                 Addresses on which to expose metrics and web\n                                 interface. Repeatable for multiple addresses.\n      --web.config.file=\"\"       [EXPERIMENTAL] Path to configuration file that\n                                 can enable TLS or authentication.\n      --log.level=info           Only log messages with the given severity or\n                                 above. One of: [debug, info, warn, error]\n      --log.format=logfmt        Output format of log messages. One of: [logfmt,\n                                 json]\n      --[no-]version             Show application version.\n\n\u003c/pre\u003e\n\nTested on Apache 2.2 and Apache 2.4.\n\n If your server-status page is secured by http auth, add the credentials to the scrape URL following this example:\n\n```\nhttp://user:password@localhost/server-status?auto\n```\n\nOverride host name by runnning\n```\n./apache_exporter --host_override=example.com\n```\n\n# Using Docker\n\n## Use ```compose.yml```\n- Requires Docker CE\n- Does not build from source, but rather pulls from registry only\n1. Edit compose.yml if needed (Maybe to change server-status endpoint)\n2. ```docker compose up```\n\n### OR\n## Build the compatible binary\nTo make sure that exporter binary created by build job is suitable to run on busybox environment, generate the binary using Makefile definition. Inside project directory run:\n```\nmake\n```\n*Please be aware that binary generated using `go get` or `go build` with defaults may not work in busybox/alpine base images.*\n\nAnother option is to use a docker go container to generate the binary.\n\nPick an appropriate go image from https://hub.docker.com/_/golang. Inside the project directory run:\n```\ndocker run --rm -v \u003cproject home\u003e:/usr/local/go/src/github.com/Lusitaniae/apache_exporter -w /usr/local/go/src/github.com/Lusitaniae/apache_exporter \u003cgo docker image name\u003e make\n```\n\n## Build image\n\nRun the following commands from the project root directory.\n\n```\ndocker build -t apache_exporter .\n```\n\n## Run\n\n```\ndocker run -d -p 9117:9117 apache_exporter \\\n  --scrape_uri=\"https://your.server.com/server-status?auto\"\n```\n\n## Collectors\n\nApache metrics:\n\n```\n# HELP apache_accesses_total Current total apache accesses (*)\n# TYPE apache_accesses_total counter\n# HELP apache_scoreboard Apache scoreboard statuses\n# TYPE apache_scoreboard gauge\n# HELP apache_sent_kilobytes_total Current total kbytes sent (*)\n# TYPE apache_sent_kilobytes_total counter\n# HELP apache_cpu_load CPU Load (*)\n# TYPE apache_cpu_load gauge\n# HELP apache_up Could the apache server be reached\n# TYPE apache_up gauge\n# HELP apache_uptime_seconds_total Current uptime in seconds (*)\n# TYPE apache_uptime_seconds_total counter\n# HELP apache_workers Apache worker statuses\n# TYPE apache_workers gauge\n# HELP apache_version Apache server version\n# TYPE apache_version gauge\n# HELP apache_duration_ms_total Total duration of all registered requests\n# TYPE apache_duration_ms_total gauge\n```\n\nMetrics marked '(*)' are only available if ExtendedStatus is On in apache webserver configuration. In version 2.3.6, loading mod_status will toggle ExtendedStatus On by default.\n\n## FAQ\n\nQ. Can I change the Dockerfile?\n\nA. In short no, it's not meant for end users. It's part of the CI/CD pipeline in which promu is cross building the exporter for all architectures and packaging them into a Docker image.\n\nQ. Can I run this exporter on different architectures (ARM)?\n\nA. This exporter is cross compiled to all architectures using [promu](https://github.com/prometheus/promu) by running `promu crossbuild`. You can find the resulting artifacts in the release page (Github) or docker images in [Quay](https://quay.io/repository/Lusitaniae/apache-exporter) or [Docker](https://hub.docker.com/r/lusotycoon/apache-exporter/).\n\nQ. Is there a Grafana dashboard for this exporter?\n\nA. There's a 3rd party dashboard [here](https://grafana.com/dashboards/3894) which seems to work.\nAlso [monitoring-mixin](https://monitoring.mixins.dev/) (dashboard+prometheus alerts) is available [here](https://github.com/grafana/jsonnet-libs/tree/master/apache-http-mixin).\n\nQ. Can you add additional metrics such as reqpersec, bytespersec and bytesperreq?\n\nA. In line with the [best practices](https://prometheus.io/docs/instrumenting/writing_exporters/#drop-less-useful-statistics), the exporter only provides the totals and you should derive rates using [PromQL](https://prometheus.io/docs/prometheus/latest/querying/basics/).\n\n\u003e   Like that:\n\u003e   - `ReqPerSec` : `rate(apache_accesses_total[5m])`\n\u003e   - `BytesPerSec`: `rate(apache_sent_kilobytes_total[5m])`\n\u003e   - `BytesPerReq`: BytesPerSec / ReqPerSec\n\nQ. Can I monitor multiple Apache instances?\n\nA. In line with the [best practices](https://prometheus.io/docs/instrumenting/writing_exporters/#deployment), the answer is no. *Each process being monitored should be accompanied by **one** exporter*.\n\nWe suggest automating configuration and deployment using your favorite tools, e.g. Ansible/Chef/Kubernetes.\n\nQ. Its not working! Apache_up shows as 0\n\nA. When apache_up reports 0 it means the exporter is running however it is not able to connect to Apache.\n\nDo you have this (or similar) configuration uncommented in your Apache instance?\n```\n\u003cLocation \"/server-status\"\u003e\n    SetHandler server-status\n    Require host example.com\n\u003c/Location\u003e\n```\nAs documented at\nhttps://httpd.apache.org/docs/2.4/mod/mod_status.html\n\nAre you able to see the stats, if you run this from the Apache instance?\n\n`curl localhost/server-status?auto`\n\nIf you run the exporter manually, do you see any errors?\n\n`./apache_exporter`\n\nPlease include all this information if you still have issues when creating an issue.\n\nQ. There seem to be missing metrics! I can only see apache_up and apache_cpuload.\n\nA. Make sure that you add `?auto` at the end of the scrape_uri.\n\n\n\n## TLS and basic authentication\n\nApache Exporter supports TLS and basic authentication. This enables better\ncontrol of the various HTTP endpoints.\n\nTo use TLS and/or basic authentication, you need to pass a configuration file\nusing the `--web.config` parameter (see above at help on flags). The format of the file is described\n[in the exporter-toolkit repository](https://github.com/prometheus/exporter-toolkit/blob/master/docs/web-configuration.md).\n\nNote that the TLS and basic authentication settings affect all HTTP endpoints:\n/metrics for scraping, /probe for probing, and the web UI.\n\n\n## Author\n\nThe exporter was originally created by [neezgee](https://github.com/neezgee).\n\n\n[buildstatus]: https://circleci.com/gh/Lusitaniae/apache_exporter/tree/master.svg?style=shield\n[quay]: https://quay.io/repository/Lusitaniae/apache-exporter\n[circleci]: https://circleci.com/gh/Lusitaniae/apache_exporter\n[hub]: https://hub.docker.com/r/lusotycoon/apache-exporter/\n[release]: https://github.com/Lusitaniae/apache_exporter/releases/latest\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLusitaniae%2Fapache_exporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FLusitaniae%2Fapache_exporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLusitaniae%2Fapache_exporter/lists"}