This chart includes comprehensive Prometheus monitoring capabilities through:
- Integrated upstream squid-exporter for standard Squid metrics
- A per-site exporter that parses Squid access logs (via STDOUT piping) to emit per-host request metrics
Both exporters are bundled into the single Squid container image.
The standard exporter connects to Squid's cache manager over localhost, which is
the only source allowed by the chart's cache-manager access rules. The chart does
not configure cachemgr_passwd, so exporter authentication is not needed.
The unused squidExporter.squidLogin and squidExporter.squidPassword options have
been removed from the chart. These keys are no longer accepted by the schema,
including when their values are empty; remove them from any existing values files.
The monitoring system provides detailed metrics about Squid's operational status:
- Liveness: Squid service information and connection status
- Bandwidth Usage: Client HTTP and Server HTTP traffic metrics
- Hit/Miss Rates: Cache performance metrics (general and detailed)
- Storage Utilization: Cache information and memory usage
- Service Times: Response times for different operations
- Connection Information: Active connections and request details
Monitoring is enabled by default. To customize or disable it:
# In values.yaml or via --set flags
squidExporter:
enabled: true # Set to false to disable
port: 9301
metricsPath: "/metrics"
extractServiceTimes: "true" # Enables detailed service time metrics
resources:
requests:
cpu: 10m
memory: 16Mi
limits:
cpu: 100m
memory: 64MiPer-site exporter (enabled by default):
# In values.yaml or via --set flags
perSiteExporter:
enabled: true
port: 9302
metricsPath: "/metrics"If you're using Prometheus Operator, the chart automatically creates a ServiceMonitor:
prometheus:
serviceMonitor:
enabled: true
interval: 30s
scrapeTimeout: 10s
namespace: "" # Leave empty to use the same namespace as the appWhen enabled, the ServiceMonitor exposes endpoints for both exporters: 9301 (standard, HTTP) and 9302 (per-site, HTTPS). The per-site endpoint is scraped with scheme: https by default, with TLS configured via prometheus.serviceMonitor.perSiteTLS (auto-derives the CA secret name as <namespace>-tls, e.g., squid-proxy-tls when deployed to the squid-proxy namespace).
ServiceMonitor CRD Included:
The chart includes the ServiceMonitor CRD in the crds/ directory, so it will be automatically installed by Helm when the chart is deployed.
If you don't want ServiceMonitor functionality, you can disable it:
helm install caching ./caching --set prometheus.serviceMonitor.enabled=falseFor non-Prometheus Operator setups, disable ServiceMonitor and use manual Prometheus configuration:
scrape_configs:
- job_name: 'squid-proxy'
static_configs:
- targets: ['squid.<NAMESPACE>.svc.<CLUSTER_DOMAIN>:9301']
scrape_interval: 30s
metrics_path: '/metrics'Complete example: See docs/prometheus-config-example.yaml in this repository for a full Prometheus configuration file.
squid_client_http_requests_total: Total client HTTP requestssquid_client_http_hits_total: Total client HTTP hitssquid_client_http_errors_total: Total client HTTP errorssquid_server_http_requests_total: Total server HTTP requestssquid_cache_memory_bytes: Cache memory usagesquid_cache_disk_bytes: Cache disk usagesquid_service_times_seconds: Service times for different operationssquid_up: Squid availability status
squid_site_requests_total{hostname="<hostname>"}: Total requests per origin hostsquid_site_hits_total{hostname="<hostname>"}: Cache hits per hostsquid_site_misses_total{hostname="<hostname>"}: Cache misses per hostsquid_site_bytes_total{hostname="<hostname>"}: Bytes transferred per hostsquid_site_hit_ratio{hostname="<hostname>"}: Hit ratio gauge per hostsquid_site_response_time_seconds{hostname="<hostname>",le="..."}: Response time histogram per host
# Forward the standard squid-exporter metrics port
kubectl port-forward -n squid-proxy svc/squid 9301:9301
# View standard metrics in your browser or with curl
curl http://localhost:9301/metricsPer-site exporter metrics (note: port 9302 uses HTTPS):
# Forward the per-site exporter metrics port
kubectl port-forward -n squid-proxy svc/squid 9302:9302
# View per-site metrics (TLS, skip cert verification for local testing)
curl -k https://localhost:9302/metricsThe metrics are exposed on the service:
# Standard squid-exporter metrics (from within the cluster)
# Replace <NAMESPACE> (default: "squid-proxy") and <CLUSTER_DOMAIN> (default: "cluster.local")
curl http://squid.<NAMESPACE>.svc.<CLUSTER_DOMAIN>:9301/metrics
# Per-site exporter metrics (from within the cluster — uses HTTPS)
curl -k https://squid.<NAMESPACE>.svc.<CLUSTER_DOMAIN>:9302/metricsSee the troubleshooting guide for common monitoring issues.