You can collect metrics about your Squid Cache Manager with the OpenTelemetry Collector. The collector is a component of OpenTelemetry that collects, processes, and exports telemetry data to New Relic (or any observability backend).
If you're looking for help with other collector use cases, see the newrelic-opentelemetry-examples repository.
Complete the steps below to collect metrics from Squid:
Allow the host where your Squid Prometheus exporter will be running to access the Squid Cache manager by setting the allowance in the
# Given this access listacl localnet src 192.168.0.0/16# We would allow that ip range to access the manager by setting this directivehttp_access allow localnet manager
Install the Squid Prometheus exporter for your Squid Cache Manager and set it up to point to the squid cache manager you want to monitor.
Example exporter execution:
squid-exporter -squid-hostname localhost -squid-port 3128 -listen ":9301" -squid-login admin -squid-password admin
Squid Prometheus exporter v1.10.4 or higher is required, the latest available version is recommended.
Download and install the Opentelemetry collector following Opentelemetry docs.
Create a new file called
config.yaml from the example below.
Replace the following keys in the file with your own values:
- New Relic License key:
squid_cachemgr: SQUID_CACHEMGR (where SQUID_CACHEMGR should be a unique identifier) is required in order for the
SQUID_CACHEMGR entity to be created and for the associated dashboards to run.
receivers:prometheus:config:scrape_configs:- job_name: "squid"static_configs:- targets: [ "SQUID_EXPORTER_HOSTNAME:SQUID_EXPORTER_PORT" ]labels:squid_cachemgr: SQUID_CACHEMGRmetrics_path: SQUID_EXPORTER_METRICS_PATHmetric_relabel_configs:- source_labels: [__name__]regex: "^process_.*"action: dropexporters:otlp:endpoint: https://otlp.nr-data.net:4317headers:api-key: NEW_RELIC_LICENSE_KEYprocessors:batch:memory_limiter:limit_mib: 400spike_limit_mib: 100check_interval: 5sservice:telemetry:logs:pipelines:metrics:receivers: [prometheus]processors: [batch, memory_limiter]exporters: [otlp]
Run the Opentelemetry collector (the way to run it may vary depending on the chosen installation method). Example:
/usr/bin/otelcol --config ./config.yaml
You may use the metrics explorer to check the metrics being ingested. All metrics reported by the Squid Prometheus exporter are grouped in a
SQUID_CACHEMGR entity with the name set in
SQUID_CACHEMGR and start with
These are the two groups of metrics reported by the squid cache manager that are scraped: