-
-
Notifications
You must be signed in to change notification settings - Fork 6
Prometheus
GitHub Action edited this page Aug 17, 2025
·
1 revision
This guide explains how to integrate access-log-exporter with Prometheus.
access-log-exporter --preset simple
By default, metrics are exposed on http://localhost:4040/metrics
Add this to your prometheus.yml
:
scrape_configs:
- job_name: 'access-log-exporter'
static_configs:
- targets: ['localhost:4040']
scrape_interval: 30s
Check Prometheus targets at http://your-prometheus:9090/targets
-
http_requests_total
- Request counter with labels: host, method, status -
http_request_duration_seconds
- Response time histogram -
http_request_size_bytes
- Request size histogram -
http_response_size_bytes
- Response size histogram
-
http_upstream_connect_duration_seconds
- Upstream connection time -
http_upstream_header_duration_seconds
- Upstream header time -
http_upstream_request_duration_seconds
- Upstream response time
All metrics include request_uri
label with path normalization:
http_requests_total{host="example.com",method="GET",status="200",path="/api/users/.+"}
# Requests per second
rate(http_requests_total[5m])
# 95th percentile response time
histogram_quantile(0.95, rate(http_request_duration_seconds_bucket[5m]))
# Error rate
sum(rate(http_requests_total{status=~"5.."}[5m])) / sum(rate(http_requests_total[5m]))
version: '3.8'
services:
access-log-exporter:
image: ghcr.io/jkroepke/access-log-exporter:latest
ports:
- "4040:4040"
- "8514:8514/udp"
prometheus:
image: prom/prometheus:latest
ports:
- "9090:9090"
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml
- No metrics: Check if access-log-exporter is receiving logs from your web server
-
High cardinality: Use
simple_uri_upstream
preset for automatic path normalization - Performance: Use 30-60 second scrape intervals for web metrics
This wiki is synced with the docs
folder from the code repository! To improve the wiki, create a pull request against the code repository with the suggested changes.