Apache HTTP Server
The OpenTelemetry Collector's Apache receiver collects 13 metrics from
Apache HTTP Server 2.4.13+, including request rates, traffic throughput,
worker status, CPU usage, and system load averages. This guide configures
the receiver, enables the required mod_status endpoint, and ships metrics
to base14 Scout.
Prerequisites
| Requirement | Minimum | Recommended |
|---|---|---|
| Apache HTTP Server | 2.4.13 | 2.4.x |
| OTel Collector Contrib | 0.90.0 | latest |
| base14 Scout | Any | — |
Before starting:
- Apache must be accessible from the host running the Collector
mod_statusmodule loaded withExtendedStatus On- OTel Collector installed — see Docker Compose Setup
What You'll Monitor
- Requests: total request count, request processing time
- Traffic: bytes served, current connections, async connection states
- Workers: busy/idle workers, scoreboard slot states
- CPU: CPU load percentage, user/system CPU time
- System: 1/5/15-minute load averages, server uptime
Full metric reference: OTel Apache Receiver
Access Setup
Enable mod_status in your Apache configuration:
# Enable extended status for full metrics
ExtendedStatus On
# Expose the status endpoint
<Location "/server-status">
SetHandler server-status
# Restrict access to monitoring network
Require ip 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16
</Location>
mod_status is loaded by default in most Apache installations. If not,
add LoadModule status_module modules/mod_status.so before the block
above.
Verify the endpoint returns machine-readable data:
curl -s http://localhost/server-status?auto
Configuration
receivers:
apache:
endpoint: http://localhost/server-status?auto # Change to your Apache URL
collection_interval: 30s
metrics:
# Connections
apache.connections.async:
enabled: true
apache.current_connections:
enabled: true
# Requests and traffic
apache.requests:
enabled: true
apache.request.time:
enabled: true
apache.traffic:
enabled: true
# Workers
apache.workers:
enabled: true
apache.scoreboard:
enabled: true
# CPU
apache.cpu.load:
enabled: true
apache.cpu.time:
enabled: true
# System load
apache.load.1:
enabled: true
apache.load.5:
enabled: true
apache.load.15:
enabled: true
# Uptime
apache.uptime:
enabled: true
processors:
resource:
attributes:
- key: environment
value: ${env:ENVIRONMENT}
action: upsert
- key: service.name
value: ${env:SERVICE_NAME}
action: upsert
batch:
timeout: 10s
send_batch_size: 1024
# Export to base14 Scout
exporters:
otlphttp/b14:
endpoint: ${env:OTEL_EXPORTER_OTLP_ENDPOINT}
tls:
insecure_skip_verify: true
service:
pipelines:
metrics:
receivers: [apache]
processors: [resource, batch]
exporters: [otlphttp/b14]
Environment Variables
ENVIRONMENT=your_environment
SERVICE_NAME=your_service_name
OTEL_EXPORTER_OTLP_ENDPOINT=https://<your-tenant>.base14.io
Verify the Setup
Start the Collector and check for metrics within 60 seconds:
# Check Collector logs for successful scrape
docker logs otel-collector 2>&1 | grep -i "apache"
# Verify server-status endpoint responds
curl -s http://localhost/server-status?auto
# Check mod_status is loaded
apachectl -M 2>&1 | grep status
Troubleshooting
403 Forbidden on server-status
Cause: The Require directive restricts access and the Collector's
IP is not allowed.
Fix:
- Add the Collector's IP to the
Require iplist in the<Location>block - For Docker setups, use the container network CIDR
(e.g.,
Require ip 172.16.0.0/12) - Restart Apache after changing the config:
apachectl graceful
No metrics or partial metrics
Cause: ExtendedStatus is not enabled, so only basic metrics are
returned.
Fix:
- Add
ExtendedStatus Onbefore the<Location>block - Verify by checking the output of
curl -s http://localhost/server-status?auto— it should includeTotal Accesses,CPULoad, andReqPerSec - Restart Apache:
apachectl graceful
No metrics appearing in Scout
Cause: Metrics are collected but not exported.
Fix:
- Check Collector logs for export errors:
docker logs otel-collector - Verify
OTEL_EXPORTER_OTLP_ENDPOINTis set correctly - Confirm the pipeline includes both the receiver and exporter
Load average metrics showing zero on non-Linux
Cause: apache.load.1, apache.load.5, and apache.load.15 rely
on system load averages exposed by Apache, which may not be available on
all operating systems.
Fix:
- These metrics are populated on Linux systems where Apache reports
system load in
server-status - On macOS or Windows, these may report zero — this is expected behavior
- Use OS-level monitoring for load averages on non-Linux platforms
FAQ
Does this work with Apache running in Kubernetes?
Yes. Set endpoint to the Apache service DNS
(e.g., http://apache.default.svc.cluster.local/server-status?auto) and
ensure mod_status allows access from the Collector pod's network. The
Collector can run as a sidecar or DaemonSet.
How do I monitor multiple Apache instances?
Add multiple receiver blocks with distinct names:
receivers:
apache/web1:
endpoint: http://web-1/server-status?auto
apache/web2:
endpoint: http://web-2/server-status?auto
Then include both in the pipeline:
receivers: [apache/web1, apache/web2]
Is mod_status already loaded by default?
In most Apache installations (including the official Docker image),
mod_status is loaded by default. You only need to add the <Location>
block and ExtendedStatus On. Check with apachectl -M | grep status.
What is the scoreboard metric?
apache.scoreboard tracks the state of each Apache worker slot: waiting,
reading, sending, keepalive, DNS lookup, closing, logging, graceful
finish, idle cleanup, or open. It gives a real-time view of how Apache is
distributing work across its worker pool.
What's Next?
- Create Dashboards: Explore pre-built dashboards or build your own. See Create Your First Dashboard
- Monitor More Components: Add monitoring for NGINX, HAProxy, and other components
- Fine-tune Collection: Adjust
collection_intervalbased on your traffic patterns
Related Guides
- OTel Collector Configuration — Advanced collector configuration
- Docker Compose Setup — Run the Collector locally
- NGINX Monitoring — Alternative web server monitoring
- Kubernetes Helm Setup — Production deployment
- Creating Alerts — Alert on Apache HTTP metrics