integrations/apache/documentation.yaml (87 lines of code) (raw):

exporter_type: sidecar app_name_short: Apache Web Server app_name: {{app_name_short}} (httpd) app_site_name: Apache HTTP app_site_url: https://httpd.apache.org/ exporter_name: the Apache HTTP exporter exporter_pkg_name: httpd_exporter exporter_repo_url: https://github.com/Lusitaniae/apache_exporter dashboard_available: true minimum_exporter_version: v1.0.0 multiple_dashboards: false dashboard_display_name: Apache Prometheus Overview config_mods: | apiVersion: v1 kind: ConfigMap metadata: name: httpd data: httpd.conf: | ... + <Location "/server-status"> + SetHandler server-status + </Location> + LoadModule status_module modules/mod_status.so ... --- apiVersion: apps/v1 kind: Deployment metadata: name: httpd spec: replicas: 1 selector: matchLabels: + app.kubernetes.io/name: httpd template: metadata: labels: + app.kubernetes.io/name: httpd spec: containers: - name: httpd image: httpd:2.4 ports: - containerPort: 80 name: httpd + volumeMounts: + - mountPath: /usr/local/apache2/conf/httpd.conf + subPath: httpd.conf + name: httpd + - name: httpd-exporter + image: lusotycoon/apache-exporter:v1.0.0 + ports: + - containerPort: 9117 + name: prometheus + command: ["/bin/apache_exporter"] + args: ["--scrape_uri=http://localhost/server-status?auto", "--web.listen-address=:9117", "--telemetry.endpoint=/metrics"] + volumes: + - name: httpd + configMap: + name: httpd + items: + - key: httpd.conf + path: httpd.conf additional_install_info: | These instructions assume you already have a working {{app_name_short}} installation and want to modify it to include an exporter. Apache HTTP server can be configured to serve metrics on `/server-status` by modifying the configuration with a new `Location` directive and by loading the [status_module](https://httpd.apache.org/docs/2.4/mod/mod_status.html){:class=external}. podmonitoring_config: | apiVersion: monitoring.googleapis.com/v1 kind: PodMonitoring metadata: name: httpd labels: app.kubernetes.io/name: httpd app.kubernetes.io/part-of: google-cloud-managed-prometheus spec: endpoints: - port: prometheus scheme: http interval: 30s path: /metrics selector: matchLabels: app.kubernetes.io/name: httpd sample_promql_query: up{job="httpd", cluster="{{cluster_name}}", namespace="{{namespace_name}}"}