Squid Exporter

Squid Prometheus Exporter
Alternatives To Squid Exporter
Project NameStarsDownloadsRepos Using ThisPackages Using ThisMost Recent CommitTotal ReleasesLatest ReleaseOpen IssuesLicenseLanguage
Prometheus Basics1,413
2 years ago2mitGo
A beginner friendly introduction to prometheus 🔥
Minecraft Prometheus Exporter329
a month ago15mitJava
A Bukkit plugin which exports minecraft server stats to Prometheus
Dathttpd286
5 years ago18July 17, 201812mitJavaScript
Replaced by Homebase! See https://github.com/beakerbrowser/homebase.
Moproxy201
23 days ago4mitRust
A transparent TCP to SOCKSv5/HTTP proxy on Linux written in Rust.
Memcached_exporter15812 days ago13March 08, 20236apache-2.0Go
Exports metrics from memcached servers for consumption by Prometheus.
Nats Surveyor158
3 days ago21March 15, 202314apache-2.0Go
NATS Monitoring, Simplified.
Promql Langserver153
4 months ago11March 02, 202221apache-2.0Go
PromQL language server
Heplify Server147
3 months ago8October 26, 202217agpl-3.0Go
HEP Capture Server
Nextcloud Exporter145
7 months ago16October 19, 20222mitGo
Prometheus exporter for Nextcloud servers.
Squid Exporter101
15 days ago10February 25, 20222mitGo
Squid Prometheus Exporter
Alternatives To Squid Exporter
Select To Compare


Alternative Project Comparisons
Readme

Gitpod ready-to-code

Github Actions Github Docker Go Report Card Maintainability Donate

Squid Prometheus exporter

Exports squid metrics in Prometheus format

NOTE: From release 1.0 metric names and some parameters has changed. Make sure you check the docs and update your deployments accordingly!

New

  • Using environment variables to configure the exporter
  • Adding custom labels to metrics

Usage:

Simple usage:

squid-exporter -squid-hostname "localhost" -squid-port 3128

Configure Prometheus to scrape metrics from localhost:9301/metrics

- job_name: squid
  # squid-exporter is installed, grab stats about the local
  # squid instance.
  target_groups:
    - targets: ['localhost:9301']

To get all the parameteres, command line arguments always override default and environment variables configs:

squid-exporter -help

The following environment variables can be used to override default parameters:

SQUID_EXPORTER_LISTEN
SQUID_EXPORTER_METRICS_PATH
SQUID_HOSTNAME
SQUID_PORT
SQUID_LOGIN
SQUID_PASSWORD
SQUID_EXTRACTSERVICETIMES

Usage with docker:

Basic setup assuming Squid is running on the same machine:

docker run --net=host -d boynux/squid-exporter

Setup with Squid running on a different host

docker run -p 9301:9301 -d boynux/squid-exporter -squid-hostname "192.168.0.2" -squid-port 3128 -listen ":9301"

With environment variables

docker run -p 9301:9301 -d -e SQUID_PORT="3128" -e SQUID_HOSTNAME="192.168.0.2" -e SQUID_EXPORTER_LISTEN=":9301" boynux/squid-exporter

Build:

This project is written in Go, so all the usual methods for building (or cross compiling) a Go application would work.

If you are not very familiar with Go you can download the binary from releases.

Or build it for your OS:

go install https://github.com/boynux/squid-exporter

then you can find the binary in: $GOPATH/bin/squid-exporter

Features:

  • [ ] Expose Squid counters
    • [x] Client HTTP
    • [x] Server HTTP
    • [x] Server ALL
    • [x] Server FTP
    • [x] Server Other
    • [ ] ICP
    • [ ] CD
    • [x] Swap
    • [ ] Page Faults
    • [ ] Others
  • [ ] Expose Squid service times
    • [x] HTTP requests
    • [x] Cache misses
    • [x] Cache hits
    • [x] Near hits
    • [ ] Not-Modified replies
    • [x] DNS lookups
    • [ ] ICP queries
  • [ ] Histograms
  • [ ] Other metrics
  • [x] Squid Authentication (Basic Auth)

FAQ:

  • Q: Metrics are not reported by exporter

  • A: That usually means the exporter cannot reach squid server or the config manager permissions are not set corretly. To debug and mitigate:

    • First make sure the exporter service can reach to squid server IP Address (you can use telnet to test that)
    • Make sure you allow exporter to query the squid server in config you will need something like this (172.20.0.0/16 is the network for exporter, you can also use a single IP if needed):
    #http_access allow manager localhost
    acl prometheus src 172.20.0.0/16
    http_access allow manager prometheus
    
  • Q: Why process_open_fds metric is not exported?

  • A: This usualy means exporter don't have permission to read /proc/<squid_proc_id>/fd folder. You can either

  1. [recommended] Set CAP_DAC_READ_SEARCH capability for squid exporter process (or docker). (eg. sudo setcap 'cap_dac_read_search+ep' ./bin/squid-exporter)
  2. [not recommended] Run the exporter as root.

Contribution:

Pull request and issues are very welcome.

If you found this program useful please consider donations Donate

Copyright:

MIT License

Popular Prometheus Projects
Popular Server Projects
Popular Operations Categories
Related Searches

Get A Weekly Email With Trending Projects For These Categories
No Spam. Unsubscribe easily at any time.
Golang
Server
Metrics
Environment Variables
Prometheus